| 1 |
{{ define "title"}}{{ .entry.Title }}{{ end }} |
| 2 |
|
| 3 |
{{ define "entry_pagination" }} |
| 4 |
<div class="pagination"> |
| 5 |
<div class="pagination-prev {{ if not .prevEntry }}disabled{{end}}"> |
| 6 |
{{ if .prevEntry }} |
| 7 |
<a href="{{ .prevEntryRoute }}{{ queryString (dict "q" .searchQuery "unread" .searchUnreadOnly) }}" title="{{ .prevEntry.Title }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a> |
| 8 |
{{ else }} |
| 9 |
{{ t "pagination.previous" }} |
| 10 |
{{ end }} |
| 11 |
</div> |
| 12 |
|
| 13 |
<a href="#" class="elevator">{{ icon "up" }}{{ t "page.footer.elevator" }}</a> |
| 14 |
|
| 15 |
<div class="pagination-next {{ if not .nextEntry }}disabled{{end}}"> |
| 16 |
{{ if .nextEntry }} |
| 17 |
<a href="{{ .nextEntryRoute }}{{ queryString (dict "q" .searchQuery "unread" .searchUnreadOnly) }}" title="{{ .nextEntry.Title }}" data-page="next" rel="next">{{ t "pagination.next" }}</a> |
| 18 |
{{ else }} |
| 19 |
{{ t "pagination.next" }} |
| 20 |
{{ end }} |
| 21 |
</div> |
| 22 |
</div> |
| 23 |
{{ end }} |
| 24 |
|
| 25 |
{{ define "enclosure_media_controls" }} |
| 26 |
<div class="media-controls"> |
| 27 |
<div class="media-seek-control"> |
| 28 |
<div class="media-control-label">{{ t "enclosure_media_controls.seek" }} </div> |
| 29 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="seek" data-action-value="-30" title="{{ t "enclosure_media_controls.seek.title" "-30" }}" ><span class="icon-label" >-30s</span></button> |
| 30 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="seek" data-action-value="-10" title="{{ t "enclosure_media_controls.seek.title" "-10" }}" ><span class="icon-label" >-10s</span></button> |
| 31 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="seek" data-action-value="+10" title="{{ t "enclosure_media_controls.seek.title" "+10" }}" ><span class="icon-label" >+10s</span></button> |
| 32 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="seek" data-action-value="+30" title="{{ t "enclosure_media_controls.seek.title" "+30" }}" ><span class="icon-label" >+30s</span></button> |
| 33 |
</div> |
| 34 |
<div class="media-speed-control"> |
| 35 |
|
| 36 |
<div class="media-control-label">{{ t "enclosure_media_controls.speed" }} (<span class="speed-indicator" data-enclosure-id="{{.ID}}">1.00x</span>)</div> <!-- Need JS to display the current speed unfortunately --> |
| 37 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="speed" data-action-value="-0.25" title="{{ t "enclosure_media_controls.speed.slower.title" "0.25" }}"><span class="icon-label" >{{ t "enclosure_media_controls.speed.slower" }}</span></button> |
| 38 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="speed-reset" data-action-value="1" title="{{ t "enclosure_media_controls.speed.reset.title"}}"><span class="icon-label" >{{ t "enclosure_media_controls.speed.reset" }}</span></button> |
| 39 |
<button class="page-button" data-enclosure-id="{{.ID}}" data-enclosure-action="speed" data-action-value="+0.25" title="{{ t "enclosure_media_controls.speed.faster.title" "0.25" }}"><span class="icon-label" >{{ t "enclosure_media_controls.speed.faster" }}</span></button> |
| 40 |
</div> |
| 41 |
</div> |
| 42 |
{{ end }} |
| 43 |
|
| 44 |
{{ define "page_header"}} |
| 45 |
<section class="entry" data-id="{{ .entry.ID }}" aria-labelledby="page-header-title"> |
| 46 |
<header class="entry-header"> |
| 47 |
<h1 id="page-header-title" dir="auto"> |
| 48 |
<a href="{{ .entry.URL | untrustedURL }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }}>{{ .entry.Title }}</a> |
| 49 |
</h1> |
| 50 |
{{ if .user }} |
| 51 |
<div class="entry-actions"> |
| 52 |
<ul> |
| 53 |
<li> |
| 54 |
<button |
| 55 |
class="page-button" |
| 56 |
title="{{ t "entry.status.title" }}" |
| 57 |
data-toggle-status="true" |
| 58 |
data-label-loading="{{ t "entry.state.saving" }}" |
| 59 |
data-label-unread="{{ t "entry.status.mark_as_unread" }}" |
| 60 |
data-label-read="{{ t "entry.status.mark_as_read" }}" |
| 61 |
data-toast-unread="{{ t "entry.status.toast.unread" }}" |
| 62 |
data-toast-read="{{ t "entry.status.toast.read" }}" |
| 63 |
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}" |
| 64 |
>{{ if eq .entry.Status "unread" }}{{ icon "read" }}{{ else }}{{ icon "unread" }}{{ end }}<span class="icon-label">{{ if eq .entry.Status "unread" }}{{ t "entry.status.mark_as_read" }}{{ else }}{{ t "entry.status.mark_as_unread" }}{{ end }}</span></button> |
| 65 |
</li> |
| 66 |
<li> |
| 67 |
<button |
| 68 |
class="page-button" |
| 69 |
data-toggle-starred="true" |
| 70 |
data-star-url="{{ routePath "/entry/star/%d" .entry.ID }}" |
| 71 |
data-label-loading="{{ t "entry.state.saving" }}" |
| 72 |
data-label-star="{{ t "entry.starred.toggle.on" }}" |
| 73 |
data-label-unstar="{{ t "entry.starred.toggle.off" }}" |
| 74 |
data-toast-star="{{ t "entry.starred.toast.on" }}" |
| 75 |
data-toast-unstar="{{ t "entry.starred.toast.off" }}" |
| 76 |
data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}" |
| 77 |
>{{ if .entry.Starred }}{{ icon "unstar" }}{{ else }}{{ icon "star" }}{{ end }}<span class="icon-label">{{ if .entry.Starred }}{{ t "entry.starred.toggle.off" }}{{ else }}{{ t "entry.starred.toggle.on" }}{{ end }}</span></button> |
| 78 |
</li> |
| 79 |
{{ if .hasSaveEntry }} |
| 80 |
<li> |
| 81 |
<button |
| 82 |
class="page-button" |
| 83 |
title="{{ t "entry.save.title" }}" |
| 84 |
data-save-entry="true" |
| 85 |
data-save-url="{{ routePath "/entry/save/%d" .entry.ID }}" |
| 86 |
data-label-loading="{{ t "entry.state.saving" }}" |
| 87 |
data-label-done="{{ t "entry.save.completed" }}" |
| 88 |
data-toast-done="{{ t "entry.save.toast.completed" }}" |
| 89 |
>{{ icon "save" }}<span class="icon-label">{{ t "entry.save.label" }}</span></button> |
| 90 |
</li> |
| 91 |
{{ end }} |
| 92 |
{{ if .entry.ShareCode }} |
| 93 |
<li> |
| 94 |
<a href="{{ routePath "/share/%s" .entry.ShareCode }}" |
| 95 |
title="{{ t "entry.shared_entry.title" }}" |
| 96 |
data-share-status="shared" |
| 97 |
{{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ end }}>{{ icon "share" }}<span class="icon-label">{{ t "entry.shared_entry.label" }}</span></a> |
| 98 |
</li> |
| 99 |
<li> |
| 100 |
<button |
| 101 |
class="page-button" |
| 102 |
data-confirm="true" |
| 103 |
data-url="{{ routePath "/entry/unshare/%d" .entry.ID }}" |
| 104 |
data-label-question="{{ t "confirm.question" }}" |
| 105 |
data-label-yes="{{ t "confirm.yes" }}" |
| 106 |
data-label-no="{{ t "confirm.no" }}" |
| 107 |
data-label-loading="{{ t "confirm.loading" }}">{{ icon "delete" }}<span class="icon-label">{{ t "entry.unshare.label" }}</span></button> |
| 108 |
</li> |
| 109 |
{{ else }} |
| 110 |
<li> |
| 111 |
<form method="post" action="{{ routePath "/entry/share/%d" .entry.ID }}"> |
| 112 |
<input type="hidden" name="csrf" value="{{ .csrf }}"> |
| 113 |
<button type="submit" class="page-button"> |
| 114 |
{{ icon "share" }}<span class="icon-label">{{ t "entry.share.label" }}</span> |
| 115 |
</button> |
| 116 |
</form> |
| 117 |
</li> |
| 118 |
{{ end }} |
| 119 |
<li> |
| 120 |
<button |
| 121 |
class="page-button" |
| 122 |
title="{{ t "entry.scraper.title" }}" |
| 123 |
data-fetch-content-entry="true" |
| 124 |
data-fetch-content-url="{{ routePath "/entry/download/%d" .entry.ID }}" |
| 125 |
data-label-loading="{{ t "entry.state.loading" }}" |
| 126 |
>{{ icon "scraper" }}<span class="icon-label">{{ t "entry.scraper.label" }}</span></button> |
| 127 |
</li> |
| 128 |
{{ if .entry.CommentsURL }} |
| 129 |
<li> |
| 130 |
<a href="{{ .entry.CommentsURL }}" |
| 131 |
class="page-link" |
| 132 |
title="{{ t "entry.comments.title" }}" |
| 133 |
{{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }} |
| 134 |
data-comments-link="true" |
| 135 |
>{{ icon "comment" }}<span class="icon-label">{{ t "entry.comments.label" }}</span></a> |
| 136 |
</li> |
| 137 |
{{ end }} |
| 138 |
</ul> |
| 139 |
</div> |
| 140 |
{{ end }} |
| 141 |
<div class="entry-meta" dir="auto"> |
| 142 |
<span class="entry-website"> |
| 143 |
{{ if ne .entry.Feed.Icon.IconID 0 }} |
| 144 |
<img src="{{ routePath "/feed-icon/%s" .entry.Feed.Icon.ExternalIconID }}" width="16" height="16" loading="lazy" alt="{{ .entry.Feed.Title }}"> |
| 145 |
{{ end }} |
| 146 |
{{ if .user }} |
| 147 |
<a href="{{ routePath "/feed/%d/entries" .entry.Feed.ID }}">{{ .entry.Feed.Title }}</a> |
| 148 |
{{ else }} |
| 149 |
<a href="{{ .entry.Feed.SiteURL }}">{{ .entry.Feed.Title }}</a> |
| 150 |
{{ end }} |
| 151 |
</span> |
| 152 |
{{ if .entry.Author }} |
| 153 |
<span class="entry-author"> |
| 154 |
{{ if isEmail .entry.Author }} |
| 155 |
- <a href="mailto:{{ .entry.Author }}">{{ .entry.Author }}</a> |
| 156 |
{{ else }} |
| 157 |
– <em>{{ .entry.Author }}</em> |
| 158 |
{{ end }} |
| 159 |
</span> |
| 160 |
{{ end }} |
| 161 |
{{ if .user }} |
| 162 |
<span class="category"> |
| 163 |
<a href="{{ routePath "/category/%d/entries" .entry.Feed.Category.ID }}">{{ .entry.Feed.Category.Title }}</a> |
| 164 |
</span> |
| 165 |
{{ end }} |
| 166 |
</div> |
| 167 |
{{ if .entry.Tags }} |
| 168 |
<div class="entry-tags"> |
| 169 |
{{ t "entry.tags.label" }} |
| 170 |
{{ $allTags := .entry.Tags }} |
| 171 |
{{ $numTags := len $allTags }} |
| 172 |
{{ $tagsLimit := 5 }} |
| 173 |
{{ $numerOfAdditionalTags := subtract $numTags $tagsLimit }} |
| 174 |
|
| 175 |
<ul class="entry-tags-list"> |
| 176 |
{{ range $i, $tagName := $allTags }} |
| 177 |
{{ if lt $i $tagsLimit }} |
| 178 |
{{ if $.user }} |
| 179 |
<li><a href="{{ routePath "/tags/%s/entries/all" (urlEncode $tagName) }}"><strong>{{ $tagName }}</strong></a></li> |
| 180 |
{{ else }} |
| 181 |
<li><strong>{{ $tagName }}</strong></li> |
| 182 |
{{ end }} |
| 183 |
{{ end }} |
| 184 |
{{ end }} |
| 185 |
</ul> |
| 186 |
|
| 187 |
{{ if gt $numTags $tagsLimit }} |
| 188 |
<details class="entry-additional-tags"> |
| 189 |
<summary> |
| 190 |
{{ plural "entry.tags.more_tags_label" $numerOfAdditionalTags $numerOfAdditionalTags }} |
| 191 |
</summary> |
| 192 |
<ul class="entry-tags-list"> |
| 193 |
{{ range $idx, $tagName := $allTags }} |
| 194 |
{{ if ge $idx $tagsLimit }} |
| 195 |
{{ if $.user }} |
| 196 |
<li><a href="{{ routePath "/tags/%s/entries/all" (urlEncode $tagName) }}"><strong>{{ $tagName }}</strong></a></li> |
| 197 |
{{ else }} |
| 198 |
<li><strong>{{ $tagName }}</strong></li> |
| 199 |
{{ end }} |
| 200 |
{{ end }} |
| 201 |
{{ end }} |
| 202 |
</ul> |
| 203 |
</details> |
| 204 |
{{ end }} |
| 205 |
</div> |
| 206 |
{{ end }} |
| 207 |
<div class="entry-external-link"> |
| 208 |
<a |
| 209 |
href="{{ .entry.URL | untrustedURL }}" |
| 210 |
{{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }} |
| 211 |
data-original-link="{{ $.user.MarkReadOnView }}">{{ .entry.URL }}</span></a> |
| 212 |
</div> |
| 213 |
<div class="entry-date"> |
| 214 |
{{ if .user }} |
| 215 |
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed $.user.Timezone .entry.Date }}</time> |
| 216 |
{{ else }} |
| 217 |
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed "UTC" .entry.Date }}</time> |
| 218 |
{{ end }} |
| 219 |
{{ if and .user.ShowReadingTime (gt .entry.ReadingTime 0) }} |
| 220 |
· |
| 221 |
<span class="entry-reading-time"> |
| 222 |
{{ plural "entry.estimated_reading_time" .entry.ReadingTime .entry.ReadingTime }} |
| 223 |
</span> |
| 224 |
{{ end }} |
| 225 |
</div> |
| 226 |
</header> |
| 227 |
</section> |
| 228 |
{{ end }} |
| 229 |
|
| 230 |
|
| 231 |
{{ define "content"}} |
| 232 |
{{ if gt (len .entry.Content) 120 }} |
| 233 |
{{ if .user }} |
| 234 |
<div class="pagination-entry-top"> |
| 235 |
{{ template "entry_pagination" . }} |
| 236 |
</div> |
| 237 |
{{ end }} |
| 238 |
{{ end }} |
| 239 |
<article class="entry-content {{ if ne $.user.GestureNav "none" }}gesture-nav-{{ $.user.GestureNav }}{{ end }}" dir="auto"> |
| 240 |
{{ if not .entry.Feed.NoMediaPlayer }} |
| 241 |
{{ $mediaPlayerEnclosure := .entry.Enclosures.FindMediaPlayerEnclosure }} |
| 242 |
|
| 243 |
{{ if $mediaPlayerEnclosure }} |
| 244 |
{{ with $mediaPlayerEnclosure }} |
| 245 |
{{ if .IsAudio }} |
| 246 |
<div class="enclosure-audio" > |
| 247 |
<audio controls preload="metadata" |
| 248 |
{{ if $.user }}data-last-position="{{ .MediaProgression }}"{{ end }} |
| 249 |
{{ if $.user.MediaPlaybackRate }}data-playback-rate="{{ $.user.MediaPlaybackRate }}"{{ end }} |
| 250 |
{{ if $.user.MarkReadOnMediaPlayerCompletion }}data-mark-read-on-completion="0.9"{{ end }} |
| 251 |
{{ if $.user }}data-save-url="{{ routePath "/entry/enclosure/%d/save-progression" .ID }}"{{ end }} |
| 252 |
data-enclosure-id="{{ .ID }}" |
| 253 |
> |
| 254 |
{{ if (and $.user (mustBeProxyfied "audio")) }} |
| 255 |
<source src="{{ proxyURL .URL }}" type="{{ .Html5MimeType }}"> |
| 256 |
{{ else }} |
| 257 |
<source src="{{ .URL | untrustedURL }}" type="{{ .Html5MimeType }}"> |
| 258 |
{{ end }} |
| 259 |
</audio> |
| 260 |
{{ template "enclosure_media_controls" . }} |
| 261 |
</div> |
| 262 |
{{ else if .IsVideo }} |
| 263 |
<div class="enclosure-video"> |
| 264 |
<video controls preload="metadata" |
| 265 |
{{ if $.user }}data-last-position="{{ .MediaProgression }}"{{ end }} |
| 266 |
{{ if $.user.MediaPlaybackRate }}data-playback-rate="{{ $.user.MediaPlaybackRate }}"{{ end }} |
| 267 |
{{ if $.user.MarkReadOnMediaPlayerCompletion }}data-mark-read-on-completion="0.9"{{ end }} |
| 268 |
{{ if $.user }}data-save-url="{{ routePath "/entry/enclosure/%d/save-progression" .ID }}"{{ end }} |
| 269 |
data-enclosure-id="{{ .ID }}" |
| 270 |
> |
| 271 |
{{ if (and $.user (mustBeProxyfied "video")) }} |
| 272 |
<source src="{{ proxyURL .URL }}" type="{{ .Html5MimeType }}"> |
| 273 |
{{ else }} |
| 274 |
<source src="{{ .URL | untrustedURL }}" type="{{ .Html5MimeType }}"> |
| 275 |
{{ end }} |
| 276 |
</video> |
| 277 |
{{ template "enclosure_media_controls" . }} |
| 278 |
</div> |
| 279 |
{{ end }} |
| 280 |
{{ end }} |
| 281 |
{{ end }} |
| 282 |
{{ end }} |
| 283 |
|
| 284 |
{{ if .user }} |
| 285 |
{{ safeHTML (proxyFilter .entry.Content) }} |
| 286 |
{{ else }} |
| 287 |
{{ safeHTML .entry.Content }} |
| 288 |
{{ end }} |
| 289 |
</article> |
| 290 |
{{ if .entry.Enclosures }} |
| 291 |
<details class="entry-enclosures"> |
| 292 |
<summary>{{ t "page.entry.attachments" }} ({{ len .entry.Enclosures }})</summary> |
| 293 |
{{ range .entry.Enclosures }} |
| 294 |
{{ if ne .URL "" }} |
| 295 |
<div class="entry-enclosure"> |
| 296 |
{{ if .IsImage }} |
| 297 |
<div class="enclosure-image"> |
| 298 |
{{ if (and $.user (mustBeProxyfied "image")) }} |
| 299 |
<img src="{{ proxyURL .URL }}" title="{{ .URL }} ({{ .MimeType }})" loading="lazy" alt="{{ .URL }} ({{ .MimeType }})"> |
| 300 |
{{ else }} |
| 301 |
<img src="{{ .URL | untrustedURL }}" title="{{ .URL }} ({{ .MimeType }})" loading="lazy" alt="{{ .URL }} ({{ .MimeType }})"> |
| 302 |
{{ end }} |
| 303 |
</div> |
| 304 |
{{ end }} |
| 305 |
|
| 306 |
<div class="entry-enclosure-download"> |
| 307 |
<a href="{{ .URL | untrustedURL }}" title="{{ t "action.download" }}{{ if gt .Size 0 }} - {{ formatFileSize .Size }}{{ end }}" {{ if $.user.OpenExternalLinksInNewTab }}target="_blank"{{ else }}rel="noopener"{{ end }}>{{ .URL }}</a> |
| 308 |
<small>{{ if gt .Size 0 }} - <strong>{{ formatFileSize .Size }}</strong>{{ end }}</small> |
| 309 |
</div> |
| 310 |
</div> |
| 311 |
{{ end }} |
| 312 |
{{ end }} |
| 313 |
</details> |
| 314 |
{{ end }} |
| 315 |
|
| 316 |
{{ if .user }} |
| 317 |
<div class="pagination-entry-bottom"> |
| 318 |
{{ template "entry_pagination" . }} |
| 319 |
</div> |
| 320 |
{{ end }} |
| 321 |
{{ end }} |