feed_entries.html 6.4 KB

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