category_entries.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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="{{ route "markCategoryAsRead" "categoryID" .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="{{ route "categoryEntriesAll" "categoryID" .category.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
  42. </li>
  43. {{ else }}
  44. <li>
  45. <a class="page-link" href="{{ route "categoryEntries" "categoryID" .category.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
  46. </li>
  47. {{ end }}
  48. <li>
  49. <a class="page-link" href="{{ route "categoryFeeds" "categoryID" .category.ID }}">{{ icon "feeds" }}{{ t "menu.feeds" }}</a>
  50. </li>
  51. <li>
  52. <form
  53. action="{{ route "refreshCategoryEntriesPage" "categoryID" .category.ID }}"
  54. class="page-header-action-form"
  55. >
  56. <button class="page-button" data-label-loading="{{ t "confirm.loading" }}">
  57. {{ icon "refresh" }}{{ t "menu.refresh_all_feeds" }}
  58. </button>
  59. </form>
  60. </li>
  61. </ul>
  62. </nav>
  63. </section>
  64. {{ end }}
  65. {{ define "content"}}
  66. {{ if not .entries }}
  67. <p role="alert" class="alert">{{ t "alert.no_category_entry" }}</p>
  68. {{ else }}
  69. <div class="pagination-top">
  70. {{ template "pagination" .pagination }}
  71. </div>
  72. <div class="items">
  73. {{ range .entries }}
  74. <article
  75. class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
  76. data-id="{{ .ID }}"
  77. aria-labelledby="entry-title-{{ .ID }}"
  78. tabindex="-1"
  79. >
  80. <header class="item-header" dir="auto">
  81. <h2 id="entry-title-{{ .ID }}" class="item-title">
  82. <a
  83. {{ if $.showOnlyUnreadEntries }}
  84. href="{{ route "unreadCategoryEntry" "categoryID" .Feed.Category.ID "entryID" .ID }}"
  85. {{ else }}
  86. href="{{ route "categoryEntry" "categoryID" .Feed.Category.ID "entryID" .ID }}"
  87. {{ end }}
  88. >
  89. {{ if ne .Feed.Icon.IconID 0 }}
  90. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16" loading="lazy" alt="">
  91. {{ end }}
  92. {{ .Title }}
  93. </a>
  94. </h2>
  95. <span class="category">
  96. <a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}" aria-label="{{ t "page.category_label" .Feed.Category.Title }}">
  97. {{ .Feed.Category.Title }}
  98. </a>
  99. </span>
  100. </header>
  101. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  102. </article>
  103. {{ end }}
  104. </div>
  105. <section class="page-footer">
  106. {{ if .entries }}
  107. <ul>
  108. <li>
  109. <button
  110. class="page-button"
  111. data-action="markPageAsRead"
  112. data-label-question="{{ t "confirm.question" }}"
  113. data-label-yes="{{ t "confirm.yes" }}"
  114. data-label-no="{{ t "confirm.no" }}"
  115. data-label-loading="{{ t "confirm.loading" }}"
  116. data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
  117. </li>
  118. </ul>
  119. {{ end }}
  120. </section>
  121. <div class="pagination-bottom">
  122. {{ template "pagination" .pagination }}
  123. </div>
  124. {{ end }}
  125. {{ end }}