]> git.plutz.net Git - serve0/blobdiff - templates/view.html.sh
tidying up html structures
[serve0] / templates / view.html.sh
index c17284b23acf5a94689f96c179b723733c290dd9..e622658c0bc83684036486bfbd80376e43fe1566 100755 (executable)
-#!/bin/zsh
-
-cat <<viewEND
-  <div class="panel" id="videoview">
-    <span style="float:right;"><a href="#" onclick="javascript:hide_block('videoview');" class="panel">Dismiss</a></span>
-    <div class="video">
-      <a href="$video">Full</a> <!-- a href="$reenc">Mobile</a --><br>
-      <!--iframe src="$video" width="100%" height="400px"-->
-      <video controls>
-        <!-- source src="$reenc" type='video/webm; codecs="vp8.0, mp3"' -->
-       <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
-      </video><!--/iframe-->
-    </div>
-  
-    <div class="videoinfo" id="viewmeta">
-      <b>$info</b><a class="panel" href="#" onclick="javascript:hide_inline('viewmeta');show_inline('editmeta')">Edit</a><br>
-      <span class="coord">$(($length / 60)):$(($length % 60)) min</span>
-      <span class="coord">Width: $width</span><span class="coord">Height: $height</span><br>
-      <br><br>Tags:<span class="tag">$(sed 's,|$,,;s,|,</span> <span class="tag">,g' <<<"$tags")</span>
-      <br><br>$(_wiki <<<"$description")
-    </div>
-  
-    <div class="videoinfo" id="editmeta" style="display: none;">
-      <form action="meta.cgi?$info" method="post" accept-charset="UTF-8">
-        <input type="hidden" name="f" value="$filter"> <input type="hidden" name="s" value="$search"> <input type="hidden" name="p" value="$page">
-        <input type="hidden" name="length" value="$length"> <input type="hidden" name="width" value="$width">
-        <input type="hidden" name="height" value="$height">
-        <b>$info</b><a class="panel" href="#" onclick="javascript:hide_inline('editmeta');show_inline('viewmeta')">Cancel</a><br>
-        <span class="coord">$(($length / 60)):$(($length % 60)) min</span>
-        <span class="coord">Width: $width</span><span class="coord">Height: $height</span><br><br>
-  
-        <div>
-          Tags:<br>
-          <select name="tag" size="16" multiple>
-            $(echo "$taglist" |while read line; do
-              echo "<option $(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && echo -n selected)>$line</option>"
-            done)
-          </select><br>
-        </div><div>
-          Additional Tags (one per line):<br>
-          <textarea name="tags" rows="16" style="width: 99%"></textarea><br><br>
-        </div>
-        Description:<br>
-        <textarea name="description" rows="4" style="width: 99%">$description</textarea><br>
-        <input type="submit" value="Submit">
-        <input type="submit" name="trash" value="Delete Video">
-        <!-- input type="submit" name="cancel" value="Cancel" -->
-      </form>
+# 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
+<form class="panel" id="search" style="display: block;" action="?" method="get" accept-charset="UTF-8">
+  <input type="text" name="s" value="$search" placeholder="Search">
+
+  <label for="o1" class="order">Order by:</label>
+  <select class="order" size="1" name="o" id="o1">
+    <option>Name</option>
+    <option>Date</option>
+    <option>Length</option>
+  </select>
+  <input type="submit" name="submit" value="Find">
+
+  <a class="panel clearsearch" href="?">Clear All</a>
+  <a class="panel advanced show" href="?p=filter">Advanced</a>
+
+  <div class="pagination_nav">
+    <label>Page:</label>
+    <a href="?p=view&amp;${page_prev}">&lt;&lt;</a>
+    <a href="?p=view&amp;${page_this}">$(($page + 1))</a>
+    <a href="?p=view&amp;${page_next}">&gt;&gt;</a>
+  </div>
+</form>
+
+<div class="panel" id="videoview">
+  <a href="?p=list&amp;${page_this}" class="panel">Dismiss</a>
+    <h1>$info</h1>
+
+  <div class="video">
+    <a href="$video">Full</a>
+    <video controls>
+      <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
+    </video>
+  </div>
+
+  <div class="tabcontainer">
+    <input type="radio" class="tabhandle" name="viewmode" value="view" id="viewmeta" checked>
+    <div class="videoinfo tabcontent">
+      <label class="meta edit" for="editmeta">Edit</label>
+
+      <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
+      <span class="info width" >Width: $width</span>
+      <span class="info height">Height: $height</span><br>
+
+      <label class="tags">Tags:</label>
+      $(echo "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
+      ${description:+<span class="info description">$(echo -E "$description" |_wiki)</span>}
     </div>
   </div>
-viewEND
 
-# vi:set filetype=html:
+  <div class="tabcontainer">
+    <input type="radio" class="tabhandle" name="viewmode" value="edit" id="editmeta">
+    <form class="videoinfo tabcontent" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
+      <label class="meta cancel" for="viewmeta">Cancel Edit</label>
+
+      <input type="hidden" name="length" value="$length">
+      <input type="hidden" name="width" value="$width">
+      <input type="hidden" name="height" value="$height">
+
+      <span class="info length">$(($length / 60)):$(($length % 60)) min</span>
+      <span class="info width" >Width: $width</span>
+      <span class="info height">Height: $height</span>
+
+      <span class="label tags">Tags:</span>
+      <select class="edit tags" name="tag" size="16" multiple>
+        $(echo "$taglist" |while read line; do
+          echo "<option $(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && echo -n selected)>$line</option>"
+        done)
+      </select>
+
+      <label class="moretags">Additional Tags (one per line):</label>
+      <textarea class="edit moretags" name="tags" rows="4"></textarea>
+
+      <label class="description">Description:</label>
+      <textarea class="edit description" name="description" rows="4">$description</textarea>
 
+      <input type="submit" value="Submit">
+      <input type="submit" name="trash" value="Delete Video">
+      <!-- input type="submit" name="cancel" value="Cancel" -->
+    </form>
+  </div>
+</div>
+
+<form>
+  <ul id="thumblist">
+    $(thumblist)
+  </ul>
+</form>
+
+<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>
+EOF
+
+# vi:set filetype=html: