File:  [Repository] / cdli / zpt / CDLIFileFolderMain.zpt
Revision 1.10: download - view: text, annotated - select for diffs - revision graph
Mon Jan 21 17:19:01 2008 UTC (16 years, 3 months ago) by casties
Branches: MAIN
CVS tags: HEAD
merged zcat_only branch based on Zope ZCatalog

<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 class="yellow">
  <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 class="yellow">
  <br><br>
  </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="button" type="submit" id="selectButton" value="Select All" onClick="toggleSelect(); return false">
  <br><br>
</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" class="button" type="submit" value="store in active basket">
  <input name="submit" class="button" 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 class="filelist"  width="100%" border=0 cellspacing=1 cellpadding=2>
    <tr>
      <th align=left>
      <a href="?sortField=title"> File</a>
      </th>
        <th align=left>
      Designation
      </th>
      <th align=left>
	Revisions
      </th>
      <th align=left>
	<a href="?sortField=date">Date</a>
      </th>
      <th align=left>
	<a href="?sortField=author">Author</a>
      </th>
      <th align=left>
	Last log entry
      </th>
      <th align=left width="80">
	<a href="?sortField=comment">Comment</a>
      </th>
      <th align=left>
	Download<br><a tal:attributes="href python:here.absolute_url()+'/helpDownload'" target="help">(help)</a>
      </th>
      <th align=left>
	Downl. and lock
      </th>
      <th align=left>
	Upload
      </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].getContentObject()">
	<td><nobr><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'"/></nobr></td>
	<td>
		   <span tal:content="lastVersion/getDesignation|python:'ERROR'"/>
    </td>
	<td>
	<span tal:replace="lastVersion/versionNumber"/>
	<nobr><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/history'">(history)</a></nobr>
	</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>
        </tr>
    </span>
   </table>
   </form>
   </tal:block>
   </tal:block>
</html>

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