Changeset 590:ed4485d2748e in documentViewer


Ignore:
Timestamp:
Nov 16, 2012, 10:44:21 AM (12 years ago)
Author:
casties
Branch:
default
Message:

viewMode "images" changed to "image".

Files:
3 edited
2 moved

Legend:

Unmodified
Added
Removed
  • css/docuviewer.css

    r583 r590  
    373373 * image page
    374374 */
    375 div.col.main div.content.images {
     375div.col.main div.content.image {
    376376        background-color: inherit;
    377377        padding: 0;
    378378}
    379 div.col.main div.content.images table {
     379div.col.main div.content.image table {
    380380        border-collapse: collapse; /* for tight digilib */
    381381}
  • documentViewer.py

    r589 r590  
    9090    viewer_text = PageTemplateFile('zpt/viewer_text', globals())
    9191    viewer_xml = PageTemplateFile('zpt/viewer_xml', globals())
    92     viewer_images = PageTemplateFile('zpt/viewer_images', globals())
     92    viewer_image = PageTemplateFile('zpt/viewer_image', globals())
    9393    viewer_index = PageTemplateFile('zpt/viewer_index', globals())
    9494    viewer_thumbs = PageTemplateFile('zpt/viewer_thumbs', globals())
     
    9696    # available layer types (annotator not default)
    9797    builtinLayers = {'text': ['dict','search','gis'],
    98                      'xml': None, 'images': None, 'index': ['extended']}
     98                     'xml': None, 'image': None, 'index': ['extended']}
    9999    availableLayers = builtinLayers;
    100100    # layer templates
     
    104104    layer_text_gis = PageTemplateFile('zpt/layer_text_gis', globals())
    105105    layer_text_pundit = PageTemplateFile('zpt/layer_text_pundit', globals())
    106     layer_images_annotator = PageTemplateFile('zpt/layer_images_annotator', globals())
     106    layer_image_annotator = PageTemplateFile('zpt/layer_image_annotator', globals())
    107107    layer_index_extended = PageTemplateFile('zpt/layer_index_extended', globals())
    108108    # toc templates
     
    211211        @param mode: defines how to access the document behind url
    212212        @param url: url which contains display information
    213         @param viewMode: if images display images, if text display text, default is images (text,images or auto)
     213        @param viewMode: image: display images, text: display text, default is auto (try text, else image)
    214214       
    215215        '''
    216216       
    217217        if not hasattr(self, 'template'):
    218             # create template folder if it doesn't exist
    219             self.manage_addFolder('template')
    220            
     218            # this won't work
     219            logging.error("template folder missing!")
     220            return "ERROR: template folder missing!"
     221                       
    221222        if not self.digilibBaseUrl:
    222223            self.digilibBaseUrl = self.findDigilibUrl() or "http://nausikaa.mpiwg-berlin.mpg.de/digitallibrary"
     
    232233                viewMode="text"
    233234            else:
    234                 viewMode="images"
     235                viewMode="image"
    235236               
    236237        return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode)
     
    243244        @param url: url which contains display information
    244245        @param mode: defines how to access the document behind url
    245         @param viewMode: 'images': display images, 'text': display text, 'xml': display xml, default is 'auto'
     246        @param viewMode: 'image': display images, 'text': display text, 'xml': display xml, default is 'auto'
    246247        @param viewLayer: sub-type of viewMode, e.g. layer 'dict' for viewMode='text'
    247248        @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none)
     
    280281                    viewLayer = "dict"
    281282            else:
    282                 viewMode = "images"
     283                viewMode = "image"
    283284               
    284285        elif viewMode == "text_dict":
     
    287288            viewLayer = "dict"
    288289           
     290        elif viewMode == 'images':
     291            # legacy fix
     292            viewMode = 'image'
     293            self.REQUEST['viewMode'] = 'image'
     294
    289295        # safe viewLayer in userinfo
    290296        userinfo['viewLayer'] = viewLayer
     
    405411            try:
    406412                layers = json.loads(newLayerString)
    407                 if 'text' in layers and 'images' in layers:
     413                if 'text' in layers and 'image' in layers:
    408414                    self.availableLayers = layers
    409415                    return
  • zpt/common_template.zpt

    r584 r590  
    2828        <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'text')"><a
    2929          tal:omit-tag="python:viewMode=='text'" tal:attributes="href python:here.getLink('viewMode','text')">Text</a></li>
    30         <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'images')"><a
    31           tal:omit-tag="python:viewMode=='images'" tal:attributes="href python:here.getLink('viewMode','images')">Image</a></li>
     30        <li tal:condition="python:docinfo.get('imagePath',None)" tal:attributes="class python:here.getStyle(viewMode, 'image')"><a
     31          tal:omit-tag="python:viewMode=='image'" tal:attributes="href python:here.getLink('viewMode','image')">Image</a></li>
    3232        <li tal:condition="docpath" tal:attributes="class python:here.getStyle(viewMode, 'xml')"><a
    3333          tal:omit-tag="python:viewMode=='xml'" tal:attributes="href python:here.getLink('viewMode','xml')">XML</a></li>
  • zpt/viewer_image.zpt

    r585 r590  
    44  tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode;
    55              viewLayer pageinfo/viewLayer; viewLayers pageinfo/viewLayers;
    6               availableLayers python:here.getAvailableLayers().get('images', None);
     6              availableLayers python:here.getAvailableLayers().get('image', None);
    77              tocMode pageinfo/tocMode; viewerUrl docinfo/viewerUrl;
    88              numPages docinfo/numPages | nothing; dlBaseUrl docinfo/digilibBaseUrl | nothing;">
     
    3232<!--  layer headers (rendered always) -->
    3333<tal:block tal:repeat="layer availableLayers">
    34   <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
     34  <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/html_head" tal:condition="python:exists(mpath)">
    3535    <metal:block metal:use-macro="python:path(mpath)" />
    3636  </tal:block>
     
    7171          <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" />
    7272        </div>
    73         <div class="content images">
     73        <div class="content image">
    7474          <div id="scaler">
    7575            <img tal:attributes="src string:${docinfo/imageURL}&pn=${pageinfo/pn}&dw=500&dh=500" />
     
    9090              <!-- layer select buttons (rendered always) -->
    9191              <tal:block tal:repeat="layer availableLayers">
    92                 <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/layer_select_li"
     92                <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/layer_select_li"
    9393                  tal:condition="python:exists(mpath)">
    9494                  <li metal:use-macro="python:path(mpath)" />
     
    138138        <!--  layer option boxes (rendered if active) -->
    139139        <tal:block tal:repeat="layer availableLayers">
    140           <tal:block tal:define="mpath string:here/template/layer_images_${layer}/macros/options_box"
     140          <tal:block tal:define="mpath string:here/template/layer_image_${layer}/macros/options_box"
    141141            tal:condition="python:exists(mpath)">
    142142            <metal:block metal:use-macro="python:path(mpath)" />
Note: See TracChangeset for help on using the changeset viewer.