aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html/feeds.html
blob: e4a32317e540813e1e4578b507b803da75a55866 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{{ define "title"}}{{ t "page.feeds.title" }} ({{ .total }}){{ end }}

{{ define "content"}}
<section class="page-header">
    <h1>{{ t "page.feeds.title" }} ({{ .total }})</h1>
    <ul>
        <li>
            <a href="{{ route "addSubscription" }}">{{ t "menu.add_feed" }}</a>
        </li>
        <li>
            <a href="{{ route "export" }}">{{ t "menu.export" }}</a>
        </li>
        <li>
            <a href="{{ route "import" }}">{{ t "menu.import" }}</a>
        </li>
        <li>
            <a href="{{ route "refreshAllFeeds" }}">{{ t "menu.refresh_all_feeds" }}</a>
        </li>
    </ul>
</section>

{{ if not .feeds }}
    <p class="alert">{{ t "alert.no_feed" }}</p>
{{ else }}
    <div class="items">
        {{ range .feeds }}
        <article class="item {{ if ne .ParsingErrorCount 0 }}feed-parsing-error{{ end }}">
            <div class="item-header">
                <span class="item-title">
                    {{ if .Icon }}
                        <img src="{{ route "icon" "iconID" .Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .Title }}">
                    {{ end }}
                    {{ if .Disabled }} 🚫 {{ end }}
                    <a href="{{ route "feedEntries" "feedID" .ID }}">{{ .Title }}</a>
                </span>
                <span class="category">
                    <a href="{{ route "categoryEntries" "categoryID" .Category.ID }}">{{ .Category.Title }}</a>
                </span>
            </div>
            <div class="item-meta">
                <ul>
                    <li>
                        <a href="{{ .SiteURL }}" title="{{ .SiteURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer" data-original-link="true">{{ domain .SiteURL }}</a>
                    </li>
                    <li>
                        {{ t "page.feeds.last_check" }} <time datetime="{{ isodate .CheckedAt }}" title="{{ isodate .CheckedAt }}">{{ elapsed $.user.Timezone .CheckedAt }}</time>
                    </li>
                </ul>
                <ul>
                    <li>
                        <a href="{{ route "refreshFeed" "feedID" .ID }}">{{ t "menu.refresh_feed" }}</a>
                    </li>
                    <li>
                        <a href="{{ route "editFeed" "feedID" .ID }}">{{ t "menu.edit_feed" }}</a>
                    </li>
                    <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 "removeFeed" "feedID" .ID }}">{{ t "action.remove" }}</a>
                    </li>
                </ul>
            </div>
            {{ if ne .ParsingErrorCount 0 }}
                <div class="parsing-error">
                    <strong title="{{ .ParsingErrorMsg }}" class="parsing-error-count">{{ plural "page.feeds.error_count" .ParsingErrorCount .ParsingErrorCount }}</strong>
                    - <small class="parsing-error-message">{{ .ParsingErrorMsg }}</small>
                </div>
            {{ end }}
        </article>
        {{ end }}
    </div>
{{ end }}

{{ end }}