| 1 |
{{ define "title"}}{{ t "page.search.title" }} ({{ .total }}){{ end }} |
| 2 |
|
| 3 |
{{ define "page_header"}} |
| 4 |
<section class="page-header" aria-labelledby="page-header-title"> |
| 5 |
<h1 id="page-header-title">{{ t "page.search.title" }} ({{ .total }})</h1> |
| 6 |
</section> |
| 7 |
{{ end }} |
| 8 |
|
| 9 |
{{ define "content"}} |
| 10 |
<search role="search"> |
| 11 |
<form class="search-form" action="{{ routePath "/search" }}" aria-labelledby="search-input-label"> |
| 12 |
<div class="search-input-row"> |
| 13 |
<input type="search" name="q" id="search-input" aria-label="{{ t "search.label" }}" placeholder="{{ t "search.placeholder" }}" {{ if $.searchQuery }}value="{{ .searchQuery }}"{{ else }}autofocus{{ end }} required> |
| 14 |
<button type="submit" class="button button-primary" data-label-loading="{{ t "form.submit.loading" }}">{{ t "search.submit" }}</button> |
| 15 |
</div> |
| 16 |
<label class="search-filter"><input type="checkbox" name="unread" value="1" {{ if $.searchUnreadOnly }}checked{{ end }}> {{ t "menu.show_only_unread_entries" }}</label> |
| 17 |
</form> |
| 18 |
</search> |
| 19 |
|
| 20 |
{{ if $.searchQuery }} |
| 21 |
{{ if not .entries }} |
| 22 |
<p role="alert" class="alert alert-info">{{ t "alert.no_search_result" }}</p> |
| 23 |
{{ else }} |
| 24 |
<div class="pagination-top"> |
| 25 |
{{ template "pagination" .pagination }} |
| 26 |
</div> |
| 27 |
<div class="items"> |
| 28 |
{{ range .entries }} |
| 29 |
<article |
| 30 |
class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}" |
| 31 |
data-id="{{ .ID }}" |
| 32 |
aria-labelledby="entry-title-{{ .ID }}" |
| 33 |
> |
| 34 |
<header class="item-header" dir="auto"> |
| 35 |
<h2 id="entry-title-{{ .ID }}" class="item-title"> |
| 36 |
<a href="{{ routePath "/search/entry/%d" .ID }}{{ queryString (dict "q" $.searchQuery "unread" $.searchUnreadOnly) }}" {{ if and $.user.AlwaysOpenExternalLinks $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}> |
| 37 |
{{ if ne .Feed.Icon.IconID 0 }} |
| 38 |
<img src="{{ routePath "/feed-icon/%s" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="{{ .Feed.Title }}"> |
| 39 |
{{ else }} |
| 40 |
<span class="sr-only">{{ .Feed.Title }}</span> |
| 41 |
{{ end }} |
| 42 |
{{ .Title }} |
| 43 |
</a> |
| 44 |
</h2> |
| 45 |
<span class="category"> |
| 46 |
<a href="{{ routePath "/category/%d/entries" .Feed.Category.ID }}"> |
| 47 |
{{ .Feed.Category.Title }} |
| 48 |
</a> |
| 49 |
</span> |
| 50 |
</header> |
| 51 |
{{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }} |
| 52 |
</article> |
| 53 |
{{ end }} |
| 54 |
</div> |
| 55 |
<div class="pagination-bottom"> |
| 56 |
{{ template "pagination" .pagination }} |
| 57 |
</div> |
| 58 |
{{ end }} |
| 59 |
{{ end }} |
| 60 |
{{ end }} |