search_entries.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. {{ define "title"}}{{ t "page.search.title" }} ({{ .total }}){{ end }}
  2. {{ define "page_header"}}
  3. <section class="page-header" aria-labelledby="page-header-title">
  4. <h1 id="page-header-title">{{ t "page.search.title" }} ({{ .total }})</h1>
  5. </section>
  6. {{ end }}
  7. {{ define "content"}}
  8. {{ if not .entries }}
  9. <p role="alert" class="alert alert-info">{{ t "alert.no_search_result" }}</p>
  10. {{ else }}
  11. <div class="pagination-top">
  12. {{ template "pagination" .pagination }}
  13. </div>
  14. <div class="items">
  15. {{ range .entries }}
  16. <article
  17. class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
  18. data-id="{{ .ID }}"
  19. aria-labelledby="entry-title-{{ .ID }}"
  20. >
  21. <header class="item-header" dir="auto">
  22. <h2 id="entry-title-{{ .ID }}" class="item-title">
  23. <a href="{{ route "searchEntry" "entryID" .ID }}?q={{ $.searchQuery }}">
  24. {{ if ne .Feed.Icon.IconID 0 }}
  25. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .Feed.Title }}">
  26. {{ else }}
  27. <span class="sr-only">{{ .Feed.Title }}</span>
  28. {{ end }}
  29. {{ .Title }}
  30. </a>
  31. </h2>
  32. <span class="category">
  33. <a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">
  34. {{ .Feed.Category.Title }}
  35. </a>
  36. </span>
  37. </header>
  38. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  39. </article>
  40. {{ end }}
  41. </div>
  42. <div class="pagination-bottom">
  43. {{ template "pagination" .pagination }}
  44. </div>
  45. {{ end }}
  46. {{ end }}