Mercurial > hg > documentViewer
diff zpt/viewer_index.zpt @ 559:eabfbad6aeb4
"extended" layer for index view and some bugfixes.
author | casties |
---|---|
date | Fri, 28 Sep 2012 18:50:59 +0200 |
parents | 6ab436383fca |
children | 04c330b92cab |
line wrap: on
line diff
--- a/zpt/viewer_index.zpt Fri Sep 28 11:25:25 2012 +0200 +++ b/zpt/viewer_index.zpt Fri Sep 28 18:50:59 2012 +0200 @@ -7,14 +7,27 @@ availableLayers python:here.getAvailableLayers().get('index', None); docpath docinfo/textURLPath | nothing; query nothing; - numPages docinfo/numPages | nothing;"> + numPages docinfo/numPages | nothing; + global formattedData python:here.metadata.getBibFormattedMetaData(bibdata=docinfo.get('bib', None));"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" /> -<link rel="stylesheet" href="template/docuviewer_css" type="text/css" /> -<!-- layer headers (rendered always) --> +<link rel="stylesheet" tal:attributes="href string:$viewerUrl/template/docuviewer_css" type="text/css" /> +<script type="text/javascript" tal:attributes="src string:$viewerUrl/template/jquery_js"></script> +<script type="text/javascript"> +// <!-- + $(document).ready(function() { + // autosubmit forms + $('form.autosubmit').find('.autosubmit').change(function() { + this.form.submit(); + }); + $('form.autosubmit input[type="submit"]').hide(); + }); +// --> +</script> +<!-- layer headers (all available) --> <tal:block tal:repeat="layer availableLayers"> - <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" tal:condition="python:exists(mpath)"> + <tal:block tal:define="mpath string:here/template/layer_index_${layer}/macros/html_head" tal:condition="python:exists(mpath)"> <metal:block metal:use-macro="python:path(mpath)" /> </tal:block> </tal:block> @@ -37,10 +50,10 @@ </div> <div class="col main"> + <!-- main content column --> <div class="index-info"> <h2>Bibliographic information</h2> - <table border="0" - tal:define="formattedData python:here.metadata.getBibFormattedMetaDataExtended(bibdata=docinfo.get('bib', None),bibxdata=docinfo.get('bibx', None))"> + <table border="0"> <tal:x condition="python:formattedData"> <!-- wenn es bibinfo in docinfo gibt --> <tr tal:replace="structure python:formattedData" /> @@ -81,11 +94,11 @@ <td class="type">Document ID:</td> <td class="content" tal:content="dri" /> </tr> - <tr> + <!-- <tr> <td class="type">Permanent URL:</td> <td class="content"><a target="_blank" tal:attributes="href string:http://echo.mpiwg-berlin.mpg.de/$dri" tal:content="string:http://echo.mpiwg-berlin.mpg.de/$dri" /></td> - </tr> + </tr> --> </table> </tal:block> @@ -113,26 +126,10 @@ </table> </tal:block> </div> - </div> + </div> <!-- /main content column --> + <div class="col buttons"> - <div class="options"> - <h4>Metadata</h4> - <form tal:attributes="action viewerUrl" class="autosubmit"> - <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})" - tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> - <ul> - <!-- text layer select buttons (rendered always) --> - <tal:block tal:repeat="layer availableLayers"> - <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li" - tal:condition="python:exists(mpath)"> - <li metal:use-macro="python:path(mpath)" /> - </tal:block> - </tal:block> - </ul> - <input type="submit" value="Go!" /> - </form> - </div> - + <!-- option block column --> <div class="options"> <h4>Browse</h4> <ul class="list"> @@ -144,11 +141,11 @@ <h4>Download</h4> Download full document <ul class="list"> - <li><a target="_blank" - tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath.replace('.xml','.html'))" + <li><a target="_blank" rel="nofollow" class="download" + tal:attributes="href python:here.getTextDownloadUrl(type='html',docinfo=docinfo)" target="_blank">as HTML</a></li> - <li><a target="_blank" - tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">as + <li><a target="_blank" rel="nofollow" class="download" + tal:attributes="href python:here.getTextDownloadUrl(type='xml',docinfo=docinfo)" target="_blank">as XML</a></li> </ul> (copyright and license see below) @@ -175,8 +172,25 @@ </ul> </form> </div> - <!-- end search options--> - </div> + + <div class="options" tal:condition="availableLayers"> + <h4>Metadata</h4> + <form tal:attributes="action viewerUrl" class="autosubmit"> + <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})" + tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> + <ul> + <!-- text layer select buttons (rendered always) --> + <tal:block tal:repeat="layer availableLayers"> + <tal:block tal:define="mpath string:here/template/layer_index_${layer}/macros/layer_select_li" + tal:condition="python:exists(mpath)"> + <li metal:use-macro="python:path(mpath)" /> + </tal:block> + </tal:block> + </ul> + <input type="submit" value="Go!" /> + </form> + </div> + </div> <!-- /option block column --> </div> <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> <!-- footer -->