category_entries.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. {{ define "title"}}{{ .category.Title }} ({{ .total }}){{ end }}
  2. {{ define "page_header"}}
  3. <section class="page-header" aria-labelledby="page-header-title">
  4. <h1 id="page-header-title" dir="auto">
  5. {{ .category.Title }}
  6. <span aria-hidden="true">({{ .total }})</span>
  7. </h1>
  8. <span class="sr-only">
  9. {{ if .showOnlyUnreadEntries }}
  10. {{ plural "page.unread_entry_count" .total .total }}
  11. {{ else }}
  12. {{ plural "page.total_entry_count" .total .total }}
  13. {{ end }}
  14. </span>
  15. <nav aria-label="{{ .category.Title }} {{ t "menu.title" }}">
  16. <ul>
  17. {{ if .entries }}
  18. <li>
  19. <button
  20. class="page-button"
  21. data-action="markPageAsRead"
  22. data-label-question="{{ t "confirm.question" }}"
  23. data-label-yes="{{ t "confirm.yes" }}"
  24. data-label-no="{{ t "confirm.no" }}"
  25. data-label-loading="{{ t "confirm.loading" }}"
  26. data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
  27. </li>
  28. <li>
  29. <button
  30. class="page-button"
  31. data-confirm="true"
  32. data-label-question="{{ t "confirm.question" }}"
  33. data-label-yes="{{ t "confirm.yes" }}"
  34. data-label-no="{{ t "confirm.no" }}"
  35. data-label-loading="{{ t "confirm.loading" }}"
  36. data-url="{{ routePath "/category/%d/mark-all-as-read" .category.ID }}">{{ icon "mark-all-as-read" }}{{ t "menu.mark_all_as_read" }}</button>
  37. </li>
  38. {{ end }}
  39. {{ if .showOnlyUnreadEntries }}
  40. <li>
  41. <a class="page-link" href="{{ routePath "/category/%d/entries/all" .category.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
  42. </li>
  43. <li>
  44. <a class="page-link" href="{{ routePath "/category/%d/entries/starred" .category.ID }}">{{ icon "star" }}{{ t "menu.show_only_starred_entries" }}</a>
  45. </li>
  46. {{ else if .showOnlyStarredEntries }}
  47. <li>
  48. <a class="page-link" href="{{ routePath "/category/%d/entries" .category.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
  49. </li>
  50. <li>
  51. <a class="page-link" href="{{ routePath "/category/%d/entries/all" .category.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
  52. </li>
  53. {{ else }}
  54. <li>
  55. <a class="page-link" href="{{ routePath "/category/%d/entries" .category.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
  56. </li>
  57. <li>
  58. <a class="page-link" href="{{ routePath "/category/%d/entries/starred" .category.ID }}">{{ icon "star" }}{{ t "menu.show_only_starred_entries" }}</a>
  59. </li>
  60. {{ end }}
  61. <li>
  62. <a class="page-link" href="{{ routePath "/category/%d/feeds" .category.ID }}">{{ icon "feeds" }}{{ t "menu.feeds" }}</a>
  63. </li>
  64. <li>
  65. <form
  66. action="{{ routePath "/category/%d/entries/refresh" .category.ID }}"
  67. class="page-header-action-form"
  68. >
  69. <button class="page-button" data-label-loading="{{ t "confirm.loading" }}">
  70. {{ icon "refresh" }}{{ t "menu.refresh_all_feeds" }}
  71. </button>
  72. </form>
  73. </li>
  74. </ul>
  75. </nav>
  76. </section>
  77. {{ end }}
  78. {{ define "content"}}
  79. {{ if not .entries }}
  80. <p role="alert" class="alert">{{ t "alert.no_category_entry" }}</p>
  81. {{ else }}
  82. <div class="pagination-top">
  83. {{ template "pagination" .pagination }}
  84. </div>
  85. <div class="items">
  86. {{ range .entries }}
  87. <article
  88. class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
  89. data-id="{{ .ID }}"
  90. aria-labelledby="entry-title-{{ .ID }}"
  91. tabindex="-1"
  92. >
  93. <header class="item-header" dir="auto">
  94. <h2 id="entry-title-{{ .ID }}" class="item-title">
  95. <a
  96. {{ if $.showOnlyUnreadEntries }}
  97. href="{{ routePath "/unread/category/%d/entry/%d" .Feed.Category.ID .ID }}"
  98. {{ else if $.showOnlyStarredEntries }}
  99. href="{{ routePath "/starred/category/%d/entry/%d" .Feed.Category.ID .ID }}"
  100. {{ else }}
  101. href="{{ routePath "/category/%d/entry/%d" .Feed.Category.ID .ID }}"
  102. {{ end }}
  103. {{ if and $.user.AlwaysOpenExternalLinks $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}
  104. >
  105. {{ if ne .Feed.Icon.IconID 0 }}
  106. <img src="{{ routePath "/feed-icon/%s" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
  107. {{ end }}
  108. {{ .Title }}
  109. </a>
  110. </h2>
  111. <span class="category">
  112. <a href="{{ routePath "/category/%d/entries" .Feed.Category.ID }}" aria-label="{{ t "page.category_label" .Feed.Category.Title }}">
  113. {{ .Feed.Category.Title }}
  114. </a>
  115. </span>
  116. </header>
  117. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  118. </article>
  119. {{ end }}
  120. </div>
  121. <section class="page-footer">
  122. {{ if .entries }}
  123. <ul>
  124. <li>
  125. <button
  126. class="page-button"
  127. data-action="markPageAsRead"
  128. data-label-question="{{ t "confirm.question" }}"
  129. data-label-yes="{{ t "confirm.yes" }}"
  130. data-label-no="{{ t "confirm.no" }}"
  131. data-label-loading="{{ t "confirm.loading" }}"
  132. data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
  133. </li>
  134. </ul>
  135. {{ end }}
  136. </section>
  137. <div class="pagination-bottom">
  138. {{ template "pagination" .pagination }}
  139. </div>
  140. {{ end }}
  141. {{ end }}