Changeset 578:024b75162437 in documentViewer


Ignore:
Timestamp:
Oct 19, 2012, 4:51:47 PM (12 years ago)
Author:
casties
Branch:
default
Message:

displays context data on index page

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r577 r578  
    631631            dri = self.metadataService.getDRI(dom=metaDom, type='escidoc')
    632632            if dri:
    633                 logging.debug("getDRI: dri=%s"%repr(dri))
    634633                docinfo['DRI'] = dri
     634
     635            # (presentation) context
     636            ctx = self.metadataService.getContextData(dom=metaDom, all=True)
     637            if ctx:
     638                logging.debug("getcontext: ctx=%s"%repr(ctx))
     639                docinfo['presentationContext'] = ctx
    635640
    636641        # image path
  • version.txt

    r569 r578  
    1 DocumentViewer 2.2.5
     1DocumentViewer 2.2.6
  • zpt/viewer_index.zpt

    r562 r578  
    1616<script type="text/javascript" tal:attributes="src string:$viewerUrl/template/jquery_js"></script>
    1717<script type="text/javascript">
    18 // <!--
    19   $(document).ready(function() {
    20     // autosubmit forms
    21     $('form.autosubmit').find('.autosubmit').change(function() {
    22       this.form.submit();
    23     });
    24     $('form.autosubmit input[type="submit"]').hide();
    25   });
     18        $(document).ready(function() {
     19                // autosubmit forms
     20                $('form.autosubmit').find('.autosubmit').change(function() {
     21                        this.form.submit();
     22                });
     23                $('form.autosubmit input[type="submit"]').hide();
     24        });
    2625// -->
    2726</script>
     
    4746        tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img tal:condition="tp" border="0"
    4847        tal:attributes="src python:'%s&pn=%s&dw=300&dh=500'%(docinfo.get('imageURL',None),tp)" /><img
    49         tal:condition="python:not docinfo.get('titlePage',None) and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
     48        tal:condition="python:not docinfo.get('titlePage',None) and exists('here/template/book.png')" border="0"
     49        src="template/book.png" /></a>
    5050    </div>
    5151
    5252    <div class="col main">
    53      <!-- main content column -->
     53      <!-- main content column -->
    5454      <div class="index-info">
    5555        <h2>Bibliographic information</h2>
     
    101101            </tr> -->
    102102          </table>
     103        </tal:block>
     104
     105        <tal:block tal:define="ctxs docinfo/presentationContext | nothing">
     106          <h2>Presentation context</h2>
     107          <ul>
     108            <li tal:repeat="ctx ctxs"><a tal:define="link ctx/link | nothing; name ctx/name | link;" tal:content="name"
     109              tal:attributes="href link" target="_blank" tal:omit-tag="not:link" /></li>
     110          </ul>
    103111        </tal:block>
    104112
     
    121129            <tr tal:define="accType python:docinfo.get('accessType', None)">
    122130              <td class="type">License:</td>
    123               <td tal:condition="python:accType == 'free'" class="content"><a target="_blank" href="http://creativecommons.org/licenses/by-sa/3.0/de/">CC-BY-SA</a>
    124                 (unless stated otherwise)</td>
    125               <td tal:condition="python:accType != 'free'" class="content">Internal use only<span tal:condition="accType" tal:content="string: ($accType)"/>,
    126                 please contact <a href="mailto:library@mpiwg-berlin.mpg.de">library@mpiwg-berlin.mpg.de</a>
    127                 (unless stated otherwise)</td>
     131              <td tal:condition="python:accType == 'free'" class="content"><a target="_blank"
     132                href="http://creativecommons.org/licenses/by-sa/3.0/de/">CC-BY-SA</a> (unless stated otherwise)</td>
     133              <td tal:condition="python:accType != 'free'" class="content">Internal use only<span tal:condition="accType"
     134                tal:content="string: ($accType)" />, please contact <a href="mailto:library@mpiwg-berlin.mpg.de">library@mpiwg-berlin.mpg.de</a>
     135                (unless stated otherwise)
     136              </td>
    128137            </tr>
    129138          </table>
    130139        </tal:block>
    131140      </div>
    132     </div> <!-- /main content column -->
    133    
     141    </div>
     142    <!-- /main content column -->
     143
    134144    <div class="col buttons">
    135       <!-- option block column --> 
     145      <!-- option block column -->
    136146      <div class="options">
    137147        <h4>Browse</h4>
     
    146156        <ul class="list">
    147157          <li><a target="_blank" rel="nofollow" class="download"
    148             tal:attributes="href python:here.getTextDownloadUrl(type='html',docinfo=docinfo)"
    149             target="_blank">as HTML</a></li>
     158            tal:attributes="href python:here.getTextDownloadUrl(type='html',docinfo=docinfo)" target="_blank">as HTML</a></li>
    150159          <li><a target="_blank" rel="nofollow" class="download"
    151             tal:attributes="href python:here.getTextDownloadUrl(type='xml',docinfo=docinfo)" target="_blank">as
    152               XML</a></li>
     160            tal:attributes="href python:here.getTextDownloadUrl(type='xml',docinfo=docinfo)" target="_blank">as XML</a></li>
    153161        </ul>
    154162        (copyright and license see below)
     
    180188        <h4>Metadata</h4>
    181189        <form tal:attributes="action viewerUrl" class="autosubmit">
    182           <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})"
    183             tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
     190          <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})" tal:repeat="param params"
     191            tal:attributes="name param; value python:params[param]" />
    184192          <ul>
    185193            <!-- text layer select buttons (rendered always) -->
     
    194202        </form>
    195203      </div>
    196     </div> <!-- /option block column -->     
     204    </div>
     205    <!-- /option block column -->
    197206  </div>
    198207  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
Note: See TracChangeset for help on using the changeset viewer.