+++ /dev/null
-# Copyright 2014 - 2016 Paul Hänsch
-#
-# This file is part of Serve0
-#
-# Serve0 is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Serve0 is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with Serve0 If not, see <http://www.gnu.org/licenses/>.
-
-category_tabs(){
- for cat in "$@"; do
- cat <<EOF
- <div class="tab">
- <input class="tabhandle" type="radio" name="category$n" id="cat${n}_$cat" value="$cat" $([ "$cat" = "$fcat" ] && printf checked)>
- <label class="category tabhandle" for="cat${n}_$cat">$([ "$cat" = none ] && printf %s general || printf %s "$cat")</label>
- <select class="category tabcontent" class="input tagfilter" name="cfilter${n}_" size="12" multiple>
- $(category_selected "$cat" "$filter")
- </select>
- </div>
-EOF
- done
-}
-
-filterbox(){
- for n in "$@"; do
- filter="$(printf '%s^' "$filters" |cut -d^ -f$(($n+1)))"
- fneg="${filter%%[a-zA-Z]*}"
- filter="${filter#!}"
- fcat="${filter%%:*}"
- [ "$fcat" = "$filter" ] && fcat=none
-
- debug "fneg: $fneg fcat: $fcat filter: $filter"
-
- cat <<-EOF
- <input class="tabhandle" type="checkbox" id="filter$n" $([ $n = 0 -o -n "$filter" ] && printf checked) >
- <label class="tabhandle filter" for="filter$n">+ and</label>
- <fieldset class="tabcontent filter">
- <input type="radio" name="type$n" value="pos" id="pos$n" ${fneg:-checked} ><label for="pos$n" class="conjunction">Any</label>
- <input type="radio" name="type$n" value="neg" id="neg$n" ${fneg:+checked} ><label for="neg$n" class="conjunction">None</label>
- <span class="help">of the items selected here:</span>
-
- <label class="category">Category:</label>
- <div class="category tabcontainer">
- $(category_tabs $(list_categories) )
- </div>
- </fieldset>
- EOF
- done
-}
-
-cat <<EOF
- <form class="panel switchable top" id="advfilter"
- action="?action=filter" method="post" accept-charset="UTF-8">
-
- <a class="panel toggle" href="#">Hide</a>
- <a class="panel" href="?p=quicklinks">Most recent</a>
-
- <p class="help">Up to <strong>10</strong> filter boxes will appear as you start selecting tags. You can select <strong>multiple</strong> tags in each box by holding down the <strong>Ctrl</strong>-key. Click the "<strong>Filter!</strong>" button when you are ready.</p>
- $(filterbox {0..9})
-
- <fieldset class="filter final">
- <label for="o3" class="order">Order by:</label>
- <select class="edit order" size="1" name="o" id="o3">
- <option $([ "${_GET[o]}" = Name ] && printf selected) >Name</option>
- <option $([ "${_GET[o]}" = Date ] && printf selected) >Date</option>
- <option $([ "${_GET[o]}" = Length ] && printf selected) >Length</option>
- </select>
- <input type="submit" value="Filter!">
- </fieldset>
- </form>
-EOF
-
-# vi:set filetype=html: