]> git.plutz.net Git - serve0/blobdiff - templates/list.html.sh
styling for pagination links
[serve0] / templates / list.html.sh
index 21dfd1189a976296d0b7ad170e893577e94018b5..e60f3b8b4d4ac9792426c19876841a774c68819d 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014 - 2016 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
 #
 # This file is part of Serve0
 # 
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
-pages="$(
-seq 1 $(pagecount) \
-| while read pn; do
-  plink="$(($pn * $pagesize - $pagesize + 1))"
-  
-  case "$plink" in
-    $(($page - $pagesize))) class=previous;;
-    $page) class=current;;
-    $(($page + $pagesize))) class=next;;
-    * ) class='';;
-  esac
-
-  printf '<a class="%s" href="?%spn=%s">%s</a>\n' "$class" "$page_link" "$plink" "$pn"
-done
-)"
-
 cat <<EOF
 
   <input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
@@ -58,21 +42,34 @@ cat <<EOF
   <div class="panel switchable top" id="morelinks">
     <a class="panel toggle" href="#">Hide</a>
 
-    <a class="panel treeview" href="?p=tree">Browse Folders</a>
+    <a class="panel treeview" href="?p=browse">Browse Folders</a>
     <a class="panel" href="?p=playctl">Player</a>
   </div>
 
   <form action="?action=multitag" method="post" accept-charset="UTF-8">
-    <input type="hidden" name="o" value="${order}">
-    <input type="hidden" name="s" value="${search}">
-    <input type="hidden" name="f" value="${filter}">
-    <input type="hidden" name="pn" value="${page}">
+    <input type="hidden" name="page" value="?$(attribsafe "${page_this}")">
 
     <ul id="thumblist">
 EOF
 
   thumblist
 
+  pages="$(
+  seq 1 $(pagecount) \
+  | while read pn; do
+    plink="$(($pn * $pagesize - $pagesize + 1))"
+    
+    case "$plink" in
+      ($(($page - $pagesize))) class=previous;;
+      ($page) class=current;;
+      ($(($page + $pagesize))) class=next;;
+      (*) class='';;
+    esac
+  
+    printf '<a class="%s" href="?%spn=%s">%s</a>\n' "$class" "$page_link" "$plink" "$pn"
+  done
+  )"
+
 cat <<EOF
     </ul>
     $(. $_EXEC/templates/tagger.html.sh)