]> git.plutz.net Git - serve0/blobdiff - templates/view.html.sh
enable remote controls for server display
[serve0] / templates / view.html.sh
index 49439587ba27fe45a255f5e3657a913ac554f464..7a89a9ec31666cc2104dbbe9ea287b1f4bf4149b 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
 #
 # This file is part of Serve0
 # 
 # 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">
+<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">
+  <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="?page=filter">Advanced</a>
+  <a class="panel clearsearch" href="?">Clear All</a>
+  <a class="panel" href="${info:+?p=list&amp;${page_this}#$(urlsave $info)}${info:-?p=tree&amp;d=${directory}&amp;${page_this}}">Dismiss</a>
 
-    <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>
-  </form>
+  <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="?page=list" class="panel">Dismiss</a>
-    <div class="video">
-      <a href="$video">Full</a>
-      <video controls>
-       <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
-      </video>
-    </div>
-  
-    <div class="videoinfo" id="viewmeta">
-      <h2>$info</h2>
-      <a class="meta edit" href="#" onclick="javascript:hide('viewmeta');show_iblock('editmeta')">Edit</a>
+<div id="videoview">
+  <h1>$info</h1>
 
-      <span class="info property">$(($length / 60)):$(($length % 60)) min</span>
-      <span class="info property">Width: $width</span>
-      <span class="info property">Height: $height</span><br>
+  <a href="$video">Download</a>
+  <video autoplay controls>
+    <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
+  </video>
 
-      <span class="label tags">Tags:</span>
-      $(echo "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
-      $([ -n "$description" ] && echo "<span class=\"info description\">$(_wiki <<<"$description")</span>")
-    </div>
+  <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>
   
-    <form class="videoinfo" id="editmeta" style="display: none;"
-          action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
-      <input type="hidden" name="length" value="$length">
-      <input type="hidden" name="width" value="$width">
-      <input type="hidden" name="height" value="$height">
+  <label class="tags">Tags:</label>
+  $(printf %s\\n "$tags" |sed -r 's:\|*([^|]+)\|*:<span class="info tag">\1</span>:g')
+  ${description:+<span class="info description">$(printf %s "$description" |_wiki)</span>}
 
-      <h2>$info</h2>
-      <a class="meta cancel" href="#" onclick="javascript:hide('editmeta');show_iblock('viewmeta')">Cancel</a>
+  <form class="panel" id="tagger" action="?action=meta&${page_this}" method="post" accept-charset="UTF-8">
+    <input type="hidden" name="length" value="$length">
+    <input type="hidden" name="width" value="$width">
+    <input type="hidden" name="height" value="$height">
 
-      <span class="info property">$(($length / 60)):$(($length % 60)) min</span>
-      <span class="info property">Width: $width</span>
-      <span class="info property">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>
+    $(
+    for cat in $(list_categories); do
+      printf '<p class="newtag"><label class="category">%s:</label><select name="tag" size="12" multiple>' "${cat}"
+      catt="${cat}:"
+      [ "$catt" = "none:" ] && catt=''
+      
+      printf %s "$taglist" |egrep '^'"$catt"'[^:]+$' |while read line; do
+        printf '<option %s value="%s">%s</option>' \
+               "$(egrep -q "(^|.*\|)$line(\|.*|$)" "$meta" && printf selected)" \
+               "$line" "${line#*:}"
+      done
+      printf '</select></p>'
+    done
+    )
 
-      <span class="label moretags">Additional Tags (one per line):</span>
-      <textarea class="edit moretags" name="tags" rows="4"></textarea>
+    <p class="newtag additional">
+      <label class="additional">Additional Tags (one per line):</label>
+      <textarea name="tags" rows="4"></textarea>
+    </p>
+    <p class="newtag description">
+      <label class="description">Description:</label>
+      <textarea name="description" rows="4">$description</textarea>
+    </p>
+    <input type="submit" value="Edit!">
+    <input type="submit" name="trash" value="Delete Video">
 
-      <span class="label description">Description:</span>
-      <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>
+    <a class="panel toggle" href="#foot">Hide</a>
 
-  <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>
+</div>
+
+<div class="panel footer" id="foot">
+  <a class="panel toggle" href="#tagger">Edit Tags</a>
+
+  <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: