1 package net.pterodactylus.sone.web
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.page.FreenetRequest
7 import net.pterodactylus.util.template.Template
8 import net.pterodactylus.util.template.TemplateContext
9 import javax.inject.Inject
10 import javax.inject.Singleton
13 * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext].
16 class AboutPage @Inject constructor(template: Template, webInterface: WebInterface,
17 private val pluginVersion: PluginVersion,
18 private val pluginYear: PluginYear,
19 private val pluginHomepage: PluginHomepage) : SoneTemplatePage("about.html", template, "Page.About.Title", webInterface, false) {
21 override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) {
22 templateContext["version"] = pluginVersion.version
23 templateContext["year"] = pluginYear.year
24 templateContext["homepage"] = pluginHomepage.homepage