File:  [Repository] / cdli / zpt / CDLIFileFolderMain.zpt
Revision 1.6: download - view: text, annotated - select for diffs - revision graph
Sun Mar 19 03:27:21 2006 UTC (18 years, 2 months ago) by dwinter
Branches: MAIN
CVS tags: HEAD
bug fixes and some new features

<html metal:use-macro="here/main_template/macros/page">
  <tal:block metal:fill-slot="body" tal:define="options here/REQUEST">
  <h2>CDLI File Storage - <span tal:content="here/title"/></h2>

  <tal:x tal:condition="python:options.get('basketName',None)">
<table width="100%">
  <tr class="old"> 
    <td>
      <span tal:replace="python:options['numberOfObjects']"/> Objects stored in
      <span tal:replace="python:options['basketName']"/>.
    </td>
  </tr>
</table>

</tal:x>
 <tal:x condition="python:here.REQUEST.get('uploaded',None)">
 <table width="100%" bgcolor="%FF0000">
 <tr class="old">
 	<td>New version of <span tal:replace="python:here.REQUEST.get('uploaded',None)"/> added</td>
 </tr>
 </table>
 </tal:x>
  <span tal:replace="structure here/header_html"/>
  <a tal:condition="here/hasParent" 
  tal:attributes="href python:here.aq_parent.absolute_url()"
  tal:content="python:'back (%s)'%here.aq_parent.title">back</a>
  <hr>
  <tal:block tal:define="folders python:here.getFolders()" tal:condition="python:len(folders)>0">
  <h3>Subfolder</h3>
  <table>
  <tr tal:repeat="folder folders">
  <td><a tal:content="python:folder[0].title" tal:attributes="href python:folder[0].absolute_url()"/></td>
  <td tal:content="python:'( folder: %s)'% folder[1]"/>
  <td tal:content="python:'( files: %s)'% folder[2]"/>
  </tr>
  </table>
  <hr>
  </tal:block>

 <form>
  <script type="text/javascript">
<!-- 


isSelected=false

function toggleSelect() {
addBasket=document.getElementById('addBasket')
selectButton=document.getElementById('selectButton')

  
  if (isSelected == false) {

    for (i = 0; i < addBasket.length-1; i++)
   
      addBasket.elements[i].checked = true ;
      
    
      isSelected = true;

      selectButton.value = "Deselect All";
      return isSelected;
  }
  else {

    for (i = 0; i < addBasket.length+1; i++)
      addBasket.elements[i].checked = false ;
      isSelected = false;
      selectButton.value = "Select All";
      return isSelected;       
  }
}

//-->
</script>
  <input class="space_right" type="submit" id="selectButton" value="Select All" onClick="toggleSelect(); return false">
</form>
  <tal:block tal:define="sortField python:here.REQUEST.get('sortField','title');
  					    versions python:here.getVersionedFiles(sortField=sortField)">
  					   
  <form id="addBasket" tal:condition="python:len(versions)>0"  action="basketContainer/storeInBasket">
  <input name="submit" type="submit" value="store in active basket">
  <input name="submit" type="submit" value="store in new basket"><input name="newBasketName">
  <input type="hidden" name="fromFileBrowser" value="1">
  <input type="hidden" name="ids" value=" "><!-- make sure that ids is existing -->
  
  <table  width="100%" border=0 cellspacing=1 cellpadding=2>
    <tr>
      <th align=left bgcolor="#88ff88">
      <a href="?sortField=title"> File</a>
      </th>
        <th align=left bgcolor="#88ff88">
      <a> Designation</a>
      </th>
      <th align=left bgcolor="#00">
	<a>Rev.</a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a href="?sortField=date">Date</a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a href="?sortField=author">Author</a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a >Last log entry</a>
      </th>
      <th align=left bgcolor="#cccccc" width="80">
	<a href="?sortField=comment">Comment</a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a>Download<br><font size="-1"><a tal:attributes="href python:here.absolute_url()+'/helpDownload'" target="help">(help)</a></font></a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a>Downl. and lock</a>
      </th>
      <th align=left bgcolor="#cccccc">
	<a>Upload</a>
      </th>
      <th>
       &nbsp;
       </th>
    </tr>
    <span tal:omit-tag="" tal:define="sortField python:here.REQUEST.get('sortField','title')" tal:repeat="version versions">
      <tr tal:define="lastVersion python:version[1].getLastVersion()">
	<td><input type="checkbox" tal:attributes="value python:version[1].getId()" name="ids"><a tal:content="python:version[1].title" tal:attributes="href python:lastVersion.absolute_url()+'/view'"/></td>
	<td>
		   <span tal:content="lastVersion/getDesignation"/>
    </td>
	<td>
	<span tal:replace="lastVersion/versionNumber"/>
	<font size="-1"><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/history'">(history)</a></font>
	</td>
	<td tal:content="lastVersion/getTime"/>
	<td tal:content="lastVersion/lastEditor"/>
	<td tal:content="lastVersion/versionComment"/>
        <td><a tal:attributes="href python:lastVersion.absolute_url()+'/manageVCommentForm'"><small tal:content="python:lastVersion.getVComment()"/></a></td>
        <!--<td><a tal:attributes="href python:version[1].absolute_url()+'/manageCommentForm'"><small tal:content="python:version[1].getComment()"/></a></td>-->
	<td><a tal:attributes="href python:lastVersion.absolute_url()">download</a></td>
	
	<td tal:condition="python:lastVersion.lockedBy==''"><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/downloadLocked'">download and lock</a></td>
	<td tal:condition="not:python:lastVersion.lockedBy==''"><a>locked</a></td>
	
	<td tal:condition="python:lastVersion.lockedBy==''"><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/addCDLIFileObjectForm'">Upload New Version</a></td>
	<td tal:condition="not:python:lastVersion.lockedBy==''">
	  <b tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/addCDLIFileObjectForm'">Locked by: <span tal:replace="lastVersion/lockedBy"/></b>&nbsp;<a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/unlock'">unlock</a>
	</td>
	<td>
	 <a tal:repeat="collection python:version[1].isContainedInBaskets(context=here)" tal:content="collection/title"
	 tal:attributes="href python:collection.getLastVersion().absolute_url()"/>	</td>
  
      <td>
       <a tal:attributes="href python:here.absolute_url()+'/delete?ids='+version[0]">del</a>
      </td>
      </tr>
    </span>
   </table>
   </form>
   </tal:block>
   </tal:block>
</html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>