view zpt/viewer/viewer_index.zpt @ 606:37ad612edf5a

fixed bug in indexonly with no image.
author casties
date Tue, 11 Dec 2012 16:33:12 -0500
parents 530a9a024450
children
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"
  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
                  tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
                  viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
                  availableLayers python:here.getAvailableLayers().get('index', None);
                  docpath docinfo/textURLPath | nothing;
                  query nothing;
                  numPages docinfo/numPages | nothing;
                  global formattedData python:here.metadata.getBibFormattedMetaData(bibdata=docinfo.get('bib', None));">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title tal:content="python:docinfo.get('creator',' ') + ' - ' + docinfo.get('title',' ')" />
<link rel="stylesheet" tal:attributes="href string:$viewerUrl/template/docuviewer_css" type="text/css" />
<script type="text/javascript" tal:attributes="src string:$viewerUrl/template/jquery_js"></script>
<script type="text/javascript">
// <!--
	$(document).ready(function() {
		// autosubmit forms
		$('form.autosubmit').find('.autosubmit').change(function() {
			this.form.submit();
		});
		$('form.autosubmit input[type="submit"]').hide();
	});
// -->
</script>
<!--  layer headers (all available) -->
<tal:block tal:repeat="layer availableLayers">
  <tal:block tal:define="mpath string:here/template/layer_index_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
    <metal:block metal:use-macro="python:path(mpath)" />
  </tal:block>
</tal:block>
</head>
<body tal:condition="numPages">
  <!-- header -->
  <div class="page-head">
    <metal:block metal:use-macro="here/template/common_template/macros/head" />
  </div>

  <!-- main -->
  <div class="page-body">

    <div class="col index-image">
      <!-- image -->
      <a tal:define="tp docinfo/titlePage | string:1"
        tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img tal:condition="python:docinfo.get('imageURL',None) and tp" border="0"
        tal:attributes="src python:'%s&pn=%s&dw=300&dh=500'%(docinfo.get('imageURL',None),tp)" /><img
        tal:condition="python:(not docinfo.get('imageURL',None)) and exists('here/template/book.png')" border="0"
        src="template/book.png" /></a>
    </div>

    <div class="col main">
      <!-- main content column -->
      <div class="index-info">
        <h2>Bibliographic information</h2>
        <table border="0">
          <tal:x condition="python:formattedData">
            <!-- wenn es bibinfo in docinfo gibt -->
            <tr tal:replace="structure python:formattedData" />
          </tal:x>

          <tal:x condition="not:formattedData">
            <!-- kein template fuer die daten -->
            <tal:block condition="exists:docinfo/bib">
              <tal:block tal:define="bibinfo docinfo/bib" tal:repeat="bib bibinfo">
                <tr tal:condition="python:bib[0]!='@'">
                  <td class="type" tal:content="python:bib.capitalize().replace('_',' ') + ':'" />
                  <td class="content" tal:content="python:bibinfo[bib]" />
                </tr>
              </tal:block>
            </tal:block>

            <tal:y condition="not:exists:docinfo/bib">
              <!-- wenn es kein bibinfo gibt (archimedes-texte) -->
              <tr>
                <td class="type">Author:</td>
                <td class="content" tal:content="docinfo/creator" />
              </tr>
              <tr>
                <td class="type">Title:</td>
                <td class="content" tal:content="docinfo/title" />
              </tr>
              <tr>
                <td class="type">Date:</td>
                <td class="content" tal:content="docinfo/date" />
              </tr>
            </tal:y>
          </tal:x>
          <!-- ende kein template fuer die daten -->
        </table>

        <tal:block tal:define="dri docinfo/DRI | nothing" tal:condition="dri">
          <h2>Permanent URL</h2>
          <table>
            <tr>
              <td class="type">Document ID:</td>
              <td class="content" tal:content="dri" />
            </tr>
            <tr>
              <td class="type">Permanent URL:</td>
              <td class="content"><a target="_blank" tal:attributes="href string:http://echo.mpiwg-berlin.mpg.de/$dri"
                tal:content="string:http://echo.mpiwg-berlin.mpg.de/$dri" /></td>
            </tr>
          </table>
        </tal:block>

        <tal:block tal:define="ctxs docinfo/presentationContext | nothing" tal:condition="ctxs">
          <h2>Presentation context</h2>
          <ul>
            <li tal:repeat="ctx ctxs"><a tal:define="link ctx/link | nothing; name ctx/name | link;" tal:content="name"
              tal:attributes="href link" target="_blank" tal:omit-tag="not:link" /></li>
          </ul>
        </tal:block>

        <tal:block tal:define="attribution docinfo/attribution | nothing; copyright docinfo/copyright | nothing">
          <h2>Copyright information</h2>
          <table border="0" tal:condition="attribution | copyright">
            <!-- attribution -->
            <tr tal:condition="attribution"
              tal:replace="structure python:here.metadataService.getAttributionFormatted('metadata_template', data=attribution)" />
            <!-- copyright -->
            <tr tal:condition="copyright"
              tal:replace="structure python:here.metadataService.getCopyrightFormatted('metadata_template', data=copyright)" />
          </table>
          <table border="0" tal:condition="not:attribution | copyright">
            <tr>
              <td class="type">Copyright:</td>
              <td class="content"><a target="_blank" href="http://www.mpiwg-berlin.mpg.de">Max Planck Institute for the
                  History of Science</a> (unless stated otherwise)</td>
            </tr>
            <tr tal:define="accType python:docinfo.get('accessType', None)">
              <td class="type">License:</td>
              <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> (unless stated otherwise)</td>
              <td tal:condition="python:accType != 'free'" class="content">Internal use only<span tal:condition="accType"
                tal:content="string: ($accType)" />, please contact <a href="mailto:library@mpiwg-berlin.mpg.de">library@mpiwg-berlin.mpg.de</a>
                (unless stated otherwise)
              </td>
            </tr>
          </table>
        </tal:block>
      </div>
    </div>
    <!-- /main content column -->

    <div class="col buttons">
      <!-- option block column -->
      <div class="options">
        <h4>Browse</h4>
        <ul class="list">
          <li><a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">View full document</a></li>
        </ul>
      </div>

      <div class="options" tal:condition="docpath">
        <h4>Download</h4>
        Download full document
        <ul class="list">
          <li><a target="_blank" rel="nofollow" class="download"
            tal:attributes="href python:here.getTextDownloadUrl(type='html',docinfo=docinfo)" target="_blank">as HTML</a></li>
          <li><a target="_blank" rel="nofollow" class="download"
            tal:attributes="href python:here.getTextDownloadUrl(type='xml',docinfo=docinfo)" target="_blank">as XML</a></li>
        </ul>
        (copyright and license see below)
      </div>

      <div class="options" tal:condition="docpath">
        <h4>Search</h4>
        <form tal:define="queryType string:fulltextMorph" tal:condition="docpath" tal:attributes="action viewerUrl">
          <input type="hidden"
            tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewMode':None,'viewLayer':'search'})"
            tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
          <!-- query text -->
          <input type="text" name="query" tal:attributes="value query" /> <br /> <input type="submit" value="Search" /> <a
            tal:condition="query" tal:attributes="href python:here.getLink('query',None)">Clear</a>
          <ul>
            <li><input type="radio" name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" />
              Exact</li>
            <li><input type="radio" name="queryType" value="fulltextMorph"
              tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms</li>
            <li><input type="radio" name="queryType" value="ftIndex" tal:attributes="checked python:queryType=='ftIndex'" />
              Fulltext index</li>
            <li><input type="radio" name="queryType" value="ftIndexMorph"
              tal:attributes="checked python:queryType=='ftIndexMorph'" /> Morphological index</li>
          </ul>
        </form>
      </div>

      <div class="options" tal:condition="availableLayers">
        <h4>Metadata</h4>
        <form tal:attributes="action viewerUrl" class="autosubmit">
          <input type="hidden" tal:define="params python:here.getParams(params={'viewLayer':None})" tal:repeat="param params"
            tal:attributes="name param; value python:params[param]" />
          <ul>
            <!-- text layer select buttons (rendered always) -->
            <tal:block tal:repeat="layer availableLayers">
              <tal:block tal:define="mpath string:here/template/layer_index_${layer}/macros/layer_select_li"
                tal:condition="python:exists(mpath)">
                <li metal:use-macro="python:path(mpath)" />
              </tal:block>
            </tal:block>
          </ul>
          <input type="submit" value="Go!" />
        </form>
      </div>
    </div>
    <!-- /option block column -->
  </div>
  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
    <!-- footer -->
    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer" />
  </tal:block>

</body>
<body tal:condition="not:numPages">
  <div class="errortext">Sorry, document doesn't exist.</div>
  <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer">
    <!-- footer -->
    <metal:block metal:use-macro="here/template/site_template.pt/macros/footer" />
  </tal:block>
</body>
</html>