aboutsummaryrefslogtreecommitdiffhomepage
path: root/template/html/entry.html
blob: 5fe50014edb2eccc67f42c7e710c8b511dc7f09a (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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{{ define "title"}}{{ .entry.Title }}{{ end }}

{{ define "content"}}
<section class="entry">
    <header class="entry-header">
        <h1>
            <a href="{{ .entry.URL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .entry.Title }}</a>
        </h1>
        <div class="entry-actions">
            <ul>
                <li>
                    <a href="#"
                        data-toggle-bookmark="true"
                        data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
                        data-label-loading="{{ t "Saving..." }}"
                        data-label-star="☆ {{ t "Star" }}"
                        data-label-unstar="★ {{ t "Unstar" }}"
                        data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
                        >{{ if .entry.Starred }}★ {{ t "Unstar" }}{{ else }}☆ {{ t "Star" }}{{ end }}</a>
                </li>
                {{ if .hasSaveEntry }}
                    <li>
                        <a href="#"
                            title="{{ t "Save this article" }}"
                            data-save-entry="true"
                            data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
                            data-label-loading="{{ t "Saving..." }}"
                            data-label-done="{{ t "Done!" }}"
                            >{{ t "Save" }}</a>
                    </li>
                {{ end }}
                <li>
                    <a href="#"
                        title="{{ t "Fetch original content" }}"
                        data-fetch-content-entry="true"
                        data-fetch-content-url="{{ route "fetchContent" "entryID" .entry.ID }}"
                        data-label-loading="{{ t "Loading..." }}"
                        data-label-done="{{ t "Done!" }}"
                        >{{ t "Fetch original content" }}</a>
                </li>
                {{ if .entry.CommentsURL }}
                    <li>
                        <a href="{{ .entry.CommentsURL }}" title="{{ t "View Comments" }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Comments" }}</a>
                    </li>
                {{ end }}
            </ul>
        </div>
        <div class="entry-meta">
            <span class="entry-website">
                {{ if ne .entry.Feed.Icon.IconID 0 }}
                    <img src="{{ route "icon" "iconID" .entry.Feed.Icon.IconID }}" width="16" height="16">
                {{ end }}
                <a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}">{{ .entry.Feed.Title }}</a>
            </span>
            {{ if .entry.Author }}
                <span class="entry-author">
                    {{ if isEmail .entry.Author }}
                        - <a href="mailto:{{ .entry.Author }}">{{ .entry.Author }}</a>
                    {{ else }}
                        – <em>{{ .entry.Author }}</em>
                    {{ end }}
                </span>
            {{ end }}
            <span class="category">
                <a href="{{ route "categoryEntries" "categoryID" .entry.Feed.Category.ID }}">{{ .entry.Feed.Category.Title }}</a>
            </span>
        </div>
        <div class="entry-date">
            <time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed $.user.Timezone .entry.Date }}</time>
        </div>
    </header>
    {{ if gt (len .entry.Content) 120 }}
    <div class="pagination-top">
        {{ template "entry_pagination" . }}
    </div>
    {{ end }}
    <article class="entry-content">
        {{ noescape (proxyFilter .entry.Content) }}
    </article>
    {{ if .entry.Enclosures }}
    <aside class="entry-enclosures">
        <h3>{{ t "Attachments" }}</h3>
        {{ range .entry.Enclosures }}
            <div class="entry-enclosure">
                {{ if hasPrefix .MimeType "audio/" }}
                    <div class="enclosure-audio">
                        <audio controls preload="metadata">
                            <source src="{{ .URL }}" type="{{ .MimeType }}">
                        </audio>
                    </div>
                {{ else if hasPrefix .MimeType "video/" }}
                    <div class="enclosure-video">
                        <video controls preload="metadata">
                            <source src="{{ .URL }}" type="{{ .MimeType }}">
                        </video>
                    </div>
                {{ else if hasPrefix .MimeType "image/" }}
                    <div class="enclosure-image">
                        <img src="{{ proxyURL .URL }}" title="{{ .URL }} ({{ .MimeType }})" alt="{{ .URL }} ({{ .MimeType }})">
                    </div>
                {{ end }}

                <div class="entry-enclosure-download">
                    <a href="{{ .URL }}" title="{{ .URL }} ({{ .MimeType }})" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ t "Download" }}</a>
                    <small>({{ .URL }})</small>
                </div>
            </div>
        {{ end }}
    </aside>
    {{ end }}
</section>

<div class="pagination-bottom">
    {{ template "entry_pagination" . }}
</div>
{{ end }}