aboutsummaryrefslogtreecommitdiffhomepage
path: root/template
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-07-17 21:07:29 -0700
committerGravatar Frédéric Guillot <fred@miniflux.net>2019-07-17 21:15:30 -0700
commit99149d9f2a32dd7426c6c2e51762e0895ed8199c (patch)
treea6f5e2a5758a2e909377e286ad3e129b8e0ed9e8 /template
parent2b6e17c1ef7f54f822e37991eaf7a309013182e2 (diff)
Refactor confirmation handler
Diffstat (limited to 'template')
-rw-r--r--template/html/category_entries.html14
-rw-r--r--template/html/feed_entries.html14
-rw-r--r--template/html/unread_entries.html14
-rw-r--r--template/views.go48
4 files changed, 27 insertions, 63 deletions
diff --git a/template/html/category_entries.html b/template/html/category_entries.html
index b6a2a69..a4076b9 100644
--- a/template/html/category_entries.html
+++ b/template/html/category_entries.html
@@ -7,15 +7,12 @@
{{ if .entries }}
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
{{ end }}
{{ if .showOnlyUnreadEntries }}
@@ -54,15 +51,12 @@
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
diff --git a/template/html/feed_entries.html b/template/html/feed_entries.html
index ce65dce..c162faf 100644
--- a/template/html/feed_entries.html
+++ b/template/html/feed_entries.html
@@ -7,15 +7,12 @@
{{ if .entries }}
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
{{ end }}
{{ if .showOnlyUnreadEntries }}
@@ -82,15 +79,12 @@
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
diff --git a/template/html/unread_entries.html b/template/html/unread_entries.html
index a728cf6..b0b2e15 100644
--- a/template/html/unread_entries.html
+++ b/template/html/unread_entries.html
@@ -7,14 +7,11 @@
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
- data-label-loading="{{ t "confirm.loading" }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-label-loading="{{ t "confirm.loading" }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
<li>
<a data-link-state="flip"
@@ -49,14 +46,11 @@
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
- data-label-loading="{{ t "confirm.loading" }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-label-loading="{{ t "confirm.loading" }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
diff --git a/template/views.go b/template/views.go
index 96e3e00..af283f0 100644
--- a/template/views.go
+++ b/template/views.go
@@ -210,15 +210,12 @@ var templateViewsMap = map[string]string{
{{ if .entries }}
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
{{ end }}
{{ if .showOnlyUnreadEntries }}
@@ -257,15 +254,12 @@ var templateViewsMap = map[string]string{
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
@@ -717,15 +711,12 @@ var templateViewsMap = map[string]string{
{{ if .entries }}
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
{{ end }}
{{ if .showOnlyUnreadEntries }}
@@ -792,15 +783,12 @@ var templateViewsMap = map[string]string{
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
data-label-loading="{{ t "confirm.loading" }}"
- data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-show-only-unread="{{ if .showOnlyUnreadEntries }}1{{ end }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
@@ -1334,14 +1322,11 @@ var templateViewsMap = map[string]string{
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
- data-label-loading="{{ t "confirm.loading" }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-label-loading="{{ t "confirm.loading" }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
<li>
<a data-link-state="flip"
@@ -1376,14 +1361,11 @@ var templateViewsMap = map[string]string{
<ul>
<li>
<a href="#"
- data-confirm="true"
+ data-action="markPageAsRead"
data-label-question="{{ t "confirm.question" }}"
data-label-yes="{{ t "confirm.yes" }}"
data-label-no="{{ t "confirm.no" }}"
- data-label-loading="{{ t "confirm.loading" }}"
- data-mark-page-as-read="true">
- {{ t "menu.mark_page_as_read" }}
- </a>
+ data-label-loading="{{ t "confirm.loading" }}">{{ t "menu.mark_page_as_read" }}</a>
</li>
</ul>
{{ end }}
@@ -1463,7 +1445,7 @@ var templateViewsMapChecksums = map[string]string{
"add_subscription": "a0f1d2bc02b6adc83dbeae593f74d9b936102cd6dd73302cdbec2137cafdcdd9",
"bookmark_entries": "609f4b2342152fe495a219a32f17a4528b01807d61f53cee0cbebf728be73c42",
"categories": "642ee3cddbd825ee6ab5a77caa0d371096b55de0f1bd4ae3055b8c8a70507d8d",
- "category_entries": "a1a2ed91cb87d5501a7df55db4c05adfb8aca9f1991b466ab2f30cf5bdb5825d",
+ "category_entries": "5affb6ddaf73ac7b14d9cc67f7d518d4bb8f280ee6d9f1ad852edd44bad8c7de",
"choose_subscription": "33c04843d7c1b608d034e605e52681822fc6d79bc6b900c04915dd9ebae584e2",
"create_category": "6b22b5ce51abf4e225e23a79f81be09a7fb90acb265e93a8faf9446dff74018d",
"create_user": "1e940be3afefc0a5c6273bbadcddc1e29811e9548e5227ac2adfe697ca5ce081",
@@ -1471,7 +1453,7 @@ var templateViewsMapChecksums = map[string]string{
"edit_feed": "ab30c31a4385a7b16c54baa78bdcb93a57181ed1c5018ce097d7eb50673bb995",
"edit_user": "f4f99412ba771cfca2a2a42778b023b413c5494e9a287053ba8cf380c2865c5f",
"entry": "1626bf4dd3223b2f730865676162aa0a9f0a0e009cdea90f705230542922e0f4",
- "feed_entries": "96386f3ecb0080f89febbcd6489ad5f8ace3aac61066e94fb70d11462b02c143",
+ "feed_entries": "4bb6b96ba4d13dbaf22dcf6dd95ae36b6e5a0c99175d502865a164dc68fd4bae",
"feeds": "31acc253c547a6cce5710d72a6f6b3b396162ecd5e5af295b2cf47c1ff55bd06",
"history_entries": "b65ca1d85615caa7c314a33f1cb997aa3477a79e66b9894b2fd387271ad467d2",
"import": "8349e47a783bb40d8e9248b4771656e5f006185e11079e1c4680dd52633420ed",
@@ -1480,6 +1462,6 @@ var templateViewsMapChecksums = map[string]string{
"search_entries": "d71849a4f2b0573c7c76ad0ea941812009e9f022de60895987a781d3e6f08a01",
"sessions": "1b3ec0970a4111b81f86d6ed187bb410f88972e2ede6723b9febcc4c7e5fc921",
"settings": "152143e58d057ea6ab3bfd8dd947bfd70685843ca40e40542484b23849746df4",
- "unread_entries": "9bfe0223d4dc9b6179e4d35758be644138d7b1e28616ddc1f9df6efab6061ab2",
+ "unread_entries": "5d23dc604496bcfa5ddfd1f5b8693aa5d94d2faa10979d04983e8bd8c7de36e9",
"users": "4b56cc76fbcc424e7c870d0efca93bb44dbfcc2a08b685cf799c773fbb8dfb2f",
}