1 package net.pterodactylus.sone.web.pages
3 import net.pterodactylus.sone.main.SonePlugin.PluginHomepage
4 import net.pterodactylus.sone.main.SonePlugin.PluginVersion
5 import net.pterodactylus.sone.main.SonePlugin.PluginYear
6 import net.pterodactylus.sone.web.WebInterface
7 import net.pterodactylus.sone.web.page.FreenetRequest
8 import net.pterodactylus.util.template.Template
9 import net.pterodactylus.util.template.TemplateContext
10 import javax.inject.Inject
13 * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext].
15 class AboutPage @Inject constructor(template: Template, webInterface: WebInterface,
16 private val pluginVersion: PluginVersion,
17 private val pluginYear: PluginYear,
18 private val pluginHomepage: PluginHomepage): SoneTemplatePage("about.html", webInterface, template, "Page.About.Title") {
20 override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
21 templateContext["version"] = pluginVersion.version
22 templateContext["year"] = pluginYear.year
23 templateContext["homepage"] = pluginHomepage.homepage