🔥 Remove templates from FreenetTemplatePages
[Sone.git] / src / main / kotlin / net / pterodactylus / sone / web / pages / SearchPage.kt
index 11c85dd..69a19f3 100644 (file)
@@ -7,6 +7,7 @@ import freenet.support.Logger
 import net.pterodactylus.sone.data.Post
 import net.pterodactylus.sone.data.PostReply
 import net.pterodactylus.sone.data.Sone
+import net.pterodactylus.sone.main.*
 import net.pterodactylus.sone.utils.Pagination
 import net.pterodactylus.sone.utils.emptyToNull
 import net.pterodactylus.sone.utils.memoize
@@ -17,7 +18,6 @@ import net.pterodactylus.sone.web.page.*
 import net.pterodactylus.sone.web.pages.SearchPage.Optionality.FORBIDDEN
 import net.pterodactylus.sone.web.pages.SearchPage.Optionality.OPTIONAL
 import net.pterodactylus.sone.web.pages.SearchPage.Optionality.REQUIRED
-import net.pterodactylus.util.template.Template
 import net.pterodactylus.util.template.TemplateContext
 import net.pterodactylus.util.text.StringEscaper
 import net.pterodactylus.util.text.TextException
@@ -28,11 +28,12 @@ import javax.inject.Inject
  * This page lets the user search for posts and replies that contain certain
  * words.
  */
-class SearchPage(template: Template, webInterface: WebInterface, ticker: Ticker = Ticker.systemTicker()) :
-               SoneTemplatePage("search.html", webInterface, template, "Page.Search.Title") {
+@TemplatePath("/templates/search.html")
+class SearchPage(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer, ticker: Ticker = Ticker.systemTicker()) :
+               SoneTemplatePage("search.html", webInterface, loaders, templateRenderer, pageTitleKey = "Page.Search.Title") {
 
-       @Inject constructor(template: Template, webInterface: WebInterface) :
-                       this(template, webInterface, Ticker.systemTicker())
+       @Inject constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) :
+                       this(webInterface, loaders, templateRenderer, Ticker.systemTicker())
 
        private val cache: Cache<Iterable<Phrase>, Pagination<Post>> = CacheBuilder.newBuilder().ticker(ticker).expireAfterAccess(5, MINUTES).build()