/*
- * Sone - AboutPage.java - Copyright © 2010 David Roden
+ * Sone - AboutPage.java - Copyright © 2010–2016 David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
package net.pterodactylus.sone.web;
-import net.pterodactylus.util.template.DataProvider;
+import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
+import net.pterodactylus.util.template.TemplateContext;
import net.pterodactylus.util.version.Version;
/**
*/
public class AboutPage extends SoneTemplatePage {
- /** The version to display. */
- private final Version version;
+ private final String version;
+ private final int year;
+ private final String homepage;
- /**
- * Creates a new “about” page.
- *
- * @param template
- * The template to render
- * @param webInterface
- * The Sone web interface
- * @param version
- * The version to display
- */
- public AboutPage(Template template, WebInterface webInterface, Version version) {
+ public AboutPage(Template template, WebInterface webInterface, String version, int year, String homepage) {
super("about.html", template, "Page.About.Title", webInterface, false);
this.version = version;
+ this.year = year;
+ this.homepage = homepage;
}
- //
- // TEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
@Override
- protected void processTemplate(Request request, DataProvider dataProvider) throws RedirectException {
- super.processTemplate(request, dataProvider);
- dataProvider.set("version", version);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
+ templateContext.set("version", version);
+ templateContext.set("year", year);
+ templateContext.set("homepage", homepage);
}
}