[xiph-commits] r3939 - arkaiv/trunk/arkaiv/templates

dcrowdy at svn.annodex.net dcrowdy at svn.annodex.net
Fri May 29 17:44:43 PDT 2009


Author: dcrowdy
Date: 2009-05-29 17:44:42 -0700 (Fri, 29 May 2009)
New Revision: 3939

Added:
   arkaiv/trunk/arkaiv/templates/collectionsadmin.mak
   arkaiv/trunk/arkaiv/templates/displayitemadmin.mak
Log:
Additional templates for admin users


Added: arkaiv/trunk/arkaiv/templates/collectionsadmin.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/collectionsadmin.mak	                        (rev 0)
+++ arkaiv/trunk/arkaiv/templates/collectionsadmin.mak	2009-05-30 00:44:42 UTC (rev 3939)
@@ -0,0 +1,22 @@
+<%inherit file="/autohandler"/> 
+<h2>
+Collections
+</h2>
+
+% for coll in c.collections:
+<li>
+    ${ h.link_to(coll['name'], h.url_for(action="displaycollection", edit="no", id=coll['index'], name=coll['name'])) }
+${ h.form(h.url_for(action='deletecollection', id=coll['index']), multipart=True) } 
+Delete collection:
+${ h.submit('Delete') } 
+${ h.end_form() } 
+</li>
+% endfor
+
+<hr>
+Add new collection:
+${ h.form(h.url_for(action='addcollection'), multipart=True) } 
+${ h.text_field('newcollection') }
+${ h.submit('Add') } 
+${ h.end_form() } 
+

Added: arkaiv/trunk/arkaiv/templates/displayitemadmin.mak
===================================================================
--- arkaiv/trunk/arkaiv/templates/displayitemadmin.mak	                        (rev 0)
+++ arkaiv/trunk/arkaiv/templates/displayitemadmin.mak	2009-05-30 00:44:42 UTC (rev 3939)
@@ -0,0 +1,284 @@
+<%inherit file="/autohandler"/> 
+
+<div id="video">
+
+## Title of item and script to change name
+<p id="edititemname">${c.itemname}</p>
+<script type="text/javascript">
+ new Ajax.InPlaceEditor('edititemname', '/item/edititemname', { callback: function(form, value) { return 'itemid=${c.itemid}&myparam=' + escape(value) }});
+</script>
+
+## Or delete it...
+${ h.form(h.url_for(action='deleteitem'), multipart=True) }
+${ h.submit('Delete') } 
+${ h.hidden_field('itemid', value=c.itemid) }
+${ h.end_form() } 
+ 
+
+%     if c.sourcedict['has_video'] == "Yes":
+<video src='${c.sourcedict['urlpath']}${c.sourcedict['clipdetail']}' controls='controls' ontimeupdate="Updatetime()" width=320 height=240></video>
+%     endif
+
+%     if c.sourcedict['has_video'] == "No":
+<audio src='${c.sourcedict['urlpath']}${c.sourcedict['clipdetail']}' controls='controls' ontimeupdate="Updatetime()"></audio>
+%     endif
+
+
+<form name="api">
+<table style="font-size:small">
+<tr>
+<td>Time:</td>
+<td><input name="tfield" cols="8"></textarea></td>
+<td>Go to:</td>
+<td><input name="gfield" cols="6" onchange='Gototime("${c.sourcedict['urlpath']}?t=")'></textarea></td>
+</tr>
+##Output area useful for debugging:
+##<tr>
+##<td>Output:</td>
+##<td><textarea name="ofield" cols="40" rows="2"></textarea></td>
+##</tr>
+</table>
+</form>
+
+##Header info - should really only be editable by priveleged users
+<hr>
+Head:
+${ h.form(h.url_for(controller='item', action='editheadinfo'), multipart=True) }
+id:
+${ h.text_field('headid', value=c.headdict['id']) }
+Title:
+${ h.text_field('headtitle', value=c.headdict['title']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+
+${ h.submit('Edit') } 
+${ h.end_form() } 
+<br />
+<hr>
+
+Meta information:<br />
+<table style="font-size:small">
+<tr>
+  <td>Name</td>
+  <td>Content</td>
+</tr>
+% for metainfo in c.metalist:
+<tr>
+<td>
+<p id="editmetaname">${metainfo['name']}</p>
+<script type="text/javascript">
+ new Ajax.InPlaceEditor('editmetaname', '/item/editheadmetaname', { callback: function(form, value) { return 'id=${metainfo['id']}&field=name&itemid=${c.itemid}&myparam=' + escape(value) }});
+</script>
+</td>
+<td>
+<p id="editmetacontent">${metainfo['content']}</p>
+<script type="text/javascript">
+ new Ajax.InPlaceEditor('editmetacontent', '/item/editheadmetaname', { callback: function(form, value) { return 'id=${metainfo['id']}&field=content&itemid=${c.itemid}&myparam=' + escape(value) }});
+</script>
+</td>
+<td>
+${ h.form(h.url_for(action='deletemeta'), multipart=True) }
+${ h.submit('Delete') }
+${ h.hidden_field('metaid', value=metainfo['index']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+${ h.hidden_field('headid', value=c.headdict['index']) }
+${ h.end_form() } 
+
+</td>
+</tr> 
+% endfor
+</table>
+<hr>
+Add new meta tag:
+${ h.form(h.url_for(action='addmetainfo'), multipart=True) }
+<table style="font-size:small">
+<tr>
+    <td>Id</td>
+    <td>Name</td>
+    <td>Content</td>
+</tr>
+
+<tr>
+  <td>${ h.text_field('metaid', size=5) }</td>
+  <td>${ h.text_field('metaname') }</td>
+  <td>${ h.text_field('metacontent') }</td>
+</tr>
+</table>
+${ h.hidden_field('metascheme') }
+${ h.hidden_field('headindex', value = c.headdict['index']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+
+${ h.submit('Add') } 
+${ h.end_form() } 
+
+<hr>
+
+
+<!--div class="sourceinfo"-->
+<table style="font-size:small">
+<tr>
+<td>Duration:</td><td> ${c.sourcedict['duration']}</td>
+</tr>
+<tr>
+<td>Bitrate: </td><td>${c.sourcedict['bitrate']}</td>
+</tr>
+<tr>
+<td>Resolution: </td><td>${c.sourcedict['resolution']}</td>
+</tr>
+<tr>
+<td>Framerate: </td><td>${c.sourcedict['framerate']}</td>
+</tr>
+<tr>
+<td>Audio: </td><td>${c.sourcedict['audio']}</td>
+</tr>
+<tr>
+<td>Has video: </td><td>${c.sourcedict['has_video']}</td>
+</tr>
+<tr>
+<td>Has audio: </td><td>${c.sourcedict['has_audio']}</td>
+</tr>
+</table>
+
+
+
+</div>
+
+<table style="font-size:small">
+<tr>
+  <td></td>
+  <td>Time</td>
+  <td></td>
+  <td></td> 
+</tr>
+
+% for clipinfo in c.cliplist:
+<tr>
+%  if c.sourcedict['has_video'] == "Yes":
+%    if clipinfo['end_time'] == 0:
+   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}")'><img src="${c.sourcedict['clipimageurl']}${clipinfo['img_src']}"></a></td>
+  %   else:
+   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}/${clipinfo['end_time']}")'><img src="${c.sourcedict['clipimageurl']}${clipinfo['img_src']}"></a></td>
+ %     endif
+%  endif
+
+ %  if c.sourcedict['has_video'] == "No":
+ %    if clipinfo['end_time'] == 0:
+   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}")'><img src="/images/blank.png"></a></td>
+  %   else:
+   <td><a onclick='ClipPlay("${c.sourcedict['urlpath']}?t=${clipinfo['id']}/${clipinfo['end_time']}")'><img src="/images/blank.png"></a></td>
+ %     endif
+%  endif
+
+    <td>${clipinfo['start_time']}</td>
+    <td>${clipinfo['desc']}</td>
+    <td>${clipinfo['a_href']}</td>
+
+${ h.form(h.url_for(action='deleteclip'), multipart=True) }
+<td>${ h.submit('Delete') } </td>
+${ h.hidden_field('clipid', value=clipinfo['ixc']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+${ h.end_form() } 
+
+</tr> 
+% endfor
+</table>
+
+Add new clip:
+<!--${ h.form(h.url_for(action='addclip'), multipart=True) }-->
+<form name="addaclip" action="addclip" >
+<table style="font-size:small">
+<tr>
+    <td>Start</td>
+  <td>${ h.text_field('starttime', size=5) }</td>
+</tr>
+<tr>
+<tr>
+    <td>End</td>
+  <td>${ h.text_field('endtime', size=5) }</td>
+</tr>
+<td>Desc</td>
+  <td>
+  <input type="text" name="desc" size="20" onfocus="disableShortcuts()" onblur="enableShortcuts()" id="desc" />
+  <!--${ h.text_field('desc') }--></td>
+</tr>
+<tr>
+    <td>a_text</td>
+  <td>${ h.text_field('a_text') }</td>
+</tr>
+<tr>
+    <td>a_href</td>
+  <td>${ h.text_field('a_href') }</td>
+</tr>
+</table>
+${ h.hidden_field('headindex', value = c.headdict['index']) }
+${ h.hidden_field('itemid', value=c.itemid) }
+${ h.hidden_field('hasvideo', value=c.sourcedict['has_video']) }
+${ h.submit('Add') } 
+${ h.end_form() } 
+
+
+<script>
+
+var output = document.api.ofield;
+var toutput = document.api.tfield;
+var gototime = document.api.gfield;
+var myVideo = document.getElementsByTagName('video')[0];
+var myAudio = document.getElementsByTagName('audio')[0];
+
+if (myAudio) {
+//  addOutput("Audio");
+  myMedia = myAudio;
+}
+else {
+//  addOutput("Video");
+  myMedia = myVideo;
+}
+
+v.addEventListener("seeked", function() { document.getElementsByTagName("video")[0].play(); }, true);
+
+function ClipPlay(location) {
+  myMedia.src = location
+  myMedia.load();
+  myMedia.play();
+  //addOutput("Audio clip");
+}
+
+function Updatetime() {
+  addToutput(myMedia.currentTime);
+}
+
+function addToutput(str) {
+  toutput.value = str;
+}
+
+function Gototime(location) {
+  t = getGoto();
+//  addOutput(location + t);
+  myMedia.src = location + t;
+  myMedia.load();
+  myMedia.play();
+}
+
+function getGoto() {
+  i = parseInt(gototime.value);
+  return isNaN(i) ? 0 : i;
+}
+
+var outLines = 0;
+
+function addOutput(str) {
+  if (outLines == 0) {
+    output.value = str;
+  } else {
+    output.value = str + "\n" + output.value;
+  }
+  outLines++;
+  if (outLines == 11) {
+    i = output.value.lastIndexOf("\n");
+    output.value = output.value.substr(0, i);
+    outLines--;
+  }
+
+}
+</script>
+
+



More information about the commits mailing list