]> git.plutz.net Git - serve0/blob - templates/view.html.sh
6c8a2e0aec965534908f63afaed53e8241ea0f62
[serve0] / templates / view.html.sh
1 # Copyright 2014 - 2016 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 <input type=radio name=topmenu id=btn_search checked><label for=btn_search>Search</label>
20 <form class="panel" id="search" action="?" method="get" accept-charset="UTF-8">
21   <input type="text" name="s" value="$search" placeholder="Search">
22
23   <select class="order" size="1" name="o" id="o1">
24     <option class="label" selected disabled>Order by</option>
25     <option>Name</option>
26     <option>Date</option>
27     <option>Length</option>
28   </select>
29   <!-- input type="submit" name="submit" value="Find" -->
30
31   <a class="panel" href="${info:+?p=list&amp;${page_this}}${directory:+?p=browse&amp;d=${directory}&amp;${page_this}}#$(urlsafe $info)">Dismiss</a>
32 </form>
33
34 <input type=radio name=topmenu id=btn_preferences><label for=btn_preferences>Preferences</label>
35   $(. $_EXEC/templates/preferences.html.sh)
36
37 <input type=radio name=topmenu id=btn_morelinks><label for=btn_morelinks>{+}</label>
38 <div class="panel switchable top" id="morelinks">
39   <a class="panel toggle" href="#">Hide</a>
40
41   <a class="panel listview" href="?p=list">Index view</a>
42   <a class="panel treeview" href="?p=browse">Browse Folders</a>
43 </div>
44
45
46 <div id="videoview">
47   <h1>$(htmlsafe "$info")</h1>
48
49   <a href="$(urlsafe "$video")">Download</a>
50   <a href="javascript:stereoview(180, document.getElementById('mainvideo'));">View 180º Steroscopic</a>
51   <a href="javascript:stereoview(360, document.getElementById('mainvideo'));">View 360º Steroscopic</a>
52   <video id="mainvideo" autoplay controls>
53     <source src="$(urlsafe "$video")" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
54   </video>
55
56   <span class="info length">$(printf "%d:%02d min" $(($length / 60)) $(($length % 60)) )</span>
57   <span class="info width" >Width: $width</span>
58   <span class="info height">Height: $height</span><br>
59   
60   $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span> :g')
61   ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
62 </div>
63
64 <script type="text/javascript" src="?static=stereoview.js"></script>
65
66 <form class="panel switchable bottom" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
67   <input type="hidden" name="referrer" value="$(attribsafe "${REQUEST_URI}")">
68   <input type="hidden" name="length" value="$length">
69   <input type="hidden" name="width" value="$width">
70   <input type="hidden" name="height" value="$height">
71
72   $(
73   for cat in $(list_categories); do
74     printf '<fieldset class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
75     catt="${cat}:"
76     [ "$catt" = "none:" ] && catt=''
77     
78     printf %s "$taglist_set" |egrep '^'"$catt"'[^:]+$' |while read line; do
79       printf '<option %s value="%s">%s</option>' \
80              "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
81              "$line" "${line#*:}"
82     done
83     printf '</select></fieldset>'
84   done
85   )
86
87   <fieldset class="newtag additional">
88     <label class="additional">Additional Tags (one per line):</label>
89     <textarea name="tags" rows="4"></textarea>
90   </fieldset>
91   <fieldset class="newtag description">
92     <label class="description">Description:</label>
93     <textarea name="description" rows="4">$description</textarea>
94   </fieldset>
95   <input type="submit" value="Edit!">
96   <input type="submit" name="trash" value="Delete Video">
97
98   <a class="panel toggle" href="#foot">Hide</a>
99 </form>
100
101 <div class="panel bottom" id="foot">
102   <a class="panel toggle" href="#tagger">Edit Tags</a>
103 </div>
104 EOF
105
106 # vi:set filetype=html: