1
0
Fork 0
miniflux/template/html/entry.html

173 lines
8.7 KiB
HTML
Raw Normal View History

2017-11-20 00:10:04 -05:00
{{ define "title"}}{{ .entry.Title }}{{ end }}
{{ define "content"}}
2018-08-28 23:44:34 -04:00
<section class="entry" data-id="{{ .entry.ID }}">
2017-11-20 00:10:04 -05:00
<header class="entry-header">
<h1>
<a href="{{ .entry.URL | safeURL }}" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .entry.Title }}</a>
2017-11-20 00:10:04 -05:00
</h1>
{{ if .user }}
2017-12-02 22:32:14 -05:00
<div class="entry-actions">
<ul>
2018-08-28 23:44:34 -04:00
<li>
<a href="#"
title="{{ t "entry.status.title" }}"
2018-08-28 23:44:34 -04:00
data-toggle-status="true"
2020-03-22 18:18:12 -04:00
data-label-read="✘&nbsp;{{ t "entry.status.unread" }}"
data-label-unread="✔︎&nbsp;{{ t "entry.status.read" }}"
data-toast-read="✘&nbsp;{{ t "entry.status.toast.unread" }}"
data-toast-unread="✔︎&nbsp;{{ t "entry.status.toast.read" }}"
2018-08-28 23:44:34 -04:00
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
2020-03-22 18:18:12 -04:00
><span class="icon-label">{{ if eq .entry.Status "read" }}✔&nbsp;{{ t "entry.status.read" }}{{ else }}✘&nbsp;{{ t "entry.status.unread" }}{{ end }}</span></a>
2018-08-28 23:44:34 -04:00
</li>
2017-12-22 14:33:01 -05:00
<li>
<a href="#"
data-toggle-bookmark="true"
data-bookmark-url="{{ route "toggleBookmark" "entryID" .entry.ID }}"
data-label-loading="{{ t "entry.state.saving" }}"
data-label-star="☆&nbsp;{{ t "entry.bookmark.toggle.on" }}"
data-label-unstar="★&nbsp;{{ t "entry.bookmark.toggle.off" }}"
data-toast-star="★&nbsp;{{ t "entry.bookmark.toast.on" }}"
data-toast-unstar="☆&nbsp;{{ t "entry.bookmark.toast.off" }}"
data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
2020-03-22 18:18:12 -04:00
><span class="icon-label">{{ if .entry.Starred }}★&nbsp;{{ t "entry.bookmark.toggle.off" }}{{ else }}☆&nbsp;{{ t "entry.bookmark.toggle.on" }}{{ end }}</span></a>
2017-12-22 14:33:01 -05:00
</li>
{{ if .hasSaveEntry }}
<li>
<a href="#"
title="{{ t "entry.save.title" }}"
data-save-entry="true"
data-save-url="{{ route "saveEntry" "entryID" .entry.ID }}"
data-label-loading="{{ t "entry.state.saving" }}"
data-label-done="{{ t "entry.save.completed" }}"
data-toast-done="{{ t "entry.save.toast.completed" }}"
2020-03-22 18:18:12 -04:00
>{{ template "icon_save" }}<span class="icon-label">{{ t "entry.save.label" }}</span></a>
</li>
{{ end }}
<li>
{{ if .entry.ShareCode }}
<a href="{{ route "sharedEntry" "shareCode" .entry.ShareCode }}"
title="{{ t "entry.shared_entry.title" }}"
target="_blank">{{ template "icon_share" }}<span class="icon-label">{{ t "entry.shared_entry.label" }}</span></a>
{{ else }}
<a href="{{ route "shareEntry" "entryID" .entry.ID }}"
title="{{ t "entry.share.title" }}"
target="_blank">{{ template "icon_share" }}<span class="icon-label">{{ t "entry.share.label" }}</span></a>
{{ end }}
</li>
<li>
<a href="#"
title="{{ t "entry.scraper.title" }}"
data-fetch-content-entry="true"
data-fetch-content-url="{{ route "fetchContent" "entryID" .entry.ID }}"
data-label-loading="{{ t "entry.state.loading" }}"
2020-03-22 18:18:12 -04:00
>{{ template "icon_scraper" }}<span class="icon-label">{{ t "entry.scraper.label" }}</span></a>
</li>
2018-04-07 16:50:45 -04:00
{{ if .entry.CommentsURL }}
<li>
2020-03-22 18:18:12 -04:00
<a href="{{ .entry.CommentsURL | safeURL }}"
title="{{ t "entry.comments.title" }}"
target="_blank"
rel="noopener noreferrer"
referrerpolicy="no-referrer"
data-comments-link="true"
>{{ template "icon_comment" }}<span class="icon-label">{{ t "entry.comments.label" }}</span></a>
2018-04-07 16:50:45 -04:00
</li>
{{ end }}
</ul>
2017-12-02 22:32:14 -05:00
</div>
{{ end }}
2017-11-20 00:10:04 -05:00
<div class="entry-meta">
<span class="entry-website">
{{ if and .user (ne .entry.Feed.Icon.IconID 0) }}
<img src="{{ route "icon" "iconID" .entry.Feed.Icon.IconID }}" width="16" height="16" loading="lazy" alt="{{ .entry.Feed.Title }}">
2017-11-20 00:10:04 -05:00
{{ end }}
{{ if .user }}
<a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}">{{ .entry.Feed.Title }}</a>
{{ else }}
<a href="{{ .entry.Feed.SiteURL | safeURL }}">{{ .entry.Feed.Title }}</a>
{{ end }}
2017-11-20 00:10:04 -05:00
</span>
{{ if .entry.Author }}
<span class="entry-author">
2017-11-25 20:08:04 -05:00
{{ if isEmail .entry.Author }}
2017-11-20 00:10:04 -05:00
- <a href="mailto:{{ .entry.Author }}">{{ .entry.Author }}</a>
{{ else }}
<em>{{ .entry.Author }}</em>
{{ end }}
</span>
{{ end }}
{{ if .user }}
<span class="category">
<a href="{{ route "categoryEntries" "categoryID" .entry.Feed.Category.ID }}">{{ .entry.Feed.Category.Title }}</a>
</span>
{{ end }}
2017-11-20 00:10:04 -05:00
</div>
<div class="entry-date">
{{ if .user }}
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed $.user.Timezone .entry.Date }}</time>
{{ else }}
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed "UTC" .entry.Date }}</time>
{{ end }}
2017-11-20 00:10:04 -05:00
</div>
</header>
{{ if gt (len .entry.Content) 120 }}
{{ if .user }}
2017-11-20 00:10:04 -05:00
<div class="pagination-top">
{{ template "entry_pagination" . }}
</div>
{{ end }}
{{ end }}
2017-11-20 00:10:04 -05:00
<article class="entry-content">
{{ if .user }}
{{ noescape (proxyFilter .entry.Content) }}
{{ else }}
{{ noescape .entry.Content }}
{{ end }}
2017-11-20 00:10:04 -05:00
</article>
{{ if .entry.Enclosures }}
<details class="entry-enclosures">
<summary>{{ t "page.entry.attachments" }} ({{ len .entry.Enclosures }})</summary>
2017-11-20 00:10:04 -05:00
{{ range .entry.Enclosures }}
2020-01-31 00:08:11 -05:00
{{ if ne .URL "" }}
2017-11-20 00:10:04 -05:00
<div class="entry-enclosure">
{{ if hasPrefix .MimeType "audio/" }}
<div class="enclosure-audio">
<audio controls preload="metadata">
<source src="{{ .URL | safeURL }}" type="{{ .MimeType }}">
2017-11-20 00:10:04 -05:00
</audio>
</div>
{{ else if hasPrefix .MimeType "video/" }}
<div class="enclosure-video">
<video controls preload="metadata">
<source src="{{ .URL | safeURL }}" type="{{ .MimeType }}">
2017-11-20 00:10:04 -05:00
</video>
</div>
{{ else if hasPrefix .MimeType "image/" }}
<div class="enclosure-image">
{{ if $.user }}
<img src="{{ proxyURL .URL }}" title="{{ .URL }} ({{ .MimeType }})" loading="lazy" alt="{{ .URL }} ({{ .MimeType }})">
{{ else }}
<img src="{{ .URL | safeURL }}" title="{{ .URL }} ({{ .MimeType }})" loading="lazy" alt="{{ .URL }} ({{ .MimeType }})">
{{ end }}
2017-11-20 00:10:04 -05:00
</div>
{{ end }}
<div class="entry-enclosure-download">
<a href="{{ .URL | safeURL }}" title="{{ t "action.download" }}{{ if gt .Size 0 }} - {{ formatFileSize .Size }}{{ end }} ({{ .MimeType }})" target="_blank" rel="noopener noreferrer" referrerpolicy="no-referrer">{{ .URL | safeURL }}</a>
2019-11-29 13:27:25 -05:00
<small>{{ if gt .Size 0 }} - <strong>{{ formatFileSize .Size }}</strong>{{ end }}</small>
2017-11-20 00:10:04 -05:00
</div>
</div>
2020-01-31 00:08:11 -05:00
{{ end }}
2017-11-20 00:10:04 -05:00
{{ end }}
</details>
2017-11-20 00:10:04 -05:00
{{ end }}
</section>
{{ if .user }}
2017-11-20 00:10:04 -05:00
<div class="pagination-bottom">
{{ template "entry_pagination" . }}
</div>
{{ end }}
{{ end }}