]> git.plutz.net Git - serve0/blobdiff - templates/list.html.sh
styling for pagination links
[serve0] / templates / list.html.sh
index a03c4dac673332f0525b622e91491fdc224ade1f..e60f3b8b4d4ac9792426c19876841a774c68819d 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
 #
 # This file is part of Serve0
 # 
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
 
 cat <<EOF
-  <form class="panel" id="search" style="display: block;"
-        action="?" method="get" accept-charset="UTF-8">
+
+  <input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
+  <form class="panel" id="search" action="?" method="get" accept-charset="UTF-8">
     <input type="text" name="s" value="$search" placeholder="Search">
 
-    <label for="o1" class="order">Order by:</label>
     <select class="order" size="1" name="o" id="o1">
+      <option class="label" selected disabled>Order by</option>
       <option>Name</option>
       <option>Date</option>
       <option>Length</option>
     </select>
-    <input type="submit" name="submit" value="Find">
-
-    <a class="panel clearsearch" href="?">Clear All</a>
-    <a class="panel advanced show" href="#advfilter">Advanced</a>
+    <!-- input type="submit" name="submit" value="Find" -->
 
-    <div class="pagination_nav">
-      <label>Page:</label>
-      <a href="?${page_prev}">&lt;&lt;</a>
-      <a href="?${page_this}">$(($page / $pagesize + 1))</a>
-      <a href="?${page_next}">&gt;&gt;</a>
-    </div>
+    <a class="panel clearsearch" href="?">Clear</a>
   </form>
 
-  <form action="?action=multitag&${page_this}" method="post" accept-charset="UTF-8">
+  <input type=radio name=topmenu id=btn_advfilter><label for=btn_advfilter>Advanced</label>
+  $(. $_EXEC/templates/advfilter.html.sh)
+
+  <input type=radio name=topmenu id=btn_preferences><label for=btn_preferences>Preferences</label>
+  $(. $_EXEC/templates/preferences.html.sh)
+
+  <input type=radio name=topmenu id=btn_morelinks><label for=btn_morelinks>{+}</label>
+  <div class="panel switchable top" id="morelinks">
+    <a class="panel toggle" href="#">Hide</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="page" value="?$(attribsafe "${page_this}")">
+
     <ul id="thumblist">
-      $(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)
   </form>
 
-  <div class="panel footer" id="foot">
-    <a class="panel tagger show" href="#tagger">Add Tags</a>
-    <a class="panel tagger show" href="#preferences">Preferences</a>
+  <div class="panel" id="foot">
+    <a class="panel toggle" href="#tagger">Add Tags</a>
+    <a class="panel toggle" href="#">⇧</a>
 
     <div class="pagination_nav">
       <label>Page:</label>
-      <a href="?${page_prev}">&lt;&lt;</a>
-      <a href="?${page_this}">$(($page / $pagesize + 1))</a>
-      <a href="?${page_next}">&gt;&gt;</a>
+      ${pages}
     </div>
   </div>
 
-  $(. $_EXEC/templates/preferences.html.sh)
-  $(. $_EXEC/templates/advfilter.html.sh)
 EOF
 
 # vi:set filetype=html: