]> git.plutz.net Git - serve0/commitdiff
improved embedded view and tag editing
authorpaul <paul@plutz.net>
Wed, 20 Jan 2016 12:21:01 +0000 (12:21 +0000)
committerpaul <paul@plutz.net>
Wed, 20 Jan 2016 12:21:01 +0000 (12:21 +0000)
svn path=/trunk/; revision=99

pages/view.sh
templates/common.css.sh
templates/view.html.sh

index 97b8e37ea672b98e18e69666e47cdf59e8402895..689d6c1e3f8c8f2fc3ddb068dfbb7130c74db0ba 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
 #
 # This file is part of Serve0.
 # 
@@ -17,8 +17,7 @@
 # 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/list.sh
-. $_EXEC/pages/tree.sh
+. $_EXEC/pages/common.sh
 
 info="${_GET[i]}"
 location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)"
index cfc84e7420cb174e62957075c7e9a8cf7d28d58e..adf78cda75d66ba7cabd06f78535e7a01d88b8a7 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
 #
 # This file is part of Serve0
 # 
@@ -289,41 +289,14 @@ a.panel {
 }
 .panel#preferences > input { display: block; }
 
-#videoview a.panel {
-  position: absolute;
-  right: 1em;
-  width: auto;
-  border: none;
-}
-#videoview .video {
+#videoview h1, #videoview > a {
   display: inline-block;
-  width: 60%;
-  vertical-align: top;
-}
-#videoview .video * {
-  display: block;
-}
-#videoview .videoinfo {
-  width: 39%;
-  margin-top: 2em;
+  margin-right: 1em;
 }
-#videoview .videoinfo h2 {
-  display: inline;
-} 
-#videoview .videoinfo .meta:after {
-  content: "\A";
-  white-space: pre;
-}
-#videoview .videoinfo .label {
-  display: block;
-  margin-top: 1em;
-}
-#videoview .videoinfo .info.description {
+#videoview video {
   display: block;
-  background-color: #DDF;
-}
-#videoview .videoinfo .edit {
-  width: 100%
+  margin: 0;
+  width: 100%;
 }
 EOF
 
index c92db05282b050f857975d8bdd8deba0f9d063f1..85f3e9ad9a48ea0b9870fe33effcbbfab5e6c5ba 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
 #
 # This file is part of Serve0
 # 
@@ -28,7 +28,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">Advanced</a>
+  <a class="panel" href="${info:+?p=list&amp;${page_this}}${info:-?p=tree&amp;d=${directory}&amp;${page_this}}">Dismiss</a>
 
   <div class="pagination_nav">
     <label>Page:</label>
@@ -38,72 +38,61 @@ cat <<EOF
   </div>
 </form>
 
-<div class="panel" id="videoview">
-  <a href="${info:+?p=list&amp;${page_this}}${info:-?p=tree&amp;d=${directory}&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>
-
-  <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>
-
+<div id="videoview">
+  <h1>$info</h1>
+
+  <a href="$video">Download</a>
+  <video autoplay controls>
+    <source src="$video" type='video/mp4; codecs="avc1.4D401E, mp3"'>"
+  </video>
+
+  <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>}
+
+  <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">
+
+    $(
+    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
+    )
+
+    <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 class="edit description" name="description" rows="4">$description</textarea>
+      <textarea name="description" rows="4">$description</textarea>
+    </p>
+    <input type="submit" value="Edit!">
+    <input type="submit" name="trash" value="Delete Video">
 
-      <input type="submit" value="Submit">
-      <input type="submit" name="trash" value="Delete Video">
-      <!-- input type="submit" name="cancel" value="Cancel" -->
-    </form>
-  </div>
-</div>
+    <a class="panel toggle" href="#foot">Hide</a>
 
-<form>
-  <ul id="thumblist">
-    $([ -n "$info" ] && thumblist || filelist)
-  </ul>
-</form>
+  </form>
+</div>
 
 <div class="panel footer" id="foot">
+  <a class="panel toggle" href="#tagger">Add Tags</a>
+
   <div class="pagination_nav">
     <label>Page:</label>
     <a href="?${page_prev}">&lt;&lt;</a>