| 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-{{ .ID }}" |
| 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-{{ .ID }}" 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 }}" 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 |
<form action="{{ routePath "/feed/%d/refresh" .ID }}" method="post"> |
| 55 |
<input type="hidden" name="csrf" value="{{ $.csrf }}"> |
| 56 |
<button aria-describedby="feed-title-{{ .ID }}"> |
| 57 |
{{ icon "refresh" }}<span class="icon-label">{{ t "menu.refresh_feed" }}</span> |
| 58 |
</button> |
| 59 |
</form> |
| 60 |
</li> |
| 61 |
<li class="item-meta-icons-edit"> |
| 62 |
<a href="{{ routePath "/feed/%d/edit" .ID }}" aria-describedby="feed-title-{{ .ID }}"> |
| 63 |
{{ icon "edit" }}<span class="icon-label">{{ t "menu.edit_feed" }}</span> |
| 64 |
</a> |
| 65 |
</li> |
| 66 |
<li class="item-meta-icons-remove"> |
| 67 |
<button |
| 68 |
aria-describedby="feed-title-{{ .ID }}" |
| 69 |
data-confirm="true" |
| 70 |
data-label-question="{{ t "confirm.question" }}" |
| 71 |
data-label-yes="{{ t "confirm.yes" }}" |
| 72 |
data-label-no="{{ t "confirm.no" }}" |
| 73 |
data-label-loading="{{ t "confirm.loading" }}" |
| 74 |
{{ if $.categoryID }} |
| 75 |
data-url="{{ routePath "/category/%d/feed/%d/remove" $.categoryID .ID }}" |
| 76 |
{{ else }} |
| 77 |
data-url="{{ routePath "/feed/%d/remove" .ID }}" |
| 78 |
{{ end }}>{{ icon "delete" }}<span class="icon-label">{{ t "action.remove" }}</span></button> |
| 79 |
</li> |
| 80 |
{{ if .UnreadCount }} |
| 81 |
<li class="item-meta-icons-mark-as-read"> |
| 82 |
<button |
| 83 |
aria-describedby="feed-title-{{ .ID }}" |
| 84 |
data-confirm="true" |
| 85 |
data-label-question="{{ t "confirm.question" }}" |
| 86 |
data-label-yes="{{ t "confirm.yes" }}" |
| 87 |
data-label-no="{{ t "confirm.no" }}" |
| 88 |
data-label-loading="{{ t "confirm.loading" }}" |
| 89 |
{{ if $.categoryID }} |
| 90 |
data-url="{{ routePath "/category/%d/feed/%d/mark-all-as-read" $.categoryID .ID }}" |
| 91 |
{{ else }} |
| 92 |
data-url="{{ routePath "/feed/%d/mark-all-as-read" .ID }}" |
| 93 |
{{ end }}> |
| 94 |
{{ icon "read" }}<span class="icon-label">{{ t "menu.mark_all_as_read" }}</span> |
| 95 |
</button> |
| 96 |
</li> |
| 97 |
{{ end }} |
| 98 |
</ul> |
| 99 |
</div> |
| 100 |
{{ if ne .ParsingErrorCount 0 }} |
| 101 |
<div class="parsing-error"> |
| 102 |
<strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong> |
| 103 |
- <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small> |
| 104 |
</div> |
| 105 |
{{ end }} |
| 106 |
</article> |
| 107 |
{{ end }} |
| 108 |
</div> |
| 109 |
{{ end }} |