Annotation of cdli/zpt/viewCDLIFile.zpt, revision 1.12

1.1       dwinter     1: <html metal:use-macro="here/main_template/macros/page">
1.6       dwinter     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);
1.10      casties     6:                                               dictVars python:dict(allVarsF);
1.11      casties     7:                                               parent here/aq_parent;
                      8:                                               gparent parent/aq_parent;
1.10      casties     9:                                               p_no python:here.REQUEST.get('fileId',here.aq_parent.title.split('.')[0])">
1.6       dwinter    10:   
1.11      casties    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: 
1.6       dwinter    15:         <h2>Textdisplay</h2>
1.11      casties    16: 
1.6       dwinter    17:         <p>
1.10      casties    18:           <a tal:attributes="href string:http://cdli.mpiwg-berlin.mpg.de/ID/$p_no" target="_blank">View database entry</a>
1.6       dwinter    19:         </p>
1.11      casties    20:         <p>
                     21:           <a tal:attributes="href parent/absolute_url" >View file history</a>
                     22:         </p>
1.6       dwinter    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:           
1.11      casties    35:         <p>File Name: <span tal:replace="here/getId"/> (version <span tal:replace="here/versionNumber"/>)</p>
1.6       dwinter    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">
1.12    ! dwinter    41:                     <a tal:define="file python:files[int(index)-1]" tal:attributes="href python:basket.getObjUrl(file[0]) + '/' + basket.getFileObjectLastVersion(file[0]).getId() + '/view?fromBasket='+dictVars['fromBasket']+'&filenr='+str(int(index)-1)">previous file</a>&nbsp;&nbsp;&nbsp;&nbsp;
1.6       dwinter    42:                 </span>
                     43:                 <span tal:omit-tag="" tal:condition="python: int(index) < len(files)-1">
1.12    ! dwinter    44:                     <a tal:define="file python:files[int(index)+1]" tal:attributes="href python:basket.getObjUrl(file[0]) + '/' + basket.getFileObjectLastVersion(file[0]).getId() + '/view?fromBasket='+dictVars['fromBasket']+'&filenr='+str(int(index)+1)">next file</a>
1.6       dwinter    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;
1.11      casties    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>
1.6       dwinter    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>
1.9       dwinter    57:         <pre class="atf_file" tal:content="here/getFormattedData"/>
1.6       dwinter    58:     </tal:block>
1.7       dwinter    59:  </html>

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