1616#include <Wt/WEnvironment>
1717#include <Wt/WLogger>
1818#include <Wt/WMenu>
19+ #include <Wt/WPushButton>
1920#include <Wt/WStackedWidget>
20- #include <Wt/WVBoxLayout>
2121#include <Wt/WTabWidget>
2222#include <Wt/WTable>
2323#include <Wt/WTableCell>
2424#include <Wt/WTemplate>
2525#include <Wt/WText>
2626#include <Wt/WViewWidget>
27+ #include <Wt/WVBoxLayout>
2728
2829#include "Home.h"
2930#include "view/BlogView.h"
@@ -42,6 +43,7 @@ Home::Home(const WEnvironment& env, const std::string& title,
4243 sourceViewer_ (0 )
4344{
4445 messageResourceBundle ().use (appRoot () + resourceBundle , false);
46+
4547 useStyleSheet (cssPath + "/wt.css" );
4648 useStyleSheet (cssPath + "/wt_ie.css" , "lt IE 7" );
4749 useStyleSheet ("css/home.css" );
@@ -188,8 +190,14 @@ void Home::setLanguage(int index)
188190
189191WWidget * Home ::linkSourceBrowser (const std ::string & example )
190192{
191- WAnchor * a = new WAnchor ("" , tr ("source-browser" ));
192- a -> setRefInternalPath ("/" + SRC_INTERNAL_PATH + "/" + example );
193+ /*
194+ * Instead of using a WAnchor, which will not progress properly because
195+ * it is wrapped with wrapView() (-- should we not fix that?), we use
196+ * a WText which contains an anchor, and enable internal path encoding.
197+ */
198+ std ::string path = "#/" + SRC_INTERNAL_PATH + "/" + example ;
199+ WText * a = new WText (tr ("source-browser-link" ).arg (path ));
200+ a -> setInternalPathEncoding (true);
193201 return a ;
194202}
195203
@@ -276,7 +284,9 @@ WWidget *Home::features()
276284
277285WWidget * Home ::documentation ()
278286{
279- return new WText (tr ("home.documentation" ));
287+ WText * result = new WText (tr ("home.documentation" ));
288+ result -> setInternalPathEncoding (true);
289+ return result ;
280290}
281291
282292WWidget * Home ::otherLanguage ()
@@ -343,6 +353,48 @@ void Home::readReleases(WTable *releaseTable)
343353 }
344354}
345355
356+ #ifdef WT_EMWEB_BUILD
357+ WWidget * Home ::quoteForm ()
358+ {
359+ WContainerWidget * result = new WContainerWidget ();
360+ result -> setStyleClass ("quote" );
361+
362+ WPushButton * quoteButton = new WPushButton (tr ("quote.request" ), result );
363+ WWidget * quoteForm = createQuoteForm ();
364+ result -> addWidget (quoteForm );
365+
366+ quoteButton -> clicked ().connect (quoteForm , & WWidget ::show );
367+ quoteButton -> clicked ().connect (quoteButton , & WWidget ::hide );
368+
369+ quoteForm -> hide ();
370+
371+ return result ;
372+ }
373+ #endif // WT_EMWEB_BUILD
374+
375+ WWidget * Home ::download ()
376+ {
377+ WContainerWidget * result = new WContainerWidget ();
378+ result -> addWidget (new WText (tr ("home.download" )));
379+
380+ result -> addWidget (new WText (tr ("home.download.license" )));
381+
382+ #ifdef WT_EMWEB_BUILD
383+ result -> addWidget (quoteForm ());
384+ #endif // WT_EMWEB_BUILD
385+
386+ result -> addWidget (new WText (tr ("home.download.packages" )));
387+
388+ releases_ = new WTable ();
389+ readReleases (releases_ );
390+ result -> addWidget (releases_ );
391+
392+ result -> addWidget (new WText (tr ("home.download.other" )));
393+
394+ return result ;
395+ }
396+
397+
346398WString Home ::tr (const char * key )
347399{
348400 return WString ::tr (key );
0 commit comments