view zpt/common_template.zpt @ 528:f8a5f63eafc0

new viewMode=thumbs.
author casties
date Fri, 13 Apr 2012 16:55:16 +0200
parents 652cc8d3f1a9
children 0b8bed1223ad
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
  <!-- block used for page header content area -->
  <metal:block metal:define-macro="head"
    tal:define="viewMode pageinfo/viewMode;
                docpath docinfo/textURLPath | nothing;
                bib docinfo/bib | nothing; bibType docinfo/bibType | nothing;
                formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);">
    <div tal:condition="not:formattedLabel">
      <tal:block tal:condition="python:docinfo['creator'] or docinfo['title']">
        <i tal:content="docinfo/creator" />,
        <span tal:content="docinfo/title" />, <span tal:content="docinfo/date" />
      </tal:block>
      <span tal:condition="not:python:docinfo['creator'] or docinfo['title']"
        tal:content="string:[no bibliographical information for this document (type ${bibType})]" />
    </div>
    <div tal:condition="formattedLabel" tal:content="structure formattedLabel" />
    <div class="doclinks">
      <a tal:condition="python:viewMode!='index'" tal:attributes="href python:here.getLink('viewMode','index')">Bibliographical
        information</a>
      <a tal:condition="python:viewMode!='text'" tal:attributes="href python:here.getLink('viewMode','text')">Page view</a>
      <a tal:condition="python:viewMode!='thumbs'" tal:attributes="href python:here.getLink('viewMode','thumbs')">Thumbnail overview</a>
    </div>
  </metal:block>
  <!-- /head -->

  <!-- page ruler with previous/next page buttons -->
  <metal:block metal:define-macro="page_ruler"
    tal:define="
              prev python:test(pn>1,pn-1,None); next python:test(pn<numPages,pn+1,None);
              first python:test(pn>1,1,None); last python:test(pn<numPages,numPages,None);
              left python:test(flowLtr,prev,next); right python:test(flowLtr,next,prev);
              leftest python:test(flowLtr,first,last); rightest python:test(flowLtr,last,first);">
    <form class="autosubmit" tal:attributes="action viewerUrl">
      <input type="hidden" tal:define="params python:here.getParams('pn', None)"
        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
      page <a tal:condition="leftest"
        tal:attributes="href python:here.getLink('pn',leftest)">|&lt;</a> <span
        tal:condition="not:leftest">|&lt;</span> <a tal:condition="left"
        tal:attributes="href python:here.getLink('pn',left)">&lt;</a> <span
        tal:condition="not:left">&lt;</span> <input class="autosubmit" size="3"
        type="text" name="pn" tal:attributes="value pn" /> <span class="originalPage"
        title="Original page number"
        tal:define="originalPage pageinfo/pageNumberOrig | nothing"
        tal:condition="python:originalPage!=None"> (<span
        tal:replace="originalPage" /><span
        tal:define="originalPageNorm pageinfo/pageNumberOrigNorm | nothing"
        tal:condition="python:originalPageNorm!=None"> [<span
          tal:replace="originalPageNorm" />]
      </span>)
      </span> <input type="submit" value="Go" /> of <span tal:replace="numPages" /> <a
        tal:condition="right" tal:attributes="href python:here.getLink('pn',right)">&gt;</a>
      <span tal:condition="not:right">&gt;</span> <a tal:condition="rightest"
        tal:attributes="href python:here.getLink('pn',rightest)">&gt;|</a> <span
        tal:condition="not:rightest">&gt;|</span>
    </form>
  </metal:block>
  <!-- /ruler -->

  <!-- toc ruler (using getBatch) with previous/next toc page buttons -->
  <metal:block metal:define-macro="toc_ruler">
    <form class="autosubmit" tal:attributes="action viewerUrl"
      tal:define="startParam startParam | string:start">
      <input type="hidden" tal:define="params python:here.getParams(startParam, None)"
        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
      <a tal:condition="batch/prevStart"
        tal:attributes="href python:here.getLink(startParam,batch['prevStart'])">&lt;</a>
      <span tal:condition="not:batch/prevStart">&lt;</span>
      <select class="autosubmit" tal:attributes="name startParam">
        <option tal:repeat="grp batch/batches"
          tal:attributes="selected python:(start==grp['start']); value grp/start"
          tal:content="string:${grp/start} - ${grp/end}" />
      </select>
      <input type="submit" value="Go" /> <a tal:condition="batch/nextStart"
        tal:attributes="href python:here.getLink(startParam,batch['nextStart'])">&gt;</a>
      <span tal:condition="not:batch/nextStart">&gt;</span>
    </form>
  </metal:block>

  <!-- toc ruler for thumbs (using getPageBatch) with previous/next toc page buttons -->
  <metal:block metal:define-macro="toc_ruler_thumbs">
    <form class="autosubmit" tal:attributes="action viewerUrl">
      <input type="hidden" tal:define="params python:here.getParams('start',None)"
        tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
      <a tal:condition="left" tal:attributes="href python:here.getLink('start',left)">&lt;</a>
      <span tal:condition="not:left">&lt;</span>
      <select class="autosubmit" name="start"
        tal:define="ofs python:test(pageinfo['pageZero'],0,1)">
        <tal:block>
          <option tal:repeat="grp pageBatch/batches"
            tal:attributes="selected python:start==grp['start']; value grp/start;"
            tal:content="string:${grp/start} - ${grp/end}" />
        </tal:block>
      </select>
      <input type="submit" value="Go" /> <a tal:condition="right"
        tal:attributes="href python:here.getLink('start',right)">&gt;</a> <span
        tal:condition="not:right">&gt;</span>
    </form>
  </metal:block>

  <!-- toc type switcher -->
  <metal:block metal:define-macro="toc_switcher">
    <ul class="switcher">
      <li tal:attributes="class python:test(tocMode=='thumbs', 'sel', None)">
        <a tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a>
      </li>
      <li tal:attributes="class python:test(tocMode=='text', 'sel', None)"
        tal:condition="python:docpath and docinfo.get('numTocEntries', None)">
        <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a>
      </li>
      <li tal:attributes="class python:test(tocMode=='figures', 'sel', None)"
        tal:condition="python:docpath and docinfo.get('numFigureEntries', None)">
        <a tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a>
      </li>
      <li tal:attributes="class python:test(tocMode=='concordance', 'sel', None)"
        tal:condition="python:docpath and docinfo.get('pageNumbers', None)">
        <a tal:attributes="href python:here.getLink('tocMode','concordance')">Concordance</a>
      </li>
      <li tal:attributes="class python:test(tocMode=='none', 'sel', None)">
        <a tal:attributes="href python:here.getLink('tocMode','none')">None</a>
      </li>
    </ul>
  </metal:block>

</body>
</html>