@(files: List[gitbucket.core.service.RepositorySearchService.FileSearchResult],
query: String,
page: Int,
repository: gitbucket.core.service.RepositoryService.RepositoryInfo)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.view.helpers
@import gitbucket.core.service.RepositorySearchService
@gitbucket.core.html.main("Search Results", Some(repository)){
@gitbucket.core.search.html.menu("files", query, repository){
@if(query.nonEmpty) {
@if(files.isEmpty) {
<h4>We couldn't find any code matching '@query'</h4>
} else {
<h4>We have found @files.size code @helpers.plural(files.size, "result")</h4>
}
}
@files.drop((page - 1) * RepositorySearchService.CodeLimit).take(RepositorySearchService.CodeLimit).map { file =>
<div>
<h5><a href="@helpers.url(repository)/blob/@repository.repository.defaultBranch/@file.path">@file.path</a></h5>
<div class="small muted">Last committed @gitbucket.core.helper.html.datetimeago(file.lastModified)</div>
<pre class="prettyprint linenums:@file.highlightLineNumber" style="padding-left: 25px;">@Html(file.highlightText)</pre>
</div>
}
@gitbucket.core.helper.html.paginator(page, files.size, RepositorySearchService.CodeLimit, 10,
s"${helpers.url(repository)}/search?q=${helpers.urlEncode(query)}&type=code")
}
}