unread_entries.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <a href="#"
  14. role="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" }}</a>
  21. </li>
  22. <li>
  23. <a href="#"
  24. role="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" }}</a>
  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. >
  52. <header class="item-header" dir="auto">
  53. <h2 id="entry-title-{{ .ID }}" class="item-title">
  54. <a href="{{ route "unreadEntry" "entryID" .ID }}">
  55. {{ if ne .Feed.Icon.IconID 0 }}
  56. <img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16" loading="lazy" alt="">
  57. {{ end }}
  58. {{ .Title }}
  59. </a>
  60. </h2>
  61. <span class="category">
  62. <a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">
  63. {{ .Feed.Category.Title }}
  64. </a>
  65. </span>
  66. </header>
  67. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  68. </article>
  69. {{ end }}
  70. </div>
  71. <section class="page-footer">
  72. {{ if .entries }}
  73. <ul>
  74. <li>
  75. <a href="#"
  76. role="button"
  77. data-action="markPageAsRead"
  78. data-label-question="{{ t "confirm.question" }}"
  79. data-label-yes="{{ t "confirm.yes" }}"
  80. data-label-no="{{ t "confirm.no" }}"
  81. data-label-loading="{{ t "confirm.loading" }}"
  82. >
  83. {{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}
  84. </a>
  85. </li>
  86. </ul>
  87. {{ end }}
  88. </section>
  89. <div class="pagination-bottom">
  90. {{ template "pagination" .pagination }}
  91. </div>
  92. {{ end }}
  93. {{ end }}