File:  [Repository] / cdli / zpt / viewCDLIFile.zpt
Revision 1.10.2.1: download - view: text, annotated - select for diffs - revision graph
Mon Jan 7 16:54:46 2008 UTC (16 years, 5 months ago) by casties
Branches: zcat_only_1
Diff to: branchpoint 1.10: preferred, unified
added edit-in-browser and delete for ATF files

    1: <html metal:use-macro="here/main_template/macros/page">
    2:     <tal:block metal:fill-slot="body" define="query python:here.REQUEST.QUERY_STRING;
    3:                                               vars python:query.split('&');
    4:                                               allVars python:map(lambda x: x.split('='), vars);
    5:                                               allVarsF python:filter(lambda x: not x == [''], allVars);
    6:                                               dictVars python:dict(allVarsF);
    7:                                               parent here/aq_parent;
    8:                                               gparent parent/aq_parent;
    9:                                               p_no python:here.REQUEST.get('fileId',here.aq_parent.title.split('.')[0])">
   10:   
   11:         <p tal:condition="not:python:dictVars.has_key('fromBasket')">
   12:              <a tal:attributes="href gparent/absolute_url" tal:content="string:up to folder ${gparent/getId}"/>
   13:         </p>
   14: 
   15:         <h2>Textdisplay</h2>
   16: 
   17:         <p>
   18:           <a tal:attributes="href string:http://cdli.mpiwg-berlin.mpg.de/ID/$p_no" target="_blank">View database entry</a>
   19:         </p>
   20:         <p>
   21:           <a tal:attributes="href parent/absolute_url" >View file history</a>
   22:         </p>
   23:     
   24:         <tal:block condition="python:dictVars.has_key('fromBasket')">
   25:             <tal:block define="basket python:here.getBasketFromId(dictVars['fromBasket'],context=here.cdliRoot.basketContainer)">
   26:                 <p tal:condition="basket">
   27:                     <a tal:content="python:'back to basket ('+basket.title+')'" tal:attributes="href python:basket.getLastVersion().absolute_url()"/>
   28:                 </p>
   29:                 <p tal:condition="not:basket">
   30:                     <a tal:content="python:'back(%s)'%here.aq_parent.aq_parent.title" tal:attributes="href python:here.aq_parent.aq_parent.absolute_url()"/>
   31:                 </p>
   32:             </tal:block>
   33:         </tal:block>
   34:           
   35:         <p>File Name: <span tal:replace="here/getId"/> (version <span tal:replace="here/versionNumber"/>)</p>
   36:         <p tal:condition="python:dictVars.has_key('fromBasket') and dictVars.has_key('filenr')">
   37:             <tal:block define="basket python:here.getBasketFromId(dictVars['fromBasket'],context=here.cdliRoot.basketContainer).getLastVersion();
   38:                        files python:basket.getLastVersion().getContent();
   39:                        index python:dictVars['filenr'];">
   40:                 <span tal:omit-tag="" tal:condition="python: int(index) > 0">
   41:                     <a tal:define="file python:files[int(index)-1]" tal:attributes="href python:basket.getObjUrl(file) + '/' + basket.getFileLastVersion(file).getId() + '/view?fromBasket='+dictVars['fromBasket']+'&filenr='+str(int(index)-1)">previous file</a>&nbsp;&nbsp;&nbsp;&nbsp;
   42:                 </span>
   43:                 <span tal:omit-tag="" tal:condition="python: int(index) < len(files)-1">
   44:                     <a tal:define="file python:files[int(index)+1]" tal:attributes="href python:basket.getObjUrl(file) + '/' + basket.getFileLastVersion(file).getId() + '/view?fromBasket='+dictVars['fromBasket']+'&filenr='+str(int(index)+1)">next file</a>
   45:                 </span>
   46:             
   47:             </tal:block>
   48:         </p>
   49:         <a tal:attributes="href python:here.absolute_url()">download</a>&nbsp;&nbsp;&nbsp;&nbsp;
   50:         <a tal:condition="python:here.lockedBy==''" tal:attributes="href python:here.REQUEST['URL1']+'/downloadLocked'">download and lock</a>
   51:         <a tal:condition="not:python:here.lockedBy==''">locked</a>&nbsp;&nbsp;&nbsp;&nbsp;
   52:         <a tal:condition="python:here.lockedBy==''" tal:attributes="href python:here.REQUEST['URL1']+'/addCDLIFileObjectForm'">upload new version</a>&nbsp;&nbsp;&nbsp;&nbsp;
   53:         <a tal:condition="python:here.lockedBy==''" tal:attributes="href python:here.REQUEST['URL1']+'/editATF'">edit in browser</a>
   54:         <tal:block tal:condition="not:python:here.lockedBy==''">
   55:             <b tal:attributes="href python:here.REQUEST['URL1']+'/addCDLIFileObjectForm'">Locked by: <span tal:replace="here/lockedBy"/></b>&nbsp;&nbsp;&nbsp;&nbsp;<a tal:attributes="href python:here.REQUEST['URL2']+'/unlock'">unlock</a>
   56:         </tal:block>
   57:         <pre class="atf_file" tal:content="here/getFormattedData"/>
   58:     </tal:block>
   59:  </html>

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