فهرست منبع

Gray out pagination buttons when they are not applicable

Whenever the "prev" and "next" buttons have no hyperlink, decrease their
opacity to signal that they lead to nowhere.

This signal is stronger and more obvious than the current one which
merely removes the underline decoration from the text.

This patch is an improvement on top of
https://github.com/miniflux/v2/pull/1107
Thiago Perrotta 4 سال پیش
والد
کامیت
c1ece47532
3فایلهای تغییر یافته به همراه8 افزوده شده و 4 حذف شده
  1. 2 2
      template/templates/common/entry_pagination.html
  2. 2 2
      template/templates/common/pagination.html
  3. 4 0
      ui/static/css/common.css

+ 2 - 2
template/templates/common/entry_pagination.html

@@ -1,6 +1,6 @@
 {{ define "entry_pagination" }}
 {{ define "entry_pagination" }}
 <div class="pagination">
 <div class="pagination">
-    <div class="pagination-prev">
+    <div class="pagination-prev {{ if not .prevEntry }}disabled{{end}}">
         {{ if .prevEntry }}
         {{ if .prevEntry }}
             <a href="{{ .prevEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .prevEntry.Title }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a>
             <a href="{{ .prevEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .prevEntry.Title }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a>
         {{ else }}
         {{ else }}
@@ -8,7 +8,7 @@
         {{ end }}
         {{ end }}
     </div>
     </div>
 
 
-    <div class="pagination-next">
+    <div class="pagination-next {{ if not .nextEntry }}disabled{{end}}">
         {{ if .nextEntry }}
         {{ if .nextEntry }}
             <a href="{{ .nextEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .nextEntry.Title }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>
             <a href="{{ .nextEntryRoute }}{{ if .searchQuery }}?q={{ .searchQuery }}{{ end }}" title="{{ .nextEntry.Title }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>
         {{ else }}
         {{ else }}

+ 2 - 2
template/templates/common/pagination.html

@@ -1,6 +1,6 @@
 {{ define "pagination" }}
 {{ define "pagination" }}
 <div class="pagination">
 <div class="pagination">
-    <div class="pagination-prev">
+    <div class="pagination-prev {{ if not .ShowPrev }}disabled{{end}}">
         {{ if .ShowPrev }}
         {{ if .ShowPrev }}
             <a href="{{ .Route }}{{ if gt .PrevOffset 0 }}?offset={{ .PrevOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}{{ else }}{{ if .SearchQuery }}?q={{ .SearchQuery }}{{ end }}{{ end }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a>
             <a href="{{ .Route }}{{ if gt .PrevOffset 0 }}?offset={{ .PrevOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}{{ else }}{{ if .SearchQuery }}?q={{ .SearchQuery }}{{ end }}{{ end }}" data-page="previous" rel="prev">{{ t "pagination.previous" }}</a>
         {{ else }}
         {{ else }}
@@ -8,7 +8,7 @@
         {{ end }}
         {{ end }}
     </div>
     </div>
 
 
-    <div class="pagination-next">
+    <div class="pagination-next {{ if not .ShowNext }}disabled{{end}}">
         {{ if .ShowNext }}
         {{ if .ShowNext }}
             <a href="{{ .Route }}?offset={{ .NextOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>
             <a href="{{ .Route }}?offset={{ .NextOffset }}{{ if .SearchQuery }}&amp;q={{ .SearchQuery }}{{ end }}" data-page="next" rel="next">{{ t "pagination.next" }}</a>
         {{ else }}
         {{ else }}

+ 4 - 0
ui/static/css/common.css

@@ -1065,3 +1065,7 @@ details.entry-enclosures {
 .rules-entry {
 .rules-entry {
     display: flex;
     display: flex;
 }
 }
+
+.disabled {
+    opacity: 20%;
+}