Changeset 558:6ab436383fca in documentViewer


Ignore:
Timestamp:
Sep 28, 2012, 9:25:25 AM (12 years ago)
Author:
casties
Branch:
default
Message:

first step to layers for index view.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r552 r558  
    129129    # available layer types (annotator not default)
    130130    builtinLayers = {'text': ['dict','search','gis'],
    131                      'xml': None, 'images': None, 'index': None}
     131                     'xml': None, 'images': None, 'index': ['extended']}
    132132    availableLayers = builtinLayers;
    133133    # layer templates
  • zpt/viewer_index.zpt

    r550 r558  
    44  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
    55                  tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
     6                  viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
     7                  availableLayers python:here.getAvailableLayers().get('index', None);
    68                  docpath docinfo/textURLPath | nothing;
    79                  query nothing;
     
    1113<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
    1214<link rel="stylesheet" href="template/docuviewer_css" type="text/css" />
     15<!--  layer headers (rendered always) -->
     16<tal:block tal:repeat="layer availableLayers">
     17  <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
     18    <metal:block metal:use-macro="python:path(mpath)" />
     19  </tal:block>
     20</tal:block>
    1321</head>
    1422<body tal:condition="numPages">
     
    109117    <div class="col buttons">
    110118      <div class="options">
     119        <h4>Metadata</h4>
     120        <form tal:attributes="action viewerUrl" class="autosubmit">
     121          <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None,'viewMode':None})"
     122            tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
     123          <ul>
     124            <!-- text layer select buttons (rendered always) -->
     125            <tal:block tal:repeat="layer availableLayers">
     126              <tal:block tal:define="mpath string:here/template/layer_text_${layer}/macros/layer_select_li"
     127                tal:condition="python:exists(mpath)">
     128                <li metal:use-macro="python:path(mpath)" />
     129              </tal:block>
     130            </tal:block>
     131          </ul>
     132          <input type="submit" value="Go!" />
     133        </form>
     134      </div>
     135
     136      <div class="options">
    111137        <h4>Browse</h4>
    112138        <ul class="list">
    113         <li><a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">View full document</a></li>
     139          <li><a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">View full document</a></li>
    114140        </ul>
    115141      </div>
     
    123149            target="_blank">as HTML</a></li>
    124150          <li><a target="_blank"
    125             tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">as XML</a></li>
     151            tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">as
     152              XML</a></li>
    126153        </ul>
    127154        (copyright and license see below)
     
    131158        <h4>Search</h4>
    132159        <form tal:define="queryType string:fulltextMorph" tal:condition="docpath" tal:attributes="action viewerUrl">
    133           <input type="hidden" tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewMode':None,'viewLayer':'search'})"
     160          <input type="hidden"
     161            tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewMode':None,'viewLayer':'search'})"
    134162            tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
    135163          <!-- query text -->
     
    153181  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
    154182    <!-- footer -->
    155     <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
     183    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer" />
    156184  </tal:block>
    157  
     185
    158186</body>
    159187<body tal:condition="not:numPages">
     
    161189  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
    162190    <!-- footer -->
    163     <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/>
     191    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer" />
    164192  </tal:block>
    165193</body>
Note: See TracChangeset for help on using the changeset viewer.