4445cdd053
Why: A user might want to unshare a specific entry. Navigating to the shared entries page requires a mental context switch, whereas having the ability right in the entry page makes it easier. What: Add an extra <li> element to display the unshare icon and link in the entry view as well as the item_meta template. The latter is shared for multiple pages listing entries, e.g. bookmarks, feed entries, search, history etc. The functionality already exists for the shared entries page, we are just expose it in a couple more places Signed-off-by: Alexandros Kosiaris <akosiaris@gmail.com>
85 lines
4.3 KiB
HTML
85 lines
4.3 KiB
HTML
{{ define "item_meta" }}
|
|
<div class="item-meta">
|
|
<ul class="item-meta-info">
|
|
<li>
|
|
<a href="{{ route "feedEntries" "feedID" .entry.Feed.ID }}" title="{{ .entry.Feed.SiteURL }}" data-feed-link="true">{{ truncate .entry.Feed.Title 35 }}</a>
|
|
</li>
|
|
<li>
|
|
<time datetime="{{ isodate .entry.Date }}" title="{{ isodate .entry.Date }}">{{ elapsed .user.Timezone .entry.Date }}</time>
|
|
</li>
|
|
{{ if and .user.ShowReadingTime (gt .entry.ReadingTime 0) }}
|
|
<li>
|
|
<span>
|
|
{{ plural "entry.estimated_reading_time" .entry.ReadingTime .entry.ReadingTime }}
|
|
</span>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
<ul class="item-meta-icons">
|
|
<li>
|
|
<a href="#"
|
|
title="{{ t "entry.status.title" }}"
|
|
data-toggle-status="true"
|
|
data-label-loading="{{ t "entry.state.saving" }}"
|
|
data-label-read="{{ t "entry.status.read" }}"
|
|
data-label-unread="{{ t "entry.status.unread" }}"
|
|
data-value="{{ if eq .entry.Status "read" }}read{{ else }}unread{{ end }}"
|
|
>{{ if eq .entry.Status "read" }}{{ icon "unread" }}{{ else }}{{ icon "read" }}{{ end }}<span class="icon-label">{{ if eq .entry.Status "read" }}{{ t "entry.status.unread" }}{{ else }}{{ t "entry.status.read" }}{{ end }}</span></a>
|
|
</li>
|
|
<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="{{ t "entry.bookmark.toggle.on" }}"
|
|
data-label-unstar="{{ t "entry.bookmark.toggle.off" }}"
|
|
data-value="{{ if .entry.Starred }}star{{ else }}unstar{{ end }}"
|
|
>{{ if .entry.Starred }}{{ icon "unstar" }}{{ else }}{{ icon "star" }}{{ end }}<span class="icon-label">{{ if .entry.Starred }}{{ t "entry.bookmark.toggle.off" }}{{ else }}{{ t "entry.bookmark.toggle.on" }}{{ end }}</span></a>
|
|
</li>
|
|
{{ if .entry.ShareCode }}
|
|
<li>
|
|
<a href="{{ route "sharedEntry" "shareCode" .entry.ShareCode }}"
|
|
title="{{ t "entry.shared_entry.title" }}"
|
|
target="_blank">{{ icon "share" }}<span class="icon-label">{{ t "entry.shared_entry.label" }}</span></a>
|
|
</li>
|
|
<li>
|
|
<a href="#"
|
|
data-confirm="true"
|
|
data-url="{{ route "unshareEntry" "entryID" .entry.ID }}"
|
|
data-label-question="{{ t "confirm.question" }}"
|
|
data-label-yes="{{ t "confirm.yes" }}"
|
|
data-label-no="{{ t "confirm.no" }}"
|
|
data-label-loading="{{ t "confirm.loading" }}">{{ icon "delete" }}<span class="icon-label">{{ t "entry.unshare.label" }}</span></a>
|
|
</li>
|
|
{{ end }}
|
|
{{ 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" }}"
|
|
>{{ icon "save" }}<span class="icon-label">{{ t "entry.save.label" }}</span></a>
|
|
</li>
|
|
{{ end }}
|
|
<li>
|
|
<a href="{{ .entry.URL | safeURL }}"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
referrerpolicy="no-referrer"
|
|
data-original-link="true">{{ icon "external-link" }}<span class="icon-label">{{ t "entry.external_link.label" }}</span></a>
|
|
</li>
|
|
{{ if .entry.CommentsURL }}
|
|
<li>
|
|
<a href="{{ .entry.CommentsURL | safeURL }}"
|
|
title="{{ t "entry.comments.title" }}"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
referrerpolicy="no-referrer"
|
|
data-comments-link="true">{{ icon "comment" }}<span class="icon-label">{{ t "entry.comments.label" }}</span></a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|