unread_entries.html 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {{ define "title"}}{{ t "page.unread.title" }} {{ if gt .countUnread 0 }}({{ .countUnread }}){{ end }} {{ end }}
  2. {{ define "page_header"}}
  3. <section class="page-header" aria-labelledby="page-header-title page-header-title-count">
  4. <h1 id="page-header-title">
  5. {{ t "page.unread.title" }}
  6. <span aria-hidden="true">(<span class="unread-counter">{{ .countUnread }}</span>)</span>
  7. </h1>
  8. <span id="page-header-title-count" class="sr-only">{{ plural "page.unread_entry_count" .countUnread .countUnread }}</span>
  9. {{ if .entries }}
  10. <nav aria-label="{{ t "page.unread.title" }} {{ t "menu.title" }}">
  11. <ul>
  12. <li>
  13. <button
  14. class="page-button"
  15. data-action="markPageAsRead"
  16. data-show-only-unread="1"
  17. data-label-question="{{ t "confirm.question" }}"
  18. data-label-yes="{{ t "confirm.yes" }}"
  19. data-label-no="{{ t "confirm.no" }}"
  20. data-label-loading="{{ t "confirm.loading" }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
  21. </li>
  22. <li>
  23. <button
  24. class="page-button"
  25. data-confirm="true"
  26. data-url="{{ route "markAllAsRead" }}"
  27. data-redirect-url="{{ route "unread" }}"
  28. data-label-question="{{ t "confirm.question" }}"
  29. data-label-yes="{{ t "confirm.yes" }}"
  30. data-label-no="{{ t "confirm.no" }}"
  31. data-label-loading="{{ t "confirm.loading" }}">{{ icon "mark-all-as-read" }}{{ t "menu.mark_all_as_read" }}</button>
  32. </li>
  33. </ul>
  34. </nav>
  35. {{ end }}
  36. </section>
  37. {{ end }}
  38. {{ define "content"}}
  39. {{ if not .entries }}
  40. <p role="alert" class="alert">{{ t "alert.no_unread_entry" }}</p>
  41. {{ else }}
  42. <div class="pagination-top">
  43. {{ template "pagination" .pagination -}}
  44. </div>
  45. <div class="items hide-read-items">
  46. {{ range .entries -}}
  47. <article
  48. class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
  49. data-id="{{ .ID }}"
  50. aria-labelledby="entry-title-{{ .ID }}"
  51. tabindex="-1"
  52. >
  53. <header class="item-header" dir="auto">
  54. <h2 id="entry-title-{{ .ID }}" class="item-title">
  55. <a href="{{ route "unreadEntry" "entryID" .ID }}">
  56. {{ if ne .Feed.Icon.IconID 0 -}}
  57. <img src="{{ route "feedIcon" "externalIconID" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
  58. {{ end -}}
  59. {{ .Title }}
  60. </a>
  61. </h2>
  62. <span class="category">
  63. <a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">
  64. {{ .Feed.Category.Title }}
  65. </a>
  66. </span>
  67. </header>
  68. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry -}}
  69. </article>
  70. {{ end }}
  71. </div>
  72. <section class="page-footer">
  73. {{ if .entries }}
  74. <ul>
  75. <li>
  76. <button
  77. class="page-button"
  78. data-action="markPageAsRead"
  79. data-label-question="{{ t "confirm.question" }}"
  80. data-label-yes="{{ t "confirm.yes" }}"
  81. data-label-no="{{ t "confirm.no" }}"
  82. data-label-loading="{{ t "confirm.loading" }}"
  83. >
  84. {{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}
  85. </button>
  86. </li>
  87. </ul>
  88. {{ end }}
  89. </section>
  90. <div class="pagination-bottom">
  91. {{ template "pagination" .pagination }}
  92. </div>
  93. {{ end }}
  94. {{ end }}