31aee0573c5182e3fbef11974b42a4d03db061d2
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / AboutPage.kt
1 package net.pterodactylus.sone.web.pages
2
3 import net.pterodactylus.sone.main.*
4 import net.pterodactylus.sone.web.WebInterface
5 import net.pterodactylus.sone.web.page.*
6 import net.pterodactylus.util.template.TemplateContext
7 import javax.inject.Inject
8
9 /**
10  * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext].
11  */
12 @MenuName("About")
13 @TemplatePath("/templates/about.html")
14 class AboutPage @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer,
15                 private val pluginVersion: PluginVersion,
16                 private val pluginYear: PluginYear,
17                 private val pluginHomepage: PluginHomepage): SoneTemplatePage("about.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.About.Title") {
18
19         override fun handleRequest(freenetRequest: FreenetRequest, templateContext: TemplateContext) {
20                 templateContext["version"] = pluginVersion.version
21                 templateContext["year"] = pluginYear.year
22                 templateContext["homepage"] = pluginHomepage.homepage
23         }
24
25 }