lila/app/views/forum/search.scala.html

41 lines
1.1 KiB
HTML

@(text: String, views: Paginator[lila.forum.PostView])(implicit ctx: Context)
@title = @{ trans.search.txt() + " \"" + text.trim + "\"" }
@forum.layout(
title = title,
moreJs = jsTag("vendor/jquery.infinitescroll.min.js"),
searchText = text
) {
<h1>@title</h1>
<p class="nb_results">@views.nbResults posts found</p>
<table class="slist search_results">
@if(views.nbResults > 0) {
<tbody class="infinitescroll">
@views.nextPage.map { n =>
<tr><th class="pager none">
<a rel="next" href="@routes.ForumPost.search(text, n)">Next</a>
</th></tr>
<tr></tr>
}
@views.currentPageResults.map { view =>
<tr class="paginated_element">
<td>
<a class="post" href="@routes.ForumPost.redirect(view.post.id)">@view.categ.name - @view.topic.name #@view.post.number</a>
<p>@shortenWithBr(view.post.text, 200)</p>
</td>
<td class="info">
@momentFromNow(view.post.createdAt) by @authorLink(view.post)
</td>
</tr>
}
</tbody>
} else {
<tbody><tr><td>No forum post found</td></tr></tbody>
}
</table>
}