File:  [Repository] / cdli / zpt / CDLIFileFolderMain.zpt
Revision 1.9.2.1: download - view: text, annotated - select for diffs - revision graph
Sat Oct 6 13:44:46 2007 UTC (16 years, 8 months ago) by casties
Branches: zcat_only_1
Diff to: branchpoint 1.9: preferred, unified
CLOSED - # 35: uploading a new version of a CDLIFile indexes the last version
https://itgroup.mpiwg-berlin.mpg.de:8080/tracs/cdli/ticket/35

    1: <html metal:use-macro="here/main_template/macros/page">
    2:   <tal:block metal:fill-slot="body" tal:define="options here/REQUEST">
    3:   <h2>CDLI File Storage - <span tal:content="here/title"/></h2>
    4: 
    5:   <tal:x tal:condition="python:options.get('basketName',None)">
    6: <table width="100%">
    7:   <tr class="old"> 
    8:     <td>
    9:       <span tal:replace="python:options['numberOfObjects']"/> Objects stored in
   10:       <span tal:replace="python:options['basketName']"/>.
   11:     </td>
   12:   </tr>
   13: </table>
   14: 
   15: </tal:x>
   16:  <tal:x condition="python:here.REQUEST.get('uploaded',None)">
   17:  <table width="100%" bgcolor="%FF0000">
   18:  <tr class="old">
   19:  	<td>New version of <span tal:replace="python:here.REQUEST.get('uploaded',None)"/> added</td>
   20:  </tr>
   21:  </table>
   22:  </tal:x>
   23:   <span tal:replace="structure here/header_html"/>
   24:   <a tal:condition="here/hasParent" 
   25:   tal:attributes="href python:here.aq_parent.absolute_url()"
   26:   tal:content="python:'back (%s)'%here.aq_parent.title">back</a>
   27:   <hr class="yellow">
   28:   <tal:block tal:define="folders python:here.getFolders()" tal:condition="python:len(folders)>0">
   29:   <h3>Subfolder</h3>
   30:   <table>
   31:   <tr tal:repeat="folder folders">
   32:   <td><a tal:content="python:folder[0].title" tal:attributes="href python:folder[0].absolute_url()"/></td>
   33:   <td tal:content="python:'( folder: %s)'% folder[1]"/>
   34:   <td tal:content="python:'( files: %s)'% folder[2]"/>
   35:   </tr>
   36:   </table>
   37:   <hr class="yellow">
   38:   <br><br>
   39:   </tal:block>
   40: 
   41:  <form>
   42:   <script type="text/javascript">
   43: <!-- 
   44: 
   45: 
   46: isSelected=false
   47: 
   48: function toggleSelect() {
   49: addBasket=document.getElementById('addBasket')
   50: selectButton=document.getElementById('selectButton')
   51: 
   52:   
   53:   if (isSelected == false) {
   54: 
   55:     for (i = 0; i < addBasket.length-1; i++)
   56:    
   57:       addBasket.elements[i].checked = true ;
   58:       
   59:     
   60:       isSelected = true;
   61: 
   62:       selectButton.value = "Deselect All";
   63:       return isSelected;
   64:   }
   65:   else {
   66: 
   67:     for (i = 0; i < addBasket.length+1; i++)
   68:       addBasket.elements[i].checked = false ;
   69:       isSelected = false;
   70:       selectButton.value = "Select All";
   71:       return isSelected;       
   72:   }
   73: }
   74: 
   75: //-->
   76: </script>
   77:   <input class="button" type="submit" id="selectButton" value="Select All" onClick="toggleSelect(); return false">
   78:   <br><br>
   79: </form>
   80:   <tal:block tal:define="sortField python:here.REQUEST.get('sortField','title');
   81:   					    versions python:here.getVersionedFiles(sortField=sortField)">
   82:   					   
   83:   <form id="addBasket" tal:condition="python:len(versions)>0"  action="basketContainer/storeInBasket">
   84:   <input name="submit" class="button" type="submit" value="store in active basket">
   85:   <input name="submit" class="button" type="submit" value="store in new basket"> <input name="newBasketName">
   86:   <input type="hidden" name="fromFileBrowser" value="1">
   87:   <input type="hidden" name="ids" value=" "><!-- make sure that ids is existing -->
   88:   
   89:   <table class="filelist"  width="100%" border=0 cellspacing=1 cellpadding=2>
   90:     <tr>
   91:       <th align=left>
   92:       <a href="?sortField=title"> File</a>
   93:       </th>
   94:         <th align=left>
   95:       Designation
   96:       </th>
   97:       <th align=left>
   98: 	Revisions
   99:       </th>
  100:       <th align=left>
  101: 	<a href="?sortField=date">Date</a>
  102:       </th>
  103:       <th align=left>
  104: 	<a href="?sortField=author">Author</a>
  105:       </th>
  106:       <th align=left>
  107: 	Last log entry
  108:       </th>
  109:       <th align=left width="80">
  110: 	<a href="?sortField=comment">Comment</a>
  111:       </th>
  112:       <th align=left>
  113: 	Download<br><a tal:attributes="href python:here.absolute_url()+'/helpDownload'" target="help">(help)</a>
  114:       </th>
  115:       <th align=left>
  116: 	Downl. and lock
  117:       </th>
  118:       <th align=left>
  119: 	Upload
  120:       </th>
  121:       <th>
  122:        &nbsp;
  123:        </th>
  124:         <th>
  125:        &nbsp;
  126:        </th>
  127:     </tr>
  128:     <span tal:omit-tag="" tal:define="sortField python:here.REQUEST.get('sortField','title')" tal:repeat="version versions">
  129:       <tr tal:define="lastVersion python:version[1].getContentObject()">
  130: 	<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>
  131: 	<td>
  132: 		   <span tal:content="lastVersion/getDesignation|python:'ERROR'"/>
  133:     </td>
  134: 	<td>
  135: 	<span tal:replace="lastVersion/versionNumber"/>
  136: 	<nobr><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/history'">(history)</a></nobr>
  137: 	</td>
  138: 	<td tal:content="lastVersion/getTime"/>
  139: 	<td tal:content="lastVersion/lastEditor"/>
  140: 	<td tal:content="lastVersion/versionComment"/>
  141:         <td><a tal:attributes="href python:lastVersion.absolute_url()+'/manageVCommentForm'"><small tal:content="python:lastVersion.getVComment()"/></a></td>
  142:         <!--<td><a tal:attributes="href python:version[1].absolute_url()+'/manageCommentForm'"><small tal:content="python:version[1].getComment()"/></a></td>-->
  143: 	<td><a tal:attributes="href python:lastVersion.absolute_url()">download</a></td>
  144: 	
  145: 	<td tal:condition="python:lastVersion.lockedBy==''"><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/downloadLocked'">download and lock</a></td>
  146: 	<td tal:condition="not:python:lastVersion.lockedBy==''"><a>locked</a></td>
  147: 	
  148: 	<td tal:condition="python:lastVersion.lockedBy==''"><a tal:attributes="href python:here.REQUEST['URL1']+'/'+version[0]+'/addCDLIFileObjectForm'">Upload New Version</a></td>
  149: 	<td tal:condition="not:python:lastVersion.lockedBy==''">
  150: 	  <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>
  151: 	</td>
  152: 	<td>
  153: 	 <a tal:repeat="collection python:version[1].isContainedInBaskets(context=here)" tal:content="collection/title"
  154: 	 tal:attributes="href python:collection.getLastVersion().absolute_url()"/>	</td>
  155:   
  156:       <td>
  157:        <a tal:attributes="href python:here.absolute_url()+'/delete?ids='+version[0]">del</a>
  158:       </td>
  159:       </tr>
  160:     </span>
  161:    </table>
  162:    </form>
  163:    </tal:block>
  164:    </tal:block>
  165: </html>

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