]> git.plutz.net Git - serve0/commitdiff
merged filter and list page
authorpaul <paul@plutz.net>
Wed, 29 Jul 2015 16:05:21 +0000 (16:05 +0000)
committerpaul <paul@plutz.net>
Wed, 29 Jul 2015 16:05:21 +0000 (16:05 +0000)
svn path=/trunk/; revision=64

pages/filter.sh [deleted file]
pages/list.sh
templates/advfilter.html.sh [moved from templates/filter.html.sh with 91% similarity]
templates/common.css.sh
templates/list.html.sh
templates/tagger.html.sh [new file with mode: 0755]

diff --git a/pages/filter.sh b/pages/filter.sh
deleted file mode 100755 (executable)
index 9f7483c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/zsh
-
-# Copyright 2014, 2015 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/>. 
-
-. $_EXEC/pages/common.sh
-
-filters="$(echo -E "$_GET[\"f\"]" |sed -r 's;^!*\^*;;; s;\^*!*$;;; s;!+;!;g; s;\^+;^;g')"
-debug "FILTERS: $filters"
-
-case "$1" in
-  title)
-    echo "Videos"
-  ;;
-  css)
-    . ${_EXEC}/templates/common.css.sh
-  ;;
-  body)
-    . ${_EXEC}/templates/filter.html.sh
-  ;;
-esac
index 34b43398a39e1dd2c56846432cd78e7b0f263465..f970a32be1d45f6be8f114771df4fbc444fe027e 100755 (executable)
@@ -19,6 +19,9 @@
 
 . $_EXEC/pages/common.sh
 
+filters="$(echo -E "$_GET[\"f\"]" |sed -r 's;^!*\^*;;; s;\^*!*$;;; s;!+;!;g; s;\^+;^;g')"
+debug "FILTERS: $filters"
+
 case "$1" in
   title)
     echo "Videos"
similarity index 91%
rename from templates/filter.html.sh
rename to templates/advfilter.html.sh
index 86d5b2b16bb79fbd6add2e5428a1f1cbc4eae29c..80ec4c268bc3e66d98e6dc200db541a95db6512d 100755 (executable)
@@ -28,7 +28,7 @@ cat <<EOF
     <input disabled type="submit" name="submit" value="Find">
 
     <a class="panel clearsearch" href="?">Clear All</a>
-    <a class="panel advanced hide" href="?p=list&${page_this}">Hide</a>
+    <a class="panel advanced hide" href="#">Hide</a>
     <hr>
 
     <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>
@@ -104,21 +104,6 @@ cat <<EOF
       )
     </p>
   </form>
-
-  <form>
-    <ul id="thumblist">
-      $(thumblist)
-    </ul>
-
-    <div class="panel footer" id="foot">
-      <div class="pagination_nav">
-        <label>Page:</label>
-        <a href="?${page_prev}">&lt;&lt;</a>
-        <a href="?${page_this}">$(($page + 1))</a>
-        <a href="?${page_next}">&gt;&gt;</a>
-      </div>
-    </div>
-  </form>
 EOF
 
 # vi:set filetype=html:
index c9ca3514316625f5f6f3015a983b01c2942e8d5b..02d02f3c45815d47680abf2b7175d70b3856be87 100755 (executable)
@@ -180,6 +180,13 @@ a.clearsearch, a.advanced, a.tagger, .pagination_nav {
   margin: .75em .5em;
 }
 
+#advfilter { display: none; }
+#advfilter:target {
+  display: block;
+  position: absolute;
+  top: 0;
+}
+
 #tagger { display: none; }
 #tagger:target { display: block; z-index: 1; }
 .footer {
index eed4fef9312fc42868d48cd505a5713f17646020..ca875df4c0342a1c6576b29d740e7a17ecc61cd4 100755 (executable)
@@ -29,7 +29,7 @@ cat <<EOF
     <input type="submit" name="submit" value="Find">
 
     <a class="panel clearsearch" href="?">Clear All</a>
-    <a class="panel advanced show" href="?p=filter&${page_this}">Advanced</a>
+    <a class="panel advanced show" href="#advfilter">Advanced</a>
 
     <div class="pagination_nav">
       <label>Page:</label>
@@ -39,36 +39,13 @@ cat <<EOF
     </div>
   </form>
 
+  $(. $_EXEC/templates/advfilter.html.sh)
+
   <form action="?action=multitag&${page_this}" method="post" accept-charset="UTF-8">
     <ul id="thumblist">
       $(thumblist)
     </ul>
-
-    <div class="panel footer" id="tagger">
-      <a class="panel tagger hide" href="#foot">Hide</a>
-      <hr>
-      <p class="help">Add selectetd tags to selected videos.</p>
-      <p class="newtag">
-        <label class="category">None:</label>
-        <select name="ctag" size="12" multiple id="${n}_none">
-         $(echo "$taglist" |sed -rn 's;^([^:]+)$;<option value="\1">\1</option>;p')
-        </select>
-      </p>
-      $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;\1;p' |sort -u |while read cat; do echo "
-      <p class=\"newtag\">
-        <label class=\"category\">${cat}:</label>
-        <input type=\"hidden\" name=\"category\" value=\"$cat\">
-        <select name=\"ctag\" size=\"12\" multiple id=\"${n}_$cat\">
-         $(echo "$taglist" |sed -rn "s;^${cat}:(.*)$;<option value=\"${cat}:\\1\">\\1</option>;p")
-        </select>
-      </p>"
-      done)
-      <p class="newtag additional">
-        <label class="additional">Additional Tags (one per line):</label>
-        <textarea name="tags" rows="2"></textarea>
-      </p>
-      <input type="submit" value="Add Tags!">
-    </div>
+    $($_EXEC/templates/tagger.html.sh)
   </form>
 
   <div class="panel footer" id="foot">
diff --git a/templates/tagger.html.sh b/templates/tagger.html.sh
new file mode 100755 (executable)
index 0000000..10e657c
--- /dev/null
@@ -0,0 +1,46 @@
+# Copyright 2014, 2015 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/>. 
+
+cat <<EOF
+  <div class="panel footer" id="tagger">
+    <a class="panel tagger hide" href="#foot">Hide</a>
+    <hr>
+    <p class="help">Add selectetd tags to selected videos.</p>
+    <p class="newtag">
+      <label class="category">None:</label>
+      <select name="ctag" size="12" multiple id="${n}_none">
+       $(echo "$taglist" |sed -rn 's;^([^:]+)$;<option value="\1">\1</option>;p')
+      </select>
+    </p>
+    $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;\1;p' |sort -u |while read cat; do echo "
+    <p class=\"newtag\">
+      <label class=\"category\">${cat}:</label>
+      <input type=\"hidden\" name=\"category\" value=\"$cat\">
+      <select name=\"ctag\" size=\"12\" multiple id=\"${n}_$cat\">
+       $(echo "$taglist" |sed -rn "s;^${cat}:(.*)$;<option value=\"${cat}:\\1\">\\1</option>;p")
+      </select>
+    </p>"
+    done)
+    <p class="newtag additional">
+      <label class="additional">Additional Tags (one per line):</label>
+      <textarea name="tags" rows="2"></textarea>
+    </p>
+    <input type="submit" value="Add Tags!">
+  </div>
+EOF
+
+# vi:set filetype=html: