feed_list.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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="{{ routePath "/feed/%d/entries" .ID }}">
  12. {{ if and (.Icon) (gt .Icon.IconID 0) }}
  13. <img src="{{ routePath "/feed-icon/%s" .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 class="sr-only">{{ plural "page.total_entry_count" .NumberOfVisibleEntries .NumberOfVisibleEntries }}</span>
  24. <span aria-hidden="true">{{ .NumberOfVisibleEntries }} )</span>
  25. </span>
  26. <span class="category">
  27. <a id="feed-category-{{ .ID }}"
  28. href="{{ routePath "/category/%d/entries" .Category.ID }}"
  29. aria-label="{{ t "page.category_label" .Category.Title }}"
  30. >
  31. {{ .Category.Title }}
  32. </a>
  33. </span>
  34. </header>
  35. <div class="item-meta">
  36. <ul class="item-meta-info">
  37. <li class="item-meta-info-site-url" dir="auto">
  38. <a href="{{ .SiteURL | safeURL }}" title="{{ .SiteURL }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }} data-original-link="{{ $.user.MarkReadOnView }}">
  39. {{ domain .SiteURL }}
  40. </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="{{ routePath "/feed/%d/refresh" .ID }}" aria-describedby="feed-title-{{ .ID }}">
  55. {{ icon "refresh" }}<span class="icon-label">{{ t "menu.refresh_feed" }}</span>
  56. </a>
  57. </li>
  58. <li class="item-meta-icons-edit">
  59. <a href="{{ routePath "/feed/%d/edit" .ID }}" aria-describedby="feed-title-{{ .ID }}">
  60. {{ icon "edit" }}<span class="icon-label">{{ t "menu.edit_feed" }}</span>
  61. </a>
  62. </li>
  63. <li class="item-meta-icons-remove">
  64. <button
  65. aria-describedby="feed-title-{{ .ID }}"
  66. data-confirm="true"
  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. {{ if $.categoryID }}
  72. data-url="{{ routePath "/category/%d/feed/%d/remove" $.categoryID .ID }}"
  73. {{ else }}
  74. data-url="{{ routePath "/feed/%d/remove" .ID }}"
  75. {{ end }}>{{ icon "delete" }}<span class="icon-label">{{ t "action.remove" }}</span></button>
  76. </li>
  77. {{ if .UnreadCount }}
  78. <li class="item-meta-icons-mark-as-read">
  79. <button
  80. aria-describedby="feed-title-{{ .ID }}"
  81. data-confirm="true"
  82. data-label-question="{{ t "confirm.question" }}"
  83. data-label-yes="{{ t "confirm.yes" }}"
  84. data-label-no="{{ t "confirm.no" }}"
  85. data-label-loading="{{ t "confirm.loading" }}"
  86. {{ if $.categoryID }}
  87. data-url="{{ routePath "/category/%d/feed/%d/mark-all-as-read" $.categoryID .ID }}"
  88. {{ else }}
  89. data-url="{{ routePath "/feed/%d/mark-all-as-read" .ID }}"
  90. {{ end }}>
  91. {{ icon "read" }}<span class="icon-label">{{ t "menu.mark_all_as_read" }}</span>
  92. </button>
  93. </li>
  94. {{ end }}
  95. </ul>
  96. </div>
  97. {{ if ne .ParsingErrorCount 0 }}
  98. <div class="parsing-error">
  99. <strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
  100. - <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
  101. </div>
  102. {{ end }}
  103. </article>
  104. {{ end }}
  105. </div>
  106. {{ end }}