2020-03-23 02:48:14 +01:00
|
|
|
{{ define "title"}}{{ t "page.shared_entries.title" }} ({{ .total }}){{ end }}
|
|
|
|
|
2024-01-27 09:25:55 +01:00
|
|
|
{{ define "page_header"}}
|
2024-02-02 09:30:45 +01:00
|
|
|
<section class="page-header" aria-labelledby="page-header-title page-header-title-count">
|
2024-01-25 07:22:18 +01:00
|
|
|
<h1 id="page-header-title">
|
2024-01-23 03:42:10 +01:00
|
|
|
{{ t "page.shared_entries.title" }}
|
|
|
|
<span aria-hidden="true">({{ .total }})</span>
|
|
|
|
</h1>
|
2024-02-04 21:51:04 +01:00
|
|
|
<span id="page-header-title-count" class="sr-only">{{ plural "page.shared_entries_count" .total .total }}</span>
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ if .entries }}
|
2024-01-23 03:42:10 +01:00
|
|
|
<nav aria-label="{{ t "page.shared_entries.title" }} {{ t "menu.title" }}">
|
|
|
|
<ul>
|
|
|
|
<li>
|
Replace link has button role with button tag
# Change HTML tag to button
Replace the link tag with an HTML button to prevent some screen readers from having confusing announcements. By using the HTML button, users can use the Enter and Space keys to activate actions by default, instead of implementing them in JavaScript.
# Differentiate links and buttons visually
When activating the link element, the user may expect the web page to navigate to the URL and the page will refresh; when activating the button element, the user may expect the web page to still be on the same page, so that their current state, such as: input value, won't disappear.
Links and buttons should have different styles visually, so that users can't expect what will happen when they activate a link or a button.
I added the underline to the links, because that is the common pattern. Buttons have border and background color in a common pattern. But I think that will change the current layout drastically. So I added the focus, hover and active classes to the buttons instead.
2024-02-10 02:09:30 +01:00
|
|
|
<button
|
|
|
|
class="page-button"
|
2024-01-23 03:42:10 +01:00
|
|
|
data-confirm="true"
|
|
|
|
data-url="{{ route "flushHistory" }}"
|
|
|
|
data-label-question="{{ t "confirm.question" }}"
|
|
|
|
data-label-yes="{{ t "confirm.yes" }}"
|
|
|
|
data-label-no="{{ t "confirm.no" }}"
|
Replace link has button role with button tag
# Change HTML tag to button
Replace the link tag with an HTML button to prevent some screen readers from having confusing announcements. By using the HTML button, users can use the Enter and Space keys to activate actions by default, instead of implementing them in JavaScript.
# Differentiate links and buttons visually
When activating the link element, the user may expect the web page to navigate to the URL and the page will refresh; when activating the button element, the user may expect the web page to still be on the same page, so that their current state, such as: input value, won't disappear.
Links and buttons should have different styles visually, so that users can't expect what will happen when they activate a link or a button.
I added the underline to the links, because that is the common pattern. Buttons have border and background color in a common pattern. But I think that will change the current layout drastically. So I added the focus, hover and active classes to the buttons instead.
2024-02-10 02:09:30 +01:00
|
|
|
data-label-loading="{{ t "confirm.loading" }}">{{ icon "delete" }}{{ t "menu.flush_history" }}</button>
|
2024-01-23 03:42:10 +01:00
|
|
|
</li>
|
|
|
|
<li>
|
Replace link has button role with button tag
# Change HTML tag to button
Replace the link tag with an HTML button to prevent some screen readers from having confusing announcements. By using the HTML button, users can use the Enter and Space keys to activate actions by default, instead of implementing them in JavaScript.
# Differentiate links and buttons visually
When activating the link element, the user may expect the web page to navigate to the URL and the page will refresh; when activating the button element, the user may expect the web page to still be on the same page, so that their current state, such as: input value, won't disappear.
Links and buttons should have different styles visually, so that users can't expect what will happen when they activate a link or a button.
I added the underline to the links, because that is the common pattern. Buttons have border and background color in a common pattern. But I think that will change the current layout drastically. So I added the focus, hover and active classes to the buttons instead.
2024-02-10 02:09:30 +01:00
|
|
|
<a class="page-link" href="{{ route "sharedEntries" }}">{{ icon "share" }}{{ t "menu.shared_entries" }}</a>
|
2024-01-23 03:42:10 +01:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ end }}
|
2024-01-27 09:25:55 +01:00
|
|
|
</section>
|
2024-01-25 07:22:18 +01:00
|
|
|
{{ end }}
|
2020-03-23 02:48:14 +01:00
|
|
|
|
2024-01-25 07:22:18 +01:00
|
|
|
{{ define "content"}}
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ if not .entries }}
|
2024-02-05 07:20:05 +01:00
|
|
|
<p role="alert" class="alert alert-info">{{ t "alert.no_shared_entry" }}</p>
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ else }}
|
|
|
|
<div class="items">
|
|
|
|
{{ range .entries }}
|
2024-02-02 04:15:33 +01:00
|
|
|
<article
|
|
|
|
class="item entry-item {{ if $.user.EntrySwipe }}entry-swipe{{ end }} item-status-{{ .Status }}"
|
|
|
|
data-id="{{ .ID }}"
|
|
|
|
aria-labelledby="entry-title-{{ .ID }}"
|
2024-02-08 10:10:59 +01:00
|
|
|
tabindex="-1"
|
2024-02-02 04:15:33 +01:00
|
|
|
>
|
|
|
|
<header class="item-header" dir="auto">
|
|
|
|
<h2 id="entry-title-{{ .ID }}" class="item-title">
|
|
|
|
<a href="{{ route "readEntry" "entryID" .ID }}">
|
|
|
|
{{ if ne .Feed.Icon.IconID 0 }}
|
2024-02-07 13:32:30 +01:00
|
|
|
<img src="{{ route "icon" "iconID" .Feed.Icon.IconID }}" width="16" height="16" loading="lazy" alt="">
|
2024-02-02 04:15:33 +01:00
|
|
|
{{ end }}
|
|
|
|
{{ .Title }}
|
|
|
|
</a>
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ if .ShareCode }}
|
2024-02-02 04:15:33 +01:00
|
|
|
<a href="{{ route "sharedEntry" "shareCode" .ShareCode }}"
|
|
|
|
title="{{ t "entry.shared_entry.title" }}"
|
|
|
|
target="_blank">{{ icon "share" }}</a>
|
2020-03-23 02:48:14 +01:00
|
|
|
{{ end }}
|
2024-02-02 04:15:33 +01:00
|
|
|
</h2>
|
2020-03-23 02:48:14 +01:00
|
|
|
<span class="category"><a href="{{ route "categoryEntries" "categoryID" .Feed.Category.ID }}">{{ .Feed.Category.Title }}</a></span>
|
2024-02-02 04:15:33 +01:00
|
|
|
</header>
|
2020-03-23 02:48:14 +01:00
|
|
|
<div class="item-meta">
|
|
|
|
<ul class="item-meta-info">
|
2023-02-07 05:46:42 +01:00
|
|
|
<li class="item-meta-info-site-url">
|
2020-03-23 02:48:14 +01:00
|
|
|
<a href="{{ route "feedEntries" "feedID" .Feed.ID }}" title="{{ .Feed.SiteURL }}">{{ truncate .Feed.Title 35 }}</a>
|
|
|
|
</li>
|
2023-02-07 05:46:42 +01:00
|
|
|
<li class="item-meta-info-timestamp">
|
2020-03-23 02:48:14 +01:00
|
|
|
<time datetime="{{ isodate .Date }}" title="{{ isodate .Date }}">{{ elapsed $.user.Timezone .Date }}</time>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<ul class="item-meta-icons">
|
2023-02-07 05:46:42 +01:00
|
|
|
<li class="item-meta-icons-delete">
|
2021-03-07 20:02:52 +01:00
|
|
|
{{ icon "delete" }}
|
2020-03-23 02:48:14 +01:00
|
|
|
<a href="#"
|
|
|
|
data-confirm="true"
|
|
|
|
data-url="{{ route "unshareEntry" "entryID" .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" }}">{{ t "entry.unshare.label" }}</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ end }}
|