]> git.plutz.net Git - serve0/blob - templates/browse.html.sh
styling for pagination links
[serve0] / templates / browse.html.sh
1 # Copyright 2017 Paul Hänsch
2 #
3 # This file is part of Serve0
4
5 # Serve0 is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9
10 # Serve0 is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Serve0  If not, see <http://www.gnu.org/licenses/>. 
17
18 cat <<EOF
19
20   <input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
21   <form class="panel" id="search" action="?" method="get" accept-charset="UTF-8">
22     <input type="hidden" name="d" value="$(attribsafe "$directory")">
23     <input type="text" name="s" value="$(attribsafe "$search")" placeholder="Search">
24
25     <select class="order" size="1" name="o" id="o1">
26       <option class="label" selected disabled>Order by</option>
27       <option>Name</option>
28       <option>Date</option>
29       <option>Length</option>
30     </select>
31     <!-- input type="submit" name="submit" value="Find" -->
32
33     <a class="panel clearsearch" href="?">Clear</a>
34   </form>
35
36   <input type=radio name=topmenu id=btn_advfilter><label for=btn_advfilter>Advanced</label>
37   $(. $_EXEC/templates/advfilter.html.sh)
38
39   <input type=radio name=topmenu id=btn_preferences><label for=btn_preferences>Preferences</label>
40   $(. $_EXEC/templates/preferences.html.sh)
41
42   <input type=radio name=topmenu id=btn_morelinks><label for=btn_morelinks>{+}</label>
43   <div class="panel switchable top" id="morelinks">
44     <a class="panel toggle" href="#">Hide</a>
45
46     <a class="panel" href="?p=playctl">Player</a>
47   </div>
48
49   <form action="?action=multitag" method="post" accept-charset="UTF-8">
50     <input type="hidden" name="page" value="?$(attribsafe "${page_this}")">
51
52     <ul id="thumblist">
53 EOF
54
55   thumblist
56
57   pages="$(
58   seq 1 $(pagecount) \
59   | while read pn; do
60     plink="$(($pn * $pagesize - $pagesize + 1))"
61     
62     case "$plink" in
63       ($(($page - $pagesize))) class=previous;;
64       ($page) class=current;;
65       ($(($page + $pagesize))) class=next;;
66       (*) class='';;
67     esac
68   
69     printf '<a class="%s" href="?%spn=%s">%s</a>\n' "$class" "$page_link" "$plink" "$pn"
70   done
71   )"
72
73 cat <<EOF
74     </ul>
75     $(. $_EXEC/templates/tagger.html.sh)
76   </form>
77
78   <div class="panel" id="foot">
79     $( $indexed \
80        && printf '<a class="panel toggle" href="#tagger">Add Tags</a>' \
81        || printf '<a class="panel" href="?action=dirindex&d=%s">Spawn Index</a>' "$(urlsafe "$directory")"
82     )
83     <a class="panel toggle" href="#">⇧</a>
84
85     <div class="pagination_nav">
86       <label>Page:</label>
87       ${pages}
88     </div>
89   </div>
90
91 EOF
92
93 # vi:set filetype=html: