Changeset 532:0b8bed1223ad in documentViewer for zpt


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

new layout and styles.

Location:
zpt
Files:
9 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
  • zpt/layer_text_search.zpt

    r526 r532  
    1616    <ul>
    1717      <metal:block metal:define-macro="layer_select_li">
    18         <li tal:condition="python:query">
    19           <input type="checkbox" class="autosubmit" name="viewLayer" value="search"
    20             tal:attributes="checked python:'search' in viewLayers" /> Search hits
    21         </li>
     18        <li tal:condition="python:query"><input type="checkbox" class="autosubmit" name="viewLayer" value="search"
     19          tal:attributes="checked python:'search' in viewLayers" /> Search hits</li>
    2220      </metal:block>
    2321    </ul>
     
    4846      <h4>Search</h4>
    4947      <form tal:attributes="action viewerUrl">
    50         <input type="hidden"
    51           tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
    52           tal:repeat="param params"
    53           tal:attributes="name param; value python:params[param]" />
     48        <input type="hidden" tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewLayer':None})"
     49          tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    5450        <!-- make sure we have one viewLayer=search -->
    5551        <tal:block tal:repeat="vl viewLayers">
    56           <input type="hidden" name="viewLayer" tal:attributes="value vl"
    57             tal:condition="python:vl != 'search'" />
     52          <input type="hidden" name="viewLayer" tal:attributes="value vl" tal:condition="python:vl != 'search'" />
    5853        </tal:block>
    5954        <input type="hidden" name="viewLayer" value="search" />
    6055        <!-- query text -->
    61         <input type="text" name="query" tal:attributes="value query" /> <input
    62           type="submit" value="Search" /> <a
     56        <input type="text" name="query" tal:attributes="value query" /> <br /> <input type="submit" value="Search" /> <a
    6357          tal:attributes="href python:here.getLink('query',None)">Clear</a>
    6458        <ul>
    65           <li>
    66             <input type="radio" name="queryType" value="fulltext"
    67               tal:attributes="checked python:queryType=='fulltext'" /> Exact
    68           </li>
    69           <li>
    70             <input type="radio" name="queryType" value="fulltextMorph"
    71               tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms
    72           </li>
    73           <li>
    74             <input type="radio" name="queryType" value="ftIndex"
    75               tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index
    76           </li>
    77           <li>
    78             <input type="radio" name="queryType" value="ftIndexMorph"
    79               tal:attributes="checked python:queryType=='ftIndexMorph'" /> Morphological
    80             index
    81           </li>
     59          <li><input type="radio" name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" />
     60            Exact</li>
     61          <li><input type="radio" name="queryType" value="fulltextMorph"
     62            tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms</li>
     63          <li><input type="radio" name="queryType" value="ftIndex" tal:attributes="checked python:queryType=='ftIndex'" />
     64            Fulltext index</li>
     65          <li><input type="radio" name="queryType" value="ftIndexMorph"
     66            tal:attributes="checked python:queryType=='ftIndexMorph'" /> Morphological index</li>
    8267        </ul>
    8368      </form>
  • zpt/toc_concordance.zpt

    r526 r532  
    66</head>
    77<body>
    8   <!-- block used for main content area -->
    9   <div class="toc-concordance" metal:define-macro="main"
    10     tal:define="start pageinfo/start; tocsize docinfo/numPages; grpsize pageinfo/tocPageSize;
     8  <div class="toc-container" metal:define-macro="main">
     9    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     10    <!-- block used for main content area -->
     11    <div class="tocbody concordance"
     12      tal:define="start pageinfo/start; tocsize docinfo/numPages; grpsize pageinfo/tocPageSize;
    1113                pageNumbers docinfo/pageNumbers | nothing;
    1214                batch python:here.getBatch(start=start,size=grpsize,end=tocsize,data=pageNumbers);">
    13     <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
    14     <div class="ruler">
    15       <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
    16     </div>
    17     <div class="content">
    18       <table tal:condition="pageNumbers">
    19         <tr>
    20           <th>Scan</th>
    21           <th>Original</th>
    22         </tr>
    23         <tr tal:repeat="toc batch/this">
    24           <tal:block tal:define="pn toc/pn | nothing">
    25             <td>
    26               <a tal:condition="pn"
    27                 tal:attributes="href python:here.getLink('pn', toc['pn'])"
    28                 tal:content="toc/pn" title="Scan number">ScanNo</a>
    29             </td>
    30             <td>
    31               <span class="originalPage" title="Original page number"
    32                 tal:define="originalPage toc/no | nothing"
    33                 tal:condition="python:originalPage!=None"><span
    34                 tal:replace="originalPage" /><span
    35                 tal:define="originalPageNorm toc/non | nothing"
    36                 tal:condition="python:originalPageNorm!=None"> [<span
    37                   tal:replace="originalPageNorm" />]
    38               </span></span>
    39             </td>
    40           </tal:block>
    41         </tr>
    42       </table>
     15      <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     16      <div class="ruler">
     17        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
     18      </div>
     19      <div class="content">
     20        <table tal:condition="pageNumbers">
     21          <tr>
     22            <th>Scan</th>
     23            <th>Original</th>
     24          </tr>
     25          <tr tal:repeat="toc batch/this">
     26            <tal:block tal:define="pn toc/pn | nothing">
     27              <td><a tal:condition="pn" tal:attributes="href python:here.getLink('pn', toc['pn'])" tal:content="toc/pn"
     28                title="Scan number">ScanNo</a></td>
     29              <td><span class="originalPage" title="Original page number" tal:define="originalPage toc/no | nothing"
     30                tal:condition="python:originalPage!=None"><span tal:replace="originalPage" /><span
     31                  tal:define="originalPageNorm toc/non | nothing" tal:condition="python:originalPageNorm!=None"> [<span
     32                    tal:replace="originalPageNorm" />]
     33                </span></span></td>
     34            </tal:block>
     35          </tr>
     36        </table>
     37      </div>
    4338    </div>
    4439  </div>
  • zpt/toc_figures.zpt

    r526 r532  
    66</head>
    77<body>
    8   <!-- block used for main content area -->
    9   <div class="toc-figures" metal:define-macro="main"
    10     tal:define="start pageinfo/start; tocsize docinfo/numFigureEntries; grpsize pageinfo/tocPageSize;
     8  <div class="toc-container" metal:define-macro="main">
     9    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     10    <!-- block used for main content area -->
     11    <div class="tocbody figures"
     12      tal:define="start pageinfo/start; tocsize docinfo/numFigureEntries; grpsize pageinfo/tocPageSize;
    1113                batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
    12     <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
    13     <div class="ruler">
    14         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler"/>
     14      <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     15      <div class="ruler">
     16        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
     17      </div>
     18      <div class="content"
     19        tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
    1520    </div>
    16     <div class="content"
    17       tal:content="structure python:here.getTocPage(mode='figures',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
    1821  </div>
    1922  <!-- /toc -->
  • zpt/toc_text.zpt

    r526 r532  
    66</head>
    77<body>
    8   <!-- block used for main content area -->
    9   <div class="toc-text" metal:define-macro="main"
    10     tal:define="start pageinfo/start; tocsize docinfo/numTocEntries; grpsize pageinfo/tocPageSize;
     8  <div class="toc-container" metal:define-macro="main">
     9    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     10    <!-- block used for main content area -->
     11    <div class="tocbody text"
     12      tal:define="start pageinfo/start; tocsize docinfo/numTocEntries; grpsize pageinfo/tocPageSize;
    1113                batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
    12     <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
    13     <div class="ruler">
    14         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler"/>
     14      <div class="ruler">
     15        <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler" />
     16      </div>
     17      <div class="content" tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
    1518    </div>
    16     <div class="content"
    17       tal:content="structure python:here.getTocPage(mode='text',start=start,pageinfo=pageinfo,docinfo=docinfo)" />
    1819  </div>
    19   <!-- toc -->
     20    <!-- toc -->
    2021</body>
    2122</html>
  • zpt/toc_thumbs.zpt

    r528 r532  
    66</head>
    77<body>
    8   <!-- block used for main content area -->
    9   <div class="toc-thumbs" metal:define-macro="main"
    10     tal:define="start pageinfo/start;
     8  <div class="toc-container" metal:define-macro="main">
     9    <div metal:use-macro="here/template/common_template/macros/toc_switcher" />
     10    <!-- block used for main content area -->
     11    <div class="tocbody thumbs"
     12      tal:define="start pageinfo/start;
    1113                grpsize pageinfo/groupsize;
    1214                numgroups pageinfo/numgroups;
     
    1517                left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']);
    1618                right python:test(flowLtr,pageBatch['nextStart'],pageBatch['prevStart']);">
    17     <div metal:use-macro="here/template/common_template/macros/toc_switcher"/>
    1819
    19     <div class="content">
    20       <div class="ruler">
    21         <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs"/>
     20      <div class="content">
     21        <div class="ruler">
     22          <metal:block metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" />
     23        </div>
     24
     25        <table class="thumbs">
     26          <tr tal:repeat="row pageBatch/pages">
     27            <td tal:repeat="thumb row" tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"><a
     28              tal:define="idx thumb/idx" tal:condition="idx" tal:attributes="href python:here.getLink('pn',idx)"> <img
     29                tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
     30                                alt idx" /><br />
     31                <span title="Scan number" tal:content="idx" /> <span
     32                tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']"
     33                title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" />
     34            </a></td>
     35          </tr>
     36        </table>
    2237      </div>
    23 
    24       <table class="thumbs">
    25         <tr tal:repeat="row pageBatch/pages">
    26           <td tal:repeat="thumb row"
    27             tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')">
    28             <a tal:define="idx thumb/idx" tal:condition="idx"
    29               tal:attributes="href python:here.getLink('pn',idx)">
    30               <img
    31                 tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=100,dh=100,docinfo=docinfo),'images/pic');
    32                                 alt idx" /><br/>
    33               <span title="Scan number" tal:content="idx"/>
    34               <span tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']" title="Original page number" tal:content="python:' (%s)'%(pageNumbers[idx]['no'])"/>
    35             </a>
    36           </td>
    37         </tr>
    38       </table>
    39     </div> <!-- content -->
    40   </div> <!-- toc -->
     38      <!-- content -->
     39    </div>
     40    <!-- toc -->
     41  </div>
    4142</body>
    4243</html>
  • zpt/viewer_images.zpt

    r514 r532  
    2525
    2626  <script type="text/javascript"
    27     tal:content="string:
     27    tal:content="python:'''
    2828       var dlOpts = {
    2929            'interactionMode' : 'fullscreen',
    30             'digilibBaseUrl' : '$dlBaseUrl',
    31             'fn' : '${docinfo/imagePath}',
    32             'pn' : '${pageinfo/pn}',
     30            'digilibBaseUrl' : '%s',
     31            'fn' : '%s',
     32            'pn' : '%s',
    3333            'suppressParamNames' : ['fn'],
    3434            'scalerInsets' : {'x' : 140, 'y' : 100}
    35         };"></script>
     35        };'''%(dlBaseUrl,docinfo.get('imagePath',''),pageinfo.get('pn','1'))"></script>
    3636
    3737  <script type="text/javascript">
     
    7070          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
    7171        </div>
    72         <ul class="switcher">
    73           <li class="sel">Image</li>
    74           <li tal:condition="docpath">
    75             <a tal:attributes="href python:here.getLink('viewMode','text')">Text</a>
    76           </li>
    77         </ul>
    78         <!-- /switcher -->
    7972        <div class="content">
    8073          <div id="scaler">
  • zpt/viewer_text.zpt

    r530 r532  
    1414<script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script>
    1515<script type="text/javascript">
    16     // <!--
    17     $(document).ready(function() {
    18         // autosubmit forms
    19         $('form.autosubmit').find('.autosubmit').change(function() {
    20             this.form.submit();
    21         });
    22         $('form.autosubmit input[type="submit"]').hide();
    23     });
     16        // <!--
     17        $(document).ready(function() {
     18                // autosubmit forms
     19                $('form.autosubmit').find('.autosubmit').change(function() {
     20                        this.form.submit();
     21                });
     22                $('form.autosubmit input[type="submit"]').hide();
     23        });
    2424// -->
    2525</script>
    2626<!--  layer headers (rendered always) -->
    2727<tal:block tal:repeat="layer availableLayers">
    28   <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head"
    29     tal:condition="python:exists(mpath)">
     28  <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
    3029    <metal:block metal:use-macro="python:path(mpath)" />
    3130  </tal:block>
    3231</tal:block>
    33 
    3432</head>
    3533<body tal:condition="numPages">
     
    4341      <metal:block metal:use-macro="here/template/common_template/macros/head" />
    4442    </div>
     43
    4544    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
    4645      <!--table of contents-->
    4746      <div class="col toc">
    48         <metal:block
    49           metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     47        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
    5048      </div>
    5149
     
    5553          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
    5654        </div>
    57         <ul class="switcher">
    58           <li>
    59             <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
    60           </li>
    61           <li class="sel">Text</li>
    62         </ul>
    6355        <div class="content">
    6456          <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
     
    8173        <!--"BEGIN TEXT DISPLAY"  -->
    8274        <div class="options">
    83           <h4>Text display</h4>
     75          <h4>Text layer</h4>
    8476          <form tal:attributes="action viewerUrl" class="autosubmit">
    85             <input type="hidden"
    86               tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
    87               tal:repeat="param params"
    88               tal:attributes="name param; value python:params[param]" />
     77            <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
     78              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    8979            <ul>
    90               <li>
    91                 <input class="autosubmit" type="radio" name="viewMode" value="text"
    92                   tal:attributes="checked python:viewMode=='text'" /> Text
    93                 <ul>
    94                   <!-- text layer select buttons (rendered always) -->
    95                   <tal:block tal:repeat="layer availableLayers">
    96                     <tal:block
    97                       tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
    98                       tal:condition="python:exists(mpath)">
    99                       <li metal:use-macro="python:path(mpath)" />
    100                     </tal:block>
    101                   </tal:block>
    102                 </ul>
    103               </li>
    104               <li>
    105                 <input type="radio" class="autosubmit" name="viewMode" value="xml"
    106                   tal:attributes="checked python:viewMode=='xml'" /> XML<br /> <input
    107                   type="submit" value="Go!" />
    108               </li>
     80              <!-- text layer select buttons (rendered always) -->
     81              <tal:block tal:repeat="layer availableLayers">
     82                <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
     83                  tal:condition="python:exists(mpath)">
     84                  <li metal:use-macro="python:path(mpath)" />
     85                </tal:block>
     86              </tal:block>
    10987            </ul>
    11088          </form>
     
    11391
    11492        <!--"BEGIN TEXT SIZE"-->
    115         <div class="options">
     93        <!--  <div class="options">
    11694          <h4>Text size</h4>
    11795          <ul class="fsizer">
    118             <li>
    119               <a href="javascript:fontSize(12);" class="fs_sml">S</a>
    120             </li>
    121             <li>
    122               <a href="javascript:fontSize(14);" class="fs_med">M</a>
    123             </li>
    124             <li>
    125               <a href="javascript:fontSize(16);" class="fs_lrg">L</a>
    126             </li>
     96            <li><a href="javascript:fontSize(12);" class="fs_sml">S</a></li>
     97            <li><a href="javascript:fontSize(14);" class="fs_med">M</a></li>
     98            <li><a href="javascript:fontSize(16);" class="fs_lrg">L</a></li>
    12799          </ul>
    128         </div>
     100        </div> -->
    129101        <!--"END TEXT SIZE"-->
    130102
     
    136108            <input type="hidden"
    137109              tal:define="params python:here.getParams(params={'characterNormalization':None, 'viewLayer':viewLayer})"
    138               tal:repeat="param params"
    139               tal:attributes="name param; value python:params[param]" />
     110              tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    140111            <ul>
    141               <li>
    142                 <input type="radio" class="autosubmit" name="characterNormalization"
    143                   value="orig" tal:attributes="checked python:norm=='orig'" /> Original
    144               </li>
    145               <li>
    146                 <input type="radio" class="autosubmit" name="characterNormalization"
    147                   value="reg" tal:attributes="checked python:norm=='reg'" /> Regularized
    148               </li>
    149               <li>
    150                 <input type="radio" class="autosubmit" name="characterNormalization"
    151                   value="regPlusNorm" tal:attributes="checked python:norm=='regPlusNorm'" />
    152                 Normalized
    153               </li>
     112              <li><input type="radio" class="autosubmit" name="characterNormalization" value="orig"
     113                tal:attributes="checked python:norm=='orig'" /> Original</li>
     114              <li><input type="radio" class="autosubmit" name="characterNormalization" value="reg"
     115                tal:attributes="checked python:norm=='reg'" /> Regularized</li>
     116              <li><input type="radio" class="autosubmit" name="characterNormalization" value="regPlusNorm"
     117                tal:attributes="checked python:norm=='regPlusNorm'" /> Normalized</li>
    154118            </ul>
    155119            <input type="submit" value="Go!" />
     
    160124        <!--  layer option boxes (rendered if active) -->
    161125        <tal:block tal:repeat="layer availableLayers">
    162           <tal:block
    163             tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
     126          <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/options_box"
    164127            tal:condition="python:exists(mpath)">
    165128            <metal:block metal:use-macro="python:path(mpath)" />
  • zpt/viewer_xml.zpt

    r512 r532  
    4646          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
    4747        </div>
    48         <ul class="switcher">
    49           <li>
    50             <a tal:attributes="href python:here.getLink('viewMode','images')">Image</a>
    51           </li>
    52           <li class="sel">Text</li>
    53         </ul>
    5448        <div class="content">
    5549          <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle"
     
    6256      <!-- right-side options -->
    6357      <div class="col buttons">
    64         <!--"BEGIN TEXT DISPLAY"  -->
    65         <div class="options">
    66           <h4>Text display</h4>
    67           <form tal:attributes="action viewerUrl" class="autosubmit">
    68             <input type="hidden"
    69               tal:define="params python:here.getParams(params={'viewMode':None})"
    70               tal:repeat="param params"
    71               tal:attributes="name param; value python:params[param]" />
    72             <ul>
    73               <li>
    74                 <input class="autosubmit" type="radio" name="viewMode" value="text"
    75                   tal:attributes="checked python:viewMode=='text'" /> Text
    76               </li>
    77               <li>
    78                 <input type="radio" class="autosubmit" name="viewMode" value="text"
    79                   tal:attributes="checked python:viewMode=='xml'" /> XML
    80               </li>
    81             </ul>
    82             <input type="submit" value="Go!" />
    83           </form>
    84         </div>
    85         <!--"END TEXT DISPLAY"-->
    86 
    8758        <!--"BEGIN TEXT SIZE"-->
    88         <div class="options">
     59        <!-- <div class="options">
    8960          <h4>Text size</h4>
    9061          <ul class="fsizer">
     
    9970            </li>
    10071          </ul>
    101         </div>
     72        </div> -->
    10273        <!--"END TEXT SIZE"-->
    10374
Note: See TracChangeset for help on using the changeset viewer.