<commit_before>#include "application.hpp"

#include <boost/foreach.hpp>
#include <Wt/WBootstrapTheme>
#include <Wt/WNavigationBar>
#include <Wt/WPopupMenu>
#include <Wt/WStackedWidget>
#include <Wt/WText>
#include <Wt/Auth/AbstractPasswordService>
#include <Wt/WBorderLayout>

#include "shop/BasketListWidget.hpp"
#include "shop/InputItemWidget.hpp"
#include "shop/ItemGroupCheckbox.hpp"

ShareBuy::ShareBuy(const Wt::WEnvironment &env, shared_ptr<std::map<string, shared_ptr<Shop> > > shops, string databaseFile)
:Wt::WApplication(env),
dbSession(databaseFile),
shops(shops)
{
	// app metadata
	enableUpdates(true); // necessary for updates from the backend parsing web pages
	Wt::WBootstrapTheme *theme=new Wt::WBootstrapTheme();
	//theme->setVersion(3);
	setTheme(theme);

	// navbar
	Wt::WNavigationBar *nav=new Wt::WNavigationBar(this->root());
	nav->setTitle("Sharebuy");
	nav->setResponsive(true);

	Wt::WMenu *leftMenu=new Wt::WMenu();
	nav->addMenu(leftMenu);

	// my items
	Wt::WMenuItem *myItems = leftMenu->addItem("My wishlist");
	myItems->setLink(Wt::WLink(Wt::WLink::InternalPath,"/user/wishlist"));
	myItems->setSelectable(false);

	// shops
	Wt::WPopupMenu *shopMenu=new Wt::WPopupMenu();
	BOOST_FOREACH(auto tuple,*shops)
	{
		shopMenu->addItem(tuple.first)->setLink(Wt::WLink(Wt::WLink::InternalPath,"/shop/"+tuple.first));
	}
	/*Wt::WMenuItem *shopItem=new Wt::WMenuItem("Shops");<commit_msg>Fixed uninitialized pointer for auth widget<commit_after>#include "application.hpp"

#include <boost/foreach.hpp>
#include <Wt/WBootstrapTheme>
#include <Wt/WNavigationBar>
#include <Wt/WPopupMenu>
#include <Wt/WStackedWidget>
#include <Wt/WText>
#include <Wt/Auth/AbstractPasswordService>
#include <Wt/WBorderLayout>

#include "shop/BasketListWidget.hpp"
#include "shop/InputItemWidget.hpp"
#include "shop/ItemGroupCheckbox.hpp"

ShareBuy::ShareBuy(const Wt::WEnvironment &env, shared_ptr<std::map<string, shared_ptr<Shop> > > shops, string databaseFile)
:Wt::WApplication(env),
dbSession(databaseFile),
shops(shops),
authWidget(NULL)
{
	// app metadata
	enableUpdates(true); // necessary for updates from the backend parsing web pages
	Wt::WBootstrapTheme *theme=new Wt::WBootstrapTheme();
	//theme->setVersion(3);
	setTheme(theme);

	// navbar
	Wt::WNavigationBar *nav=new Wt::WNavigationBar(this->root());
	nav->setTitle("Sharebuy");
	nav->setResponsive(true);

	Wt::WMenu *leftMenu=new Wt::WMenu();
	nav->addMenu(leftMenu);

	// my items
	Wt::WMenuItem *myItems = leftMenu->addItem("My wishlist");
	myItems->setLink(Wt::WLink(Wt::WLink::InternalPath,"/user/wishlist"));
	myItems->setSelectable(false);

	// shops
	Wt::WPopupMenu *shopMenu=new Wt::WPopupMenu();
	BOOST_FOREACH(auto tuple,*shops)
	{
		shopMenu->addItem(tuple.first)->setLink(Wt::WLink(Wt::WLink::InternalPath,"/shop/"+tuple.first));
	}
	/*Wt::WMenuItem *shopItem=new Wt::WMenuItem("Shops");
{'fraction_non_alphanumeric': 0.17096100278551532, 'fraction_numerical': 0.0006963788300835655, 'mean_word_length': 7.474926253687316, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5406331', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1057, 'n_words': 165}