Changeset 532:0b8bed1223ad in documentViewer for zpt/common_template.zpt


Ignore:
Timestamp:
Jul 25, 2012, 7:28:31 PM (12 years ago)
Author:
casties
Branch:
default
Message:

new layout and styles.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zpt/common_template.zpt

    r528 r532  
    1212                bib docinfo/bib | nothing; bibType docinfo/bibType | nothing;
    1313                formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);">
    14     <div tal:condition="not:formattedLabel">
     14    <div class="logo" tal:condition="exists:here/template/logo.png">
     15      <img tal:attributes="src here/template/logo.png/absolute_url"/>
     16    </div>
     17    <div class="title-block">
     18    <div class="title" tal:condition="not:formattedLabel">
    1519      <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">
    1620        <i tal:content="docinfo/creator" />,
     
    2024        tal:content="string:[no bibliographical information for this document (type ${bibType})]" />
    2125    </div>
    22     <div tal:condition="formattedLabel" tal:content="structure formattedLabel" />
    23     <div class="doclinks">
    24       <a tal:condition="python:viewMode!='index'" tal:attributes="href python:here.getLink('viewMode','index')">Bibliographical
    25         information</a>
    26       <a tal:condition="python:viewMode!='text'" tal:attributes="href python:here.getLink('viewMode','text')">Page view</a>
    27       <a tal:condition="python:viewMode!='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a>
     26    <div class="title" tal:condition="formattedLabel" tal:content="structure formattedLabel" />
     27    <ul class="view-switcher">
     28      <li tal:attributes="class python:here.getStyle(viewMode, 'text')"><a tal:omit-tag="python:viewMode=='text'"
     29        tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li>
     30      <li tal:attributes="class python:here.getStyle(viewMode, 'images')"><a tal:omit-tag="python:viewMode=='images'"
     31        tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li>
     32      <li tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a tal:omit-tag="python:viewMode=='xml'"
     33        tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li>
     34      <li tal:attributes="class python:here.getStyle(viewMode, 'thumbs')"><a tal:omit-tag="python:viewMode=='thumbs'"
     35        tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a></li>
     36      <li tal:attributes="class python:here.getStyle(viewMode, 'index')"><a tal:omit-tag="python:viewMode=='index'"
     37        tal:attributes="href python:here.getLink('viewMode','index')">Document information</a></li>
     38    </ul>
    2839    </div>
    2940  </metal:block>
    3041  <!-- /head -->
     42
    3143
    3244  <!-- page ruler with previous/next page buttons -->
     
    3850              leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
    3951    <form class="autosubmit" tal:attributes="action viewerUrl">
    40       <input type="hidden" tal:define="params python:here.getParams('pn', None)"
    41         tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    42       page <a tal:condition="leftest"
    43         tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span
    44         tal:condition="not:leftest">|&lt;</span> <a tal:condition="left"
    45         tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span
    46         tal:condition="not:left">&lt;</span> <input class="autosubmit" size="3"
    47         type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
    48         title="Original page number"
    49         tal:define="originalPage pageinfo/pageNumberOrig | nothing"
    50         tal:condition="python:originalPage!=None"> (<span
    51         tal:replace="originalPage" /><span
    52         tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing"
    53         tal:condition="python:originalPageNorm!=None"> [<span
    54           tal:replace="originalPageNorm" />]
    55       </span>)
    56       </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a
    57         tal:condition="right" tal:attributes="href python:here.getLink('pn',right)">&gt;</a>
    58       <span tal:condition="not:right">&gt;</span> <a tal:condition="rightest"
    59         tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
     52      <input type="hidden" tal:define="params python:here.getParams('pn', None)" tal:repeat="param params"
     53        tal:attributes="name param; value python:params[param]" />
     54        <span class="ruler-main">page <a tal:condition="leftest"
     55        tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span tal:condition="not:leftest">|&lt;</span> <a
     56        tal:condition="left" tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span tal:condition="not:left">&lt;</span>
     57        <input class="autosubmit" size="3" type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
     58        title="Original page number" tal:define="originalPage pageinfo/pageNumberOrig | nothing"
     59        tal:condition="python:originalPage!=None"> (<span tal:replace="originalPage" /><span
     60          tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing" tal:condition="python:originalPageNorm!=None">
     61            [<span tal:replace="originalPageNorm" />]
     62        </span>)
     63        </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a tal:condition="right"
     64        tal:attributes="href python:here.getLink('pn',right)">&gt;</a> <span tal:condition="not:right">&gt;</span> <a
     65        tal:condition="rightest" tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
    6066        tal:condition="not:rightest">&gt;|</span>
     67      </span> <!-- ruler-main -->
    6168    </form>
    6269  </metal:block>
     
    6572  <!-- toc ruler (using getBatch) with previous/next toc page buttons -->
    6673  <metal:block metal:define-macro="toc_ruler">
    67     <form class="autosubmit" tal:attributes="action viewerUrl"
    68       tal:define="startParam startParam | string:start">
    69       <input type="hidden" tal:define="params python:here.getParams(startParam, None)"
    70         tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    71       <a tal:condition="batch/prevStart"
    72         tal:attributes="href python:here.getLink(startParam,batch['prevStart'])">&lt;</a>
    73       <span tal:condition="not:batch/prevStart">&lt;</span>
     74    <form class="autosubmit" tal:attributes="action viewerUrl" tal:define="startParam startParam | string:start">
     75      <input type="hidden" tal:define="params python:here.getParams(startParam, None)" tal:repeat="param params"
     76        tal:attributes="name param; value python:params[param]" /> <a tal:condition="batch/prevStart"
     77        tal:attributes="href python:here.getLink(startParam,batch['prevStart'])">&lt;</a> <span tal:condition="not:batch/prevStart">&lt;</span>
    7478      <select class="autosubmit" tal:attributes="name startParam">
    75         <option tal:repeat="grp batch/batches"
    76           tal:attributes="selected python:(start==grp['start']); value grp/start"
     79        <option tal:repeat="grp batch/batches" tal:attributes="selected python:(start==grp['start']); value grp/start"
    7780          tal:content="string:${grp/start} - ${grp/end}" />
    78       </select>
    79       <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
    80         tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a>
    81       <span tal:condition="not:batch/nextStart">&gt;</span>
     81      </select> <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
     82        tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a> <span tal:condition="not:batch/nextStart">&gt;</span>
    8283    </form>
    8384  </metal:block>
     
    8687  <metal:block metal:define-macro="toc_ruler_thumbs">
    8788    <form class="autosubmit" tal:attributes="action viewerUrl">
    88       <input type="hidden" tal:define="params python:here.getParams('start',None)"
    89         tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    90       <a tal:condition="left" tal:attributes="href python:here.getLink('start',left)">&lt;</a>
    91       <span tal:condition="not:left">&lt;</span>
    92       <select class="autosubmit" name="start"
    93         tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
     89      <input type="hidden" tal:define="params python:here.getParams('start',None)" tal:repeat="param params"
     90        tal:attributes="name param; value python:params[param]" /> <a tal:condition="left"
     91        tal:attributes="href python:here.getLink('start',left)">&lt;</a> <span tal:condition="not:left">&lt;</span> <select
     92        class="autosubmit" name="start" tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
    9493        <tal:block>
    95           <option tal:repeat="grp pageBatch/batches"
    96             tal:attributes="selected python:start==grp['start']; value grp/start;"
     94          <option tal:repeat="grp pageBatch/batches" tal:attributes="selected python:start==grp['start']; value grp/start;"
    9795            tal:content="string:${grp/start} - ${grp/end}" />
    9896        </tal:block>
    99       </select>
    100       <input type="submit" value="Go" /> <a tal:condition="right"
    101         tal:attributes="href python:here.getLink('start',right)">&gt;</a> <span
    102         tal:condition="not:right">&gt;</span>
     97      </select> <input type="submit" value="Go" /> <a tal:condition="right" tal:attributes="href python:here.getLink('start',right)">&gt;</a>
     98      <span tal:condition="not:right">&gt;</span>
    10399    </form>
    104100  </metal:block>
     
    106102  <!-- toc type switcher -->
    107103  <metal:block metal:define-macro="toc_switcher">
    108     <ul class="switcher">
    109       <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)">
    110         <a tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a>
    111       </li>
    112       <li tal:attributes="class python:test(tocMode=='text', 'sel', None)"
    113         tal:condition="python:docpath and docinfo.get('numTocEntries', None)">
    114         <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a>
    115       </li>
    116       <li tal:attributes="class python:test(tocMode=='figures', 'sel', None)"
    117         tal:condition="python:docpath and docinfo.get('numFigureEntries', None)">
    118         <a tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a>
    119       </li>
    120       <li tal:attributes="class python:test(tocMode=='concordance', 'sel', None)"
    121         tal:condition="python:docpath and docinfo.get('pageNumbers', None)">
    122         <a tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a>
    123       </li>
    124       <li tal:attributes="class python:test(tocMode=='none', 'sel', None)">
    125         <a tal:attributes="href python:here.getLink('tocMode','none')">None</a>
    126       </li>
    127     </ul>
     104    <div class="toc-switcher">
     105      <ul>
     106        <li tal:attributes="class python:here.getStyle(tocMode, 'none')"><span><a tal:omit-tag="python:tocMode=='none'"
     107            tal:attributes="href python:here.getLink('tocMode','none')">None</a></span></li>
     108        <li tal:attributes="class python:here.getStyle(tocMode, 'concordance')"
     109          tal:condition="python:docpath and docinfo.get('pageNumbers', None)"><span><a
     110            tal:omit-tag="python:tocMode=='concordance'" tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a></span></li>
     111        <li tal:attributes="class python:here.getStyle(tocMode, 'figures')"
     112          tal:condition="python:docpath and docinfo.get('numFigureEntries', None)"><span><a
     113            tal:omit-tag="python:tocMode=='figures'" tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a></span></li>
     114        <li tal:attributes="class python:here.getStyle(tocMode, 'text')"
     115          tal:condition="python:docpath and docinfo.get('numTocEntries', None)"><span><a
     116            tal:omit-tag="python:tocMode=='text'" tal:attributes="href python:here.getLink('tocMode','text')">Content</a></span></li>
     117        <li tal:attributes="class python:here.getStyle(tocMode, 'thumbs')"><span><a
     118            tal:omit-tag="python:tocMode=='thumbs'" tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a></span></li>
     119      </ul>
     120    </div>
    128121  </metal:block>
    129122
Note: See TracChangeset for help on using the changeset viewer.