瀏覽代碼

Add "Mark this page as read" to the bottom

This better matches the most common use case for the "Mark this page as
read" link, which is to click it once you have reached the bottom of the
page. Especially on mobile, it can be annoying to scroll to the top of
the page to click the link.
Adam Vigneaux 7 年之前
父節點
當前提交
07cd7d2135

+ 9 - 0
template/html/category_entries.html

@@ -31,6 +31,15 @@
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 

+ 14 - 5
template/html/feed_entries.html

@@ -4,17 +4,17 @@
 <section class="page-header">
     <h1>{{ .feed.Title }} ({{ .total }})</h1>
     <ul>
+        {{ if .entries }}
         <li>
-            <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
+            <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
         </li>
+        {{ end }}
         <li>
-            <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
+            <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
         </li>
-        {{ if .entries }}
         <li>
-            <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
         </li>
-        {{ end }}
     </ul>
 </section>
 
@@ -42,6 +42,15 @@
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 

+ 9 - 0
template/html/unread_entries.html

@@ -34,6 +34,15 @@
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 

+ 35 - 8
template/views.go

@@ -230,6 +230,15 @@ var templateViewsMap = map[string]string{
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 
@@ -668,17 +677,17 @@ var templateViewsMap = map[string]string{
 <section class="page-header">
     <h1>{{ .feed.Title }} ({{ .total }})</h1>
     <ul>
+        {{ if .entries }}
         <li>
-            <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
+            <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
         </li>
+        {{ end }}
         <li>
-            <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
+            <a href="{{ route "refreshFeed" "feedID" .feed.ID }}">{{ t "Refresh" }}</a>
         </li>
-        {{ if .entries }}
         <li>
-            <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            <a href="{{ route "editFeed" "feedID" .feed.ID }}">{{ t "Edit" }}</a>
         </li>
-        {{ end }}
     </ul>
 </section>
 
@@ -706,6 +715,15 @@ var templateViewsMap = map[string]string{
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 
@@ -1260,6 +1278,15 @@ var templateViewsMap = map[string]string{
         </article>
         {{ end }}
     </div>
+    <section class="page-footer">
+        {{ if .entries }}
+        <ul>
+            <li>
+                <a href="#" data-on-click="markPageAsRead">{{ t "Mark this page as read" }}</a>
+            </li>
+        </ul>
+        {{ end }}
+    </section>
     {{ template "pagination" .pagination }}
 {{ end }}
 
@@ -1335,7 +1362,7 @@ var templateViewsMapChecksums = map[string]string{
 	"add_subscription":    "3fbcffefc94fb0fccfcf870d602f5ba78ce3ab7ebaeacd04198a6e529143cb29",
 	"bookmark_entries":    "49423f84c05d77368e20c8e14c53ad237308cdaf4143413487d1b0e11c18d148",
 	"categories":          "ca1280cd157bb527d4fc907da67b05a8347378f6dce965b9389d4bcdf3600a11",
-	"category_entries":    "6d8f790b61abdf56edd6a6c88c9bf1eff34424fb47fee0463ee7cb198b34e309",
+	"category_entries":    "d219d4bd5376c526c00a3da49b511fb73e812be5d1e12acadeceee8dfa4bbfe2",
 	"choose_subscription": "7266b269ddbe145e757a24a57f3fbc7611e34a20383fbd887988204cebce2681",
 	"create_category":     "2b82af5d2dcd67898dc5daa57a6461e6ff8121a6089b2a2a1be909f35e4a2275",
 	"create_user":         "1ef0a1f9bf119d44929c81f13073a257d69650cf5064960cf06a63fe51923e86",
@@ -1343,7 +1370,7 @@ var templateViewsMapChecksums = map[string]string{
 	"edit_feed":           "1a8e342e4fac80e8b9c73537c7fe8aaf7f9e3e7af22f411927010897dd37e9c3",
 	"edit_user":           "7373e09f805e6c017167001519b9feb04226be6c81c2875cbacd5ce94f2c24bf",
 	"entry":               "1aa2767a879591f0a3681787fc9e2c53e06949695b21106286d190712a9f428a",
-	"feed_entries":        "76e7e32cdd6552304e38931459fe12cefdb5354f65a7ac3bbed52a2979896d3e",
+	"feed_entries":        "bebc42317ca9e908fcdb98cc1c4a2dc3f4bb7ef6d4c288d3d3fba8f8339403b6",
 	"feeds":               "1006698abfe0962b656f27794bc44568515392da72b6fac0c03316de06024237",
 	"history_entries":     "f94e15d37d7604500cede7b583e03bf79c06be81c6597a4a43693f5712af2e13",
 	"import":              "73b5112e20bfd232bf73334544186ea419505936bc237d481517a8622901878f",
@@ -1352,6 +1379,6 @@ var templateViewsMapChecksums = map[string]string{
 	"search_entries":      "a6e69c3edf414558541e8a23bf197d7580b043f8ddaf53a5b609bcd678fd6f3d",
 	"sessions":            "3fa79031dd883847eba92fbafe5f535fa3a4e1614bb610f20588b6f8fc8b3624",
 	"settings":            "d435dc37e82896ce9a7a573b3c2aeda1db71eec62349e2472ebbf1d5c3e0bc21",
-	"unread_entries":      "adbddbdd0ce70f5c622a2a2687b261121e397e15536dcb551f71bb11550ca46b",
+	"unread_entries":      "13c03de837d39daa0457288ecca723d1140395999123b54abbe649537146620e",
 	"users":               "c6d91b0b29984b4cb3073bec6a2933cfb72981ec60f54b6c7aa05194f0e860bd",
 }

文件差異過大導致無法顯示
+ 0 - 0
ui/static/css.go


+ 13 - 5
ui/static/css/common.css

@@ -75,21 +75,27 @@ a:hover {
     color: #888;
 }
 
-/* Page header */
+/* Page header and footer*/
 .page-header {
     margin-bottom: 25px;
 }
 
+.page-footer {
+    margin-bottom: 10px;
+}
+
 .page-header h1 {
     font-weight: 500;
     border-bottom: 1px dotted #ddd;
 }
 
-.page-header ul {
+.page-header ul,
+.page-footer ul, {
     margin-left: 25px;
 }
 
-.page-header li {
+.page-header li,
+.page-footer li {
     list-style-type: circle;
     line-height: 1.8em;
 }
@@ -157,11 +163,13 @@ a:hover {
         font-size: 1.0em;
     }
 
-    .page-header ul {
+    .page-header ul,
+    .page-footer ul {
         margin-left: 0;
     }
 
-    .page-header li {
+    .page-header li,
+    .page-footer li {
         display: inline;
         padding-right: 15px;
     }

部分文件因文件數量過多而無法顯示