view zpt/viewer_index.zpt @ 539:37d122560028

more nicer
author casties
date Wed, 15 Aug 2012 16:59:45 +0200
parents dbf25bd05fc6
children 4b43a57ad9b3
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;
                  docpath docinfo/textURLPath | nothing;
                  query nothing;
                  numPages docinfo/numPages | nothing;">
<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" href="template/docuviewer_css" type="text/css" />
</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 | nothing"
        tal:attributes="href python:context.getLink(params={'viewMode':'auto','pn':tp})"><img tal:condition="tp" border="0"
        tal:attributes="src string:${docinfo/imageURL}&pn=$tp&dw=300&dh=500" /><img
        tal:condition="python:not tp and exists('here/template/book.png')" border="0" src="template/book.png" /></a>
    </div>

    <div class="col">
      <div class="index-info">
        <h2>Bibliographical information</h2>
        <table border="0"
          tal:define="formattedData python:here.metadata.getBibFormattedMetaDataExtended(bibdata=docinfo.get('bib', None))">
          <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:x condition="exists:docinfo/bib">
              <tr tal:define="bibinfo docinfo/bib" tal:repeat="bib bibinfo">
                <td class="type" tal:content="python:bib.capitalize().replace('_',' ') + ':'" />
                <td class="content" tal:content="bibinfo/bib" />
              </tr>
            </tal:x>

            <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 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="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></td></tr>
        </table>        
        </tal:block>
      </div>

      <div class="index-actions">
        <div class="action">
          <a class="openbutton" tal:attributes="href python:context.getLink('viewMode','auto')">&#8594;Browse document</a>
        </div>
        <div class="action" tal:condition="docpath">
          Download full document as <a
            tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath.replace('.xml','.html'))"
            target="_blank">&#8594;HTML</a> or <a
            tal:attributes="href python:'http://mpdl-system.mpiwg-berlin.mpg.de/mpdl/getDoc?doc=%s'%(docpath)" target="_blank">&#8594;XML</a>
        </div>
        <div class="action">
          <!--BEGIN search -->
          <form tal:condition="docpath" tal:attributes="action python:here.getLink()">
            <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" tal:repeat="param params"
              tal:attributes="name param; value python:params[param]" /> <input class="textMain" name="query"
              onfocus="this.select();" type="text" tal:attributes="value query" /> <input type="submit" class="buttonMain"
              value="Search in Book" />
          </form>
          <!-- END search-->
        </div>
      </div>
    </div>
  </div>
</body>
<body tal:condition="not:numPages">
  <div class="errortext">Sorry, document doesn't exist.</div>
</body>
</html>