aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html/categories.html
blob: dde03398c9f6f91c0bb0a4098d324f94f33be178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{{ define "title"}}{{ t "page.categories.title" }} ({{ .total }}){{ end }}

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "page.categories.title" }} ({{ .total }})</h1>
    <ul>
        <li>
            <a href="{{ route "createCategory" }}">{{ t "menu.create_category" }}</a>
        </li>
    </ul>
</section>

{{ if not .categories }}
    <p class="alert alert-error">{{ t "page.categories.no_category" }}</p>
{{ else }}
    <div class="items">
        {{ range .categories }}
        <article class="item">
            <div class="item-header">
                <span class="item-title">
                    <a href="{{ route "categoryEntries" "categoryID" .ID }}">{{ .Title }}</a>
                </span>
            </div>
            <div class="item-meta">
                <ul>
                    <li>
                        {{ if eq .FeedCount 0 }}
                            {{ t "No feed." }}
                        {{ else }}
                            {{ plural "page.categories.feed_count" .FeedCount .FeedCount }}
                        {{ end }}
                    </li>
                </ul>
                <ul>
                    <li>
                        <a href="{{ route "editCategory" "categoryID" .ID }}">{{ t "Edit" }}</a>
                    </li>
                    {{ if eq .FeedCount 0 }}
                    <li>
                        <a href="#"
                            data-confirm="true"
                            data-label-question="{{ t "confirm.question" }}"
                            data-label-yes="{{ t "confirm.yes" }}"
                            data-label-no="{{ t "confirm.no" }}"
                            data-label-loading="{{ t "confirm.loading" }}"
                            data-url="{{ route "removeCategory" "categoryID" .ID }}">{{ t "action.remove" }}</a>
                    </li>
                    {{ end }}
                </ul>
            </div>
        </article>
        {{ end }}
    </div>
{{ end }}

{{ end }}