Debian Codegraph @

internal/template/templates/views/categories.html

raw
1 {{ define "title"}}{{ t "page.categories.title" }} ({{ .total }}){{ end }}
2
3 {{ define "page_header"}}
4 <section class="page-header" aria-labelledby="page-header-title page-header-title-count">
5 <h1 id="page-header-title" dir="auto">
6 {{ t "page.categories.title" }}
7 <span aria-hidden="true"> ({{ .total }})</span>
8 </h1>
9 <span id="page-header-title-count" class="sr-only">{{ plural "page.categories_count" .total .total }}</span>
10 <nav aria-label="{{ t "page.categories.title" }} {{ t "menu.title" }}">
11 <ul>
12 <li>
13 <a href="{{ routePath "/category/create" }}">{{ icon "add-category" }}{{ t "menu.create_category" }}</a>
14 </li>
15 </ul>
16 </nav>
17 </section>
18 {{ end }}
19
20 {{ define "content"}}
21 {{ if not .categories }}
22 <p role="alert" class="alert alert-error">{{ t "alert.no_category" }}</p>
23 {{ else }}
24 <div class="items">
25 {{ range .categories }}
26 <article
27 class="item category-item {{if gt (deRef .TotalUnread) 0 }} category-has-unread{{end}}"
28 aria-labelledby="category-title-{{ .ID }}"
29 tabindex="-1"
30 >
31 <header id="category-title-{{ .ID }}" class="item-header" dir="auto">
32 <h2 class="item-title">
33 <a href="{{ routePath "/category/%d/entries" .ID }}">
34 {{ .Title }}
35 <span class="category-item-total" aria-hidden="true">({{ .TotalUnread }})</span>
36 <span class="sr-only">{{ plural "page.unread_entry_count" (deRef .TotalUnread) (deRef .TotalUnread) }}</span>
37 </a>
38 </h2>
39 </header>
40 <div class="item-meta">
41 <ul class="item-meta-info">
42 <li class="item-meta-info-feed-count">
43 {{ if eq (deRef .FeedCount) 0 }}{{ t "page.categories.no_feed" }}{{ else }}{{ plural "page.categories.feed_count" (deRef .FeedCount) (deRef .FeedCount) }}{{ end }}
44 </li>
45 </ul>
46 <ul class="item-meta-icons">
47 <li class="item-meta-icons-entries">
48 <a href="{{ routePath "/category/%d/entries" .ID }}">{{ icon "entries" }}<span class="icon-label">{{ t "page.categories.entries" }}</span></a>
49 </li>
50 <li class="item-meta-icons-feeds">
51 <a href="{{ routePath "/category/%d/feeds" .ID }}">{{ icon "feeds" }}<span class="icon-label">{{ t "page.categories.feeds" }}</span></a>
52 </li>
53 <li class="item-meta-icons-edit">
54 <a href="{{ routePath "/category/%d/edit" .ID }}">{{ icon "edit" }}<span class="icon-label">{{ t "menu.edit_category" }}</span></a>
55 </li>
56 {{ if eq (deRef .FeedCount) 0 }}
57 <li class="item-meta-icons-delete">
58 <button
59 aria-describedby="category-title-{{ .ID }}"
60 data-confirm="true"
61 data-label-question="{{ t "confirm.question" }}"
62 data-label-yes="{{ t "confirm.yes" }}"
63 data-label-no="{{ t "confirm.no" }}"
64 data-label-loading="{{ t "confirm.loading" }}"
65 data-url="{{ routePath "/category/%d/remove" .ID }}">{{ icon "delete" }}<span class="icon-label">{{ t "action.remove" }}</span></button>
66 </li>
67 {{ end }}
68 {{ if gt (deRef .TotalUnread) 0 }}
69 <li class="item-meta-icons-mark-as-read">
70 <button
71 aria-describedby="category-title-{{ .ID }}"
72 data-confirm="true"
73 data-label-question="{{ t "confirm.question" }}"
74 data-label-yes="{{ t "confirm.yes" }}"
75 data-label-no="{{ t "confirm.no" }}"
76 data-label-loading="{{ t "confirm.loading" }}"
77 data-url="{{ routePath "/category/%d/mark-all-as-read" .ID }}">{{ icon "read" }}<span class="icon-label">{{ t "menu.mark_all_as_read" }}</span></button>
78 </li>
79 {{ end }}
80 </ul>
81 </div>
82 </article>
83 {{ end }}
84 </div>
85
86 <footer>
87 <a href="#" class="elevator">{{ icon "up" }}{{ t "page.footer.elevator" }}</a>
88 </footer>
89 {{ end }}
90
91 {{ end }}