]> git.plutz.net Git - serve0/blob - templates/tagger.html.sh
styling for pagination links
[serve0] / templates / tagger.html.sh
1 # Copyright 2014, 2015, 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 category_options(){
19   cat="${1}:"
20   [ "$cat" = "none:" ] && cat=''
21
22   printf %s "$taglist_set" \
23   | sed -rn 's;^('"$cat"')([^:]+)$;<option value="\1\2">\2</option>;p'
24 }
25
26 category_box(){
27   for cat in "$@"; do
28   cat <<EOF
29   <fieldset class="newtag">
30     <label class="category">${cat}:</label>
31     <input type="hidden" name="category" value="$cat">
32     <select name="ctag" size="12" multiple>
33       $(category_options "$cat")
34     </select>
35   </fieldset>
36 EOF
37   done
38 }
39
40 cat <<EOF
41   <div class="panel switchable bottom" id="tagger">
42     <p class="help">Add selectetd tags to selected videos.</p>
43     $(category_box $(list_categories))
44     <fieldset class="newtag additional">
45       <label class="additional">Additional Tags (one per line):</label>
46       <textarea name="tags" rows="2"></textarea>
47     </fieldset>
48     <input type="submit" value="Add Tags!">
49
50     <a class="panel toggle" href="#foot">Hide</a>
51   </div>
52 EOF
53
54 # vi:set filetype=html: