X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FSearchPage.kt;h=4e29246c0bcc5dc0bc7f8321dc7a21e77e77cf17;hp=d9800720d49239e7c77cb39226b684a0d6a9ad56;hb=2e6be6f2fb6afede009dacc48b8e3318e30e5057;hpb=6a3f1fede0cda5cd6ed56204aa1dd37a19813cb9 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt index d980072..4e29246 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/SearchPage.kt @@ -1,39 +1,30 @@ package net.pterodactylus.sone.web.pages import com.google.common.base.Ticker -import com.google.common.cache.Cache -import com.google.common.cache.CacheBuilder -import freenet.support.Logger -import net.pterodactylus.sone.data.Post -import net.pterodactylus.sone.data.PostReply -import net.pterodactylus.sone.data.Sone +import com.google.common.cache.* +import freenet.support.* +import net.pterodactylus.sone.data.* import net.pterodactylus.sone.main.* -import net.pterodactylus.sone.utils.Pagination -import net.pterodactylus.sone.utils.emptyToNull -import net.pterodactylus.sone.utils.memoize -import net.pterodactylus.sone.utils.paginate -import net.pterodactylus.sone.utils.parameters -import net.pterodactylus.sone.web.WebInterface +import net.pterodactylus.sone.utils.* +import net.pterodactylus.sone.web.* 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 -import java.util.concurrent.TimeUnit.MINUTES -import javax.inject.Inject +import net.pterodactylus.sone.web.pages.SearchPage.Optionality.* +import net.pterodactylus.util.template.* +import net.pterodactylus.util.text.* +import java.util.concurrent.TimeUnit.* +import javax.inject.* /** * This page lets the user search for posts and replies that contain certain * words. */ -class SearchPage(template: Template, webInterface: WebInterface, loaders: Loaders, ticker: Ticker = Ticker.systemTicker()) : - SoneTemplatePage("search.html", webInterface, loaders, template = template, pageTitleKey = "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, loaders: Loaders) : - this(template, webInterface, loaders, Ticker.systemTicker()) + @Inject + constructor(webInterface: WebInterface, loaders: Loaders, templateRenderer: TemplateRenderer) : + this(webInterface, loaders, templateRenderer, Ticker.systemTicker()) private val cache: Cache, Pagination> = CacheBuilder.newBuilder().ticker(ticker).expireAfterAccess(5, MINUTES).build()