feed_entries.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. {{ define "title"}}{{ .feed.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. <a href="{{ .feed.SiteURL | safeURL }}" title="{{ .feed.SiteURL }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }} data-original-link="{{ .user.MarkReadOnView }}">{{ .feed.Title }}</a>
  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="{{ .feed.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 "markFeedAsRead" "feedID" .feed.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 "feedEntriesAll" "feedID" .feed.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
  42. </li>
  43. {{ else }}
  44. <li>
  45. <a class="page-link" href="{{ route "feedEntries" "feedID" .feed.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
  46. </li>
  47. {{ end }}
  48. <li>
  49. <button
  50. class="page-button"
  51. data-confirm="true"
  52. data-label-question="{{ t "confirm.question.refresh" }}"
  53. data-label-yes="{{ t "confirm.yes" }}"
  54. data-label-no="{{ t "confirm.no" }}"
  55. data-label-loading="{{ t "confirm.loading" }}"
  56. data-url="{{ route "refreshFeed" "feedID" .feed.ID }}?forceRefresh=true"
  57. data-no-action-url="{{ route "refreshFeed" "feedID" .feed.ID }}?forceRefresh=false">{{ icon "refresh" }}{{ t "menu.refresh_feed" }}</button>
  58. </li>
  59. <li>
  60. <a class="page-link" href="{{ route "editFeed" "feedID" .feed.ID }}">{{ icon "edit" }}{{ t "menu.edit_feed" }}</a>
  61. </li>
  62. <li>
  63. <button
  64. class="page-button"
  65. data-confirm="true"
  66. data-action="remove-feed"
  67. data-label-question="{{ t "confirm.question" }}"
  68. data-label-yes="{{ t "confirm.yes" }}"
  69. data-label-no="{{ t "confirm.no" }}"
  70. data-label-loading="{{ t "confirm.loading" }}"
  71. data-url="{{ route "removeFeed" "feedID" .feed.ID }}"
  72. data-redirect-url="{{ route "feeds" }}">{{ icon "delete" }}{{ t "action.remove_feed" }}</button>
  73. </li>
  74. </ul>
  75. </nav>
  76. </section>
  77. {{ end }}
  78. {{ define "content"}}
  79. {{ if ne .feed.ParsingErrorCount 0 }}
  80. <div role="alert" class="alert alert-error">
  81. <h3>{{ t "alert.feed_error" }}</h3>
  82. <p>{{ t .feed.ParsingErrorMsg }}</p>
  83. </div>
  84. {{ end }}
  85. {{ if not .entries }}
  86. {{ if .showOnlyUnreadEntries }}
  87. <p role="alert" class="alert">{{ t "alert.no_unread_entry" }}</p>
  88. {{ else }}
  89. <p role="alert" class="alert">{{ t "alert.no_feed_entry" }}</p>
  90. {{ end }}
  91. {{ else }}
  92. <div class="pagination-top">
  93. {{ template "pagination" .pagination }}
  94. </div>
  95. <div class="items">
  96. {{ range .entries }}
  97. <article
  98. class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
  99. data-id="{{ .ID }}"
  100. aria-labelledby="entry-title-{{ .ID }}"
  101. tabindex="-1"
  102. >
  103. <header class="item-header" dir="auto">
  104. <h2 id="entry-title-{{ .ID }}" class="item-title">
  105. <a
  106. {{ if $.showOnlyUnreadEntries }}
  107. href="{{ route "unreadFeedEntry" "feedID" .Feed.ID "entryID" .ID }}"
  108. {{ else }}
  109. href="{{ route "feedEntry" "feedID" .Feed.ID "entryID" .ID }}"
  110. {{ end }}
  111. >
  112. {{ if ne .Feed.Icon.IconID 0 }}
  113. <img src="{{ route "feedIcon" "externalIconID" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
  114. {{ end }}
  115. {{ .Title }}
  116. </a>
  117. </h2>
  118. <span class="category">
  119. <a
  120. href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}"
  121. aria-label="{{ t "page.category_label" .Feed.Category.Title }}"
  122. >
  123. {{ .Feed.Category.Title }}
  124. </a>
  125. </span>
  126. </header>
  127. {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
  128. </article>
  129. {{ end }}
  130. </div>
  131. <section class="page-footer">
  132. {{ if .entries }}
  133. <ul>
  134. <li>
  135. <button
  136. class="page-button"
  137. data-action="markPageAsRead"
  138. data-label-question="{{ t "confirm.question" }}"
  139. data-label-yes="{{ t "confirm.yes" }}"
  140. data-label-no="{{ t "confirm.no" }}"
  141. data-label-loading="{{ t "confirm.loading" }}"
  142. data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
  143. </li>
  144. </ul>
  145. {{ end }}
  146. </section>
  147. <div class="pagination-bottom">
  148. {{ template "pagination" .pagination }}
  149. </div>
  150. {{ end }}
  151. {{ end }}