Debian Codegraph @

internal/template/templates/views/category_entries.html

raw symbols SCIP
1 {{ define "title"}}{{ .category.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 {{ .category.Title }}
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="{{ .category.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 "/category/%d/mark-all-as-read" .category.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 "/category/%d/entries/all" .category.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
43 </li>
44 <li>
45 <a class="page-link" href="{{ routePath "/category/%d/entries/starred" .category.ID }}">{{ icon "star" }}{{ t "menu.show_only_starred_entries" }}</a>
46 </li>
47 {{ else if .showOnlyStarredEntries }}
48 <li>
49 <a class="page-link" href="{{ routePath "/category/%d/entries" .category.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
50 </li>
51 <li>
52 <a class="page-link" href="{{ routePath "/category/%d/entries/all" .category.ID }}">{{ icon "show-all-entries" }}{{ t "menu.show_all_entries" }}</a>
53 </li>
54 {{ else }}
55 <li>
56 <a class="page-link" href="{{ routePath "/category/%d/entries" .category.ID }}">{{ icon "show-unread-entries" }}{{ t "menu.show_only_unread_entries" }}</a>
57 </li>
58 <li>
59 <a class="page-link" href="{{ routePath "/category/%d/entries/starred" .category.ID }}">{{ icon "star" }}{{ t "menu.show_only_starred_entries" }}</a>
60 </li>
61 {{ end }}
62 <li>
63 <a class="page-link" href="{{ routePath "/category/%d/feeds" .category.ID }}">{{ icon "feeds" }}{{ t "menu.feeds" }}</a>
64 </li>
65 <li>
66 <form
67 action="{{ routePath "/category/%d/entries/refresh" .category.ID }}"
68 method="post"
69 class="page-header-action-form"
70 >
71 <input type="hidden" name="csrf" value="{{ .csrf }}">
72 <button class="page-button" data-label-loading="{{ t "confirm.loading" }}">
73 {{ icon "refresh" }}{{ t "menu.refresh_all_feeds" }}
74 </button>
75 </form>
76 </li>
77 </ul>
78 </nav>
79 </section>
80 {{ end }}
81
82 {{ define "content"}}
83 {{ if not .entries }}
84 <p role="alert" class="alert">{{ t "alert.no_category_entry" }}</p>
85 {{ else }}
86 <div class="pagination-top">
87 {{ template "pagination" .pagination }}
88 </div>
89 <div class="items">
90 {{ range .entries }}
91 <article
92 class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
93 data-id="{{ .ID }}"
94 aria-labelledby="entry-title-{{ .ID }}"
95 tabindex="-1"
96 >
97 <header class="item-header" dir="auto">
98 <h2 id="entry-title-{{ .ID }}" class="item-title">
99 <a
100 {{ if $.showOnlyUnreadEntries }}
101 href="{{ routePath "/unread/category/%d/entry/%d" .Feed.Category.ID .ID }}"
102 {{ else if $.showOnlyStarredEntries }}
103 href="{{ routePath "/starred/category/%d/entry/%d" .Feed.Category.ID .ID }}"
104 {{ else }}
105 href="{{ routePath "/category/%d/entry/%d" .Feed.Category.ID .ID }}"
106 {{ end }}
107 {{ if and $.user.AlwaysOpenExternalLinks $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}
108 >
109 {{ if ne .Feed.Icon.IconID 0 }}
110 <img src="{{ routePath "/feed-icon/%s" .Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="">
111 {{ end }}
112 {{ .Title }}
113 </a>
114 </h2>
115 <span class="category">
116 <a href="{{ routePath "/category/%d/entries" .Feed.Category.ID }}" aria-label="{{ t "page.category_label" .Feed.Category.Title }}">
117 {{ .Feed.Category.Title }}
118 </a>
119 </span>
120 </header>
121 {{ template "item_meta" dict "user" $.user "entry" . "hasSaveEntry" $.hasSaveEntry }}
122 </article>
123 {{ end }}
124 </div>
125 <section class="page-footer">
126 {{ if .entries }}
127 <ul>
128 <li>
129 <button
130 class="page-button"
131 data-action="markPageAsRead"
132 data-label-question="{{ t "confirm.question" }}"
133 data-label-yes="{{ t "confirm.yes" }}"
134 data-label-no="{{ t "confirm.no" }}"
135 data-label-loading="{{ t "confirm.loading" }}"
136 data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ icon "mark-page-as-read" }}{{ t "menu.mark_page_as_read" }}</button>
137 </li>
138 </ul>
139 {{ end }}
140 </section>
141 <div class="pagination-bottom">
142 {{ template "pagination" .pagination }}
143 </div>
144 {{ end }}
145
146 {{ end }}