Changeset 489:55e3398e395e in documentViewer


Ignore:
Timestamp:
Aug 25, 2011, 3:05:22 PM (13 years ago)
Author:
casties
Branch:
elementtree
Message:

more new templates. monkey-patch for App.ImageFile?.

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • css/docuviewer.css

    r488 r489  
    1616}
    1717
    18 div.col-left.text {
     18div.toc-text, div.toc-figures {
    1919    max-width: 20em;
    2020}
  • documentViewer.py

    r488 r489  
    33from Products.PageTemplates.PageTemplateFile import PageTemplateFile
    44from App.ImageFile import ImageFile
     5from App.Common import rfc1123_date
    56#from Products.ZSimpleFile.ZSimpleFile import ZSimpleFile
    67from AccessControl import ClassSecurityInfo
     
    1011import xml.etree.ElementTree as ET
    1112
    12 import os.path
     13import os
     14import stat
    1315import sys
    1416import urllib
     
    105107    return '/'.join(path.split('/')[0:-cnt])
    106108
     109def devImageFileIndexHtml(self, REQUEST, RESPONSE):
     110    """index_html method for App.ImageFile that updates the file info for each request."""
     111    stat_info = os.stat(self.path)
     112    self.size = stat_info[stat.ST_SIZE]
     113    self.lmt = float(stat_info[stat.ST_MTIME]) or time.time()
     114    self.lmh = rfc1123_date(self.lmt)
     115    # call original method
     116    return ImageFile.index_html(self, REQUEST, RESPONSE)
    107117
    108118##
     
    137147    head_main = PageTemplateFile('zpt/head_main', globals())
    138148    info_xml = PageTemplateFile('zpt/info_xml', globals())
    139     # TODO: can this be nicer?
    140149    docuviewer_css = ImageFile('css/docuviewer.css',globals())
     150    # make ImageFile better for development
     151    docuviewer_css.index_html = devImageFileIndexHtml
    141152   
    142153   
  • zpt/head_main.zpt

    r480 r489  
    1313               bib docinfo/bib | nothing; bibType docinfo/bibType | nothing;
    1414               formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);">
    15     <span tal:condition="not:formattedLabel"
     15    <div tal:condition="not:formattedLabel"
    1616      tal:content="string:(no bibliographical information for ${bibType})" />
    17     <span tal:condition="formattedLabel" tal:content="structure formattedLabel" />
     17    <div tal:condition="formattedLabel" tal:content="structure formattedLabel" />
    1818  </metal:block>
    1919</body>
  • zpt/toc_figures.zpt

    r488 r489  
    77<body>
    88  <!-- block used for main content area -->
    9   <div class="col-left" metal:define-macro="main"
     9  <div class="toc-figures" metal:define-macro="main"
    1010    tal:define="start pageinfo/start; tocsize docinfo/tocSize_figures; grpsize pageinfo/tocPageSize;
    1111                batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
  • zpt/toc_text.zpt

    r488 r489  
    77<body>
    88  <!-- block used for main content area -->
    9   <div class="col-left" metal:define-macro="main"
     9  <div class="toc-text" metal:define-macro="main"
    1010    tal:define="start pageinfo/start; tocsize docinfo/tocSize_text; grpsize pageinfo/tocPageSize;
    1111                batch python:here.getBatch(start=start,size=grpsize,end=tocsize);">
  • zpt/toc_thumbs.zpt

    r488 r489  
    77<body>
    88  <!-- block used for main content area -->
    9   <div class="col-left" metal:define-macro="main"
     9  <div class="toc-thumbs" metal:define-macro="main"
    1010    tal:define="start pageinfo/start;
    1111                grpsize pageinfo/groupsize;
  • zpt/viewer_images.zpt

    r485 r489  
    5454    <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
    5555      <!--table of contents-->
    56       <div class="col-left" metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     56      <div class="col-left">
     57        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     58      </div>
    5759      <!-- text page -->
    5860      <div class="col-main">
  • zpt/viewer_text.zpt

    r485 r489  
    2222  <div class="page-body" tal:condition="python:here.isAccessible(docinfo)">
    2323    <!--table of contents-->
    24     <div class="col-left"
    25       metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     24    <div class="col-left">
     25      <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     26    </div>
    2627
    2728    <!-- text page -->
Note: See TracChangeset for help on using the changeset viewer.