10 #include <boost/lexical_cast.hpp>
11 #include <boost/tokenizer.hpp>
12 #include <boost/algorithm/string.hpp>
15 #include <Wt/WApplication>
16 #include <Wt/WEnvironment>
19 #include <Wt/WPushButton>
20 #include <Wt/WStackedWidget>
21 #include <Wt/WTabWidget>
23 #include <Wt/WTableCell>
24 #include <Wt/WTemplate>
26 #include <Wt/WViewWidget>
27 #include <Wt/WVBoxLayout>
30 #include "view/BlogView.h"
39 const std::string& resourceBundle,
const std::string& cssPath)
114 languagesDiv->
setId(
"top_languages");
116 for (
unsigned i = 0; i <
languages.size(); ++i) {
118 new WText(
"- ", languagesDiv);
127 WAnimation fade(WAnimation::Fade, WAnimation::Linear, 250);
129 contents->
setId(
"main_page");
145 WMenuItem::PreLoading);
153 WMenuItem::PreLoading);
160 WMenuItem::PreLoading);
171 result->
bindWidget(
"languages", languagesDiv);
184 std::string langPath = l.
path_;
189 blog->setInternalBasePath(langPath +
"blog/");
204 WText *a =
new WText(
tr(
"source-browser-link").arg(path));
213 if (langPath.empty())
216 langPath =
'/' + langPath +
'/';
220 for (
unsigned i = 0; i <
languages.size(); ++i) {
244 if (path.size() >= 4 && path.substr(0, 4) ==
"/src") {
251 return new WText(
tr(
"home.intro"));
257 std::string langPath = l.
path_;
258 BlogView *
blog =
new BlogView(langPath +
"blog/",
259 appRoot() +
"blog.db",
"/wt/blog/feed/");
260 blog->setObjectName(
"blog");
262 if (!blog->user().empty())
275 """window.chat.emit(window.chat, 'login', "
286 return new WText(
tr(
"home.status"));
291 return new WText(
tr(
"home.features"));
303 return new WText(
tr(
"home.other-language"));
308 return makeStaticModel(boost::bind(createWidget,
this));
311 std::string
Home::href(
const std::string& url,
const std::string& description)
313 return "<a href=\"" + url +
"\" target=\"_blank\">" + description +
"</a>";
318 return new WText(
tr(
"home.community"));
323 std::ifstream f((
filePrefix() +
"releases.txt").c_str());
325 releaseTable->
clear();
346 typedef boost::tokenizer<boost::escaped_list_separator<char> >
348 CsvTokenizer tok(line);
350 CsvTokenizer::iterator i=tok.begin();
352 std::string fileName = *i;
353 std::string description = *(++i);
355 (
new WText(
href(
"http://prdownloads.sourceforge.net/witty/"
356 + fileName +
"?download", description)));
365 #ifdef WT_EMWEB_BUILD
374 requestTemplate->
bindWidget(
"button", quoteButton);
379 quoteButton->
clicked().connect(quoteForm, &WWidget::show);
380 quoteButton->
clicked().connect(requestTemplate, &WWidget::hide);
386 #endif // WT_EMWEB_BUILD
395 #ifdef WT_EMWEB_BUILD
397 #endif // WT_EMWEB_BUILD
418 std::string googleCmd =
419 "if (window.pageTracker) {"
421 "" "setTimeout(function() {"
422 "" "window.pageTracker._trackPageview(\""