feed_list.html 5.5 KB

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