feed_list.html 5.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {{ define "feed_list" }}
  2. <div class="items">
  3. {{ range .feeds }}
  4. <article
  5. class="item feed-item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ else if ne .UnreadCount 0 }}feed-has-unread{{ end }}"
  6. aria-labelledby="feed-title-{{ .ID }} feed-entries-counter"
  7. tabindex="-1"
  8. >
  9. <header class="item-header" dir="auto">
  10. <h2 id="feed-title-{{ .ID }}" class="item-title">
  11. <a href="{{ route "feedEntries" "feedID" .ID }}">
  12. {{ if and (.Icon) (gt .Icon.IconID 0) }}
  13. <img src="{{ route "feedIcon" "externalIconID" .Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
  14. {{ end }}
  15. {{ if .Disabled }} 🚫 {{ end }}
  16. {{ .Title }}
  17. </a>
  18. </h2>
  19. <span id="feed-entries-counter" class="feed-entries-counter">
  20. <span aria-hidden="true">(</span>
  21. <span class="sr-only">{{ plural "page.unread_entry_count" .UnreadCount .UnreadCount }}</span>
  22. <span aria-hidden="true">{{ .UnreadCount }}</span>
  23. <span aria-hidden="true">/</span>
  24. <span class="sr-only">{{ plural "page.total_entry_count" .NumberOfVisibleEntries .NumberOfVisibleEntries }}</span>
  25. <span aria-hidden="true">{{ .NumberOfVisibleEntries }}</span>
  26. <span aria-hidden="true">)</span>
  27. </span>
  28. <span class="category">
  29. <a id="feed-category-{{ .ID }}"
  30. href="{{ route "categoryEntries" "categoryID" .Category.ID }}"
  31. aria-label="{{ t "page.category_label" .Category.Title }}"
  32. >
  33. {{ .Category.Title }}
  34. </a>
  35. </span>
  36. </header>
  37. <div class="item-meta">
  38. <ul class="item-meta-info">
  39. <li class="item-meta-info-site-url" dir="auto">
  40. <a href="{{ .SiteURL | safeURL }}" title="{{ .SiteURL }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }} rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="{{ $.user.MarkReadOnView }}">{{ domain .SiteURL }}</a>
  41. </li>
  42. <li class="item-meta-info-checked-at">
  43. {{ t "page.feeds.last_check" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
  44. </li>
  45. {{ $nextCheckDuration := duration .NextCheckAt }}
  46. {{ if ne $nextCheckDuration "" }}
  47. <li class="item-meta-info-next-check-at">
  48. {{ t "page.feeds.next_check" }} <time datetime="{{ isodate .NextCheckAt }}" title="{{ isodate .NextCheckAt }}">{{ $nextCheckDuration }}</time>
  49. </li>
  50. {{ end }}
  51. </ul>
  52. <ul class="item-meta-icons">
  53. <li class="item-meta-icons-refresh">
  54. <a href="{{ route "refreshFeed" "feedID" .ID }}"
  55. aria-describedby="feed-title-{{ .ID }}">{{ icon "refresh" }}<span class="icon-label">{{ t "menu.refresh_feed" }}</span></a>
  56. </li>
  57. <li class="item-meta-icons-edit">
  58. <a href="{{ route "editFeed" "feedID" .ID }}"
  59. aria-describedby="feed-title-{{ .ID }}">{{ icon "edit" }}<span class="icon-label">{{ t "menu.edit_feed" }}</span></a>
  60. </li>
  61. <li class="item-meta-icons-remove">
  62. <button
  63. aria-describedby="feed-title-{{ .ID }}"
  64. data-confirm="true"
  65. data-label-question="{{ t "confirm.question" }}"
  66. data-label-yes="{{ t "confirm.yes" }}"
  67. data-label-no="{{ t "confirm.no" }}"
  68. data-label-loading="{{ t "confirm.loading" }}"
  69. {{ if $.categoryID }}
  70. data-url="{{ route "removeCategoryFeed" "categoryID" $.categoryID "feedID" .ID }}"
  71. {{ else }}
  72. data-url="{{ route "removeFeed" "feedID" .ID }}"
  73. {{ end }}>{{ icon "delete" }}<span class="icon-label">{{ t "action.remove" }}</span></button>
  74. </li>
  75. {{ if .UnreadCount }}
  76. <li class="item-meta-icons-mark-as-read">
  77. <button
  78. aria-describedby="feed-title-{{ .ID }}"
  79. data-confirm="true"
  80. data-label-question="{{ t "confirm.question" }}"
  81. data-label-yes="{{ t "confirm.yes" }}"
  82. data-label-no="{{ t "confirm.no" }}"
  83. data-label-loading="{{ t "confirm.loading" }}"
  84. data-url="{{ route "markFeedAsRead" "feedID" .ID }}">{{ icon "read" }}<span class="icon-label">{{ t "menu.mark_all_as_read" }}</span></button>
  85. </li>
  86. {{ end }}
  87. </ul>
  88. </div>
  89. {{ if ne .ParsingErrorCount 0 }}
  90. <div class="parsing-error">
  91. <strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
  92. - <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
  93. </div>
  94. {{ end }}
  95. </article>
  96. {{ end }}
  97. </div>
  98. {{ end }}