Debian Codegraph @

internal/template/templates/views/feed_entries.html

raw
1 {{ define "title"}}{{ .feed.Title }} ({{ .total }}){{ end }}
2
3 {{ define "page_header"}}
4 <section class="page-header" aria-labelledby="page-header-title">
5 <h1 id="page-header-title" dir="auto">
6 <a href="{{ .feed.SiteURL }}" title="{{ .feed.SiteURL }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }} data-original-link="{{ .user.MarkReadOnView }}">{{ .feed.Title }}</a>
7 <span aria-hidden="true">({{ .total }})</span>
8 </h1>
9 <span class="sr-only">
10 {{ if .showOnlyUnreadEntries }}
11 {{ plural "page.unread_entry_count" .total .total }}
12 {{ else }}
13 {{ plural "page.total_entry_count" .total .total }}
14 {{ end }}
15 </span>
16 <nav aria-label="{{ .feed.Title }} {{ t "menu.title" }}">
17 <ul>
18 {{ if .entries }}
19 <li>
20 <button
21 class="page-button"
22 data-action="markPageAsRead"
23 data-label-question="{{ t "confirm.question" }}"
24 data-label-yes="{{ t "confirm.yes" }}"
25 data-label-no="{{ t "confirm.no" }}"
26 data-label-loading="{{ t "confirm.loading" }}"
27 data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
28 </li>
29 <li>
30 <button
31 class="page-button"
32 data-confirm="true"
33 data-label-question="{{ t "confirm.question" }}"
34 data-label-yes="{{ t "confirm.yes" }}"
35 data-label-no="{{ t "confirm.no" }}"
36 data-label-loading="{{ t "confirm.loading" }}"
37 data-url="{{ routePath "/feed/%d/mark-all-as-read" .feed.ID }}">{{ icon "mark-all-as-read" }}{{ t "menu.mark_all_as_read" }}</button>
38 </li>
39 {{ end }}
40 {{ if .showOnlyUnreadEntries }}
41 <li>
42 <a class="page-link" href="{{ routePath "/feed/%d/entries/all" .feed.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
43 </li>
44 {{ else }}
45 <li>
46 <a class="page-link" href="{{ routePath "/feed/%d/entries" .feed.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
47 </li>
48 {{ end }}
49 <li>
50 <button
51 class="page-button"
52 data-confirm="true"
53 data-label-question="{{ t "confirm.question.refresh" }}"
54 data-label-yes="{{ t "confirm.yes" }}"
55 data-label-no="{{ t "confirm.no" }}"
56 data-label-loading="{{ t "confirm.loading" }}"
57 data-url="{{ routePath "/feed/%d/refresh" .feed.ID }}?forceRefresh=true"
58 data-no-action-url="{{ routePath "/feed/%d/refresh" .feed.ID }}?forceRefresh=false">{{ icon "refresh" }}{{ t "menu.refresh_feed" }}</button>
59 </li>
60 <li>
61 <a class="page-link" href="{{ routePath "/feed/%d/edit" .feed.ID }}">{{ icon "edit" }}{{ t "menu.edit_feed" }}</a>
62 </li>
63 <li>
64 <button
65 class="page-button"
66 data-confirm="true"
67 data-action="remove-feed"
68 data-label-question="{{ t "confirm.question" }}"
69 data-label-yes="{{ t "confirm.yes" }}"
70 data-label-no="{{ t "confirm.no" }}"
71 data-label-loading="{{ t "confirm.loading" }}"
72 data-url="{{ routePath "/feed/%d/remove" .feed.ID }}"
73 data-redirect-url="{{ routePath "/feeds" }}">{{ icon "delete" }}{{ t "action.remove_feed" }}</button>
74 </li>
75 </ul>
76 </nav>
77 </section>
78 {{ end }}
79
80 {{ define "content"}}
81 {{ if ne .feed.ParsingErrorCount 0 }}
82 <div role="alert" class="alert alert-error">
83 <h3>{{ t "alert.feed_error" }}</h3>
84 <p>{{ t .feed.ParsingErrorMsg }}</p>
85 </div>
86 {{ end }}
87
88 {{ if not .entries }}
89 {{ if .showOnlyUnreadEntries }}
90 <p role="alert" class="alert">{{ t "alert.no_unread_entry" }}</p>
91 {{ else }}
92 <p role="alert" class="alert">{{ t "alert.no_feed_entry" }}</p>
93 {{ end }}
94 {{ else }}
95 <div class="pagination-top">
96 {{ template "pagination" .pagination }}
97 </div>
98 <div class="items">
99 {{ range .entries }}
100 <article
101 class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
102 data-id="{{ .ID }}"
103 aria-labelledby="entry-title-{{ .ID }}"
104 tabindex="-1"
105 >
106 <header class="item-header" dir="auto">
107 <h2 id="entry-title-{{ .ID }}" class="item-title">
108 <a
109 {{ if $.showOnlyUnreadEntries }}
110 href="{{ routePath "/unread/feed/%d/entry/%d" .Feed.ID .ID }}"
111 {{ else }}
112 href="{{ routePath "/feed/%d/entry/%d" .Feed.ID .ID }}"
113 {{ end }}
114 {{ if and $.user.AlwaysOpenExternalLinks $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}
115 >
116 {{ if ne .Feed.Icon.IconID 0 }}
117 <img src="{{ routePath "/feed-icon/%s" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
118 {{ end }}
119 {{ .Title }}
120 </a>
121 </h2>
122 <span class="category">
123 <a
124 href="{{ routePath "/category/%d/entries" .Feed.Category.ID }}"
125 aria-label="{{ t "page.category_label" .Feed.Category.Title }}"
126 >
127 {{ .Feed.Category.Title }}
128 </a>
129 </span>
130 </header>
131 {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
132 </article>
133 {{ end }}
134 </div>
135 <section class="page-footer">
136 {{ if .entries }}
137 <ul>
138 <li>
139 <button
140 class="page-button"
141 data-action="markPageAsRead"
142 data-label-question="{{ t "confirm.question" }}"
143 data-label-yes="{{ t "confirm.yes" }}"
144 data-label-no="{{ t "confirm.no" }}"
145 data-label-loading="{{ t "confirm.loading" }}"
146 data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
147 </li>
148 </ul>
149 {{ end }}
150 </section>
151 <div class="pagination-bottom">
152 {{ template "pagination" .pagination }}
153 </div>
154 {{ end }}
155
156 {{ end }}