Changeset 543:6cdc31e9ed8e in documentViewer
- Timestamp:
- Aug 22, 2012, 2:25:38 PM (13 years ago)
- Branch:
- default
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
css/docuviewer.css
r542 r543 253 253 line-height: 1.3; 254 254 } 255 255 div.col.main div.content.text div.emptyPage { 256 font-family: Verdana,Arial,sans-serif; 257 font-size: 12px; 258 } 256 259 /* 257 260 * search results … … 326 329 } 327 330 328 329 330 331 /* 331 332 * thumbnail overview … … 338 339 text-align: center; 339 340 } 341 342 /* 343 * footer 344 */ 345 div.footer { 346 max-width: 68em; 347 margin-top: 1em; 348 border-top: 1px solid silver; 349 margin-left: 28px; 350 margin-right: 28px; 351 text-align: center; 352 } 353 div.footer div.content { 354 font-size: 10px; 355 color: grey; 356 } 357 div.footer div.content a:link, 358 div.footer div.content a:visited { 359 color: grey; 360 } -
documentViewer.py
r541 r543 261 261 def index_html(self,url,mode="texttool",viewMode="auto",viewLayer=None,tocMode="thumbs",start=1,pn=1): 262 262 """ 263 view page263 show page 264 264 @param url: url which contains display information 265 265 @param mode: defines how to access the document behind url 266 266 @param viewMode: 'images': display images, 'text': display text, 'xml': display xml, default is 'auto' 267 @param viewLayer: sub-type of viewMode, e.g. 'dict' for viewMode='text'267 @param viewLayer: sub-type of viewMode, e.g. layer 'dict' for viewMode='text' 268 268 @param tocMode: type of 'table of contents' for navigation (thumbs, text, figures, none) 269 269 """ … … 279 279 self.digilibBaseUrl = self.findDigilibUrl() or "http://digilib.mpiwg-berlin.mpg.de/digitallibrary" 280 280 281 # docinfo: information about document (cached) 281 282 docinfo = self.getDocinfo(mode=mode,url=url,tocMode=tocMode) 283 284 # userinfo: user settings (cached) 285 userinfo = self.getUserinfo() 282 286 283 287 # auto viewMode: text if there is a text else images … … 286 290 # docinfo.get('textURL', None) not implemented yet 287 291 viewMode = "text" 288 if viewLayer is None: 292 if viewLayer is None and 'viewLayer' not in userinfo: 293 # use layer dict as default 289 294 viewLayer = "dict" 290 295 else: … … 296 301 viewLayer = "dict" 297 302 298 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, viewMode=viewMode, viewLayer=viewLayer, tocMode=tocMode) 303 # safe viewLayer in userinfo 304 userinfo['viewLayer'] = viewLayer 305 306 # pageinfo: information about page (not cached) 307 pageinfo = self.getPageinfo(start=start, current=pn, docinfo=docinfo, userinfo=userinfo, viewMode=viewMode, viewLayer=viewLayer, tocMode=tocMode) 299 308 300 309 # get template /template/viewer_$viewMode … … 495 504 496 505 506 def getUserinfo(self): 507 """returns userinfo object""" 508 logging.debug("getUserinfo") 509 userinfo = {} 510 # look for cached userinfo in session 511 if self.REQUEST.SESSION.has_key('userinfo'): 512 userinfo = self.REQUEST.SESSION['userinfo'] 513 # check if its still current? 514 else: 515 # store in session 516 self.REQUEST.SESSION['userinfo'] = userinfo 517 518 return userinfo 519 497 520 def getDocinfo(self, mode, url, tocMode=None): 498 521 """returns docinfo depending on mode""" … … 772 795 773 796 774 def getPageinfo(self, current=None, start=None, rows=None, cols=None, docinfo=None, viewMode=None, viewLayer=None, tocMode=None):797 def getPageinfo(self, current=None, start=None, rows=None, cols=None, docinfo=None, userinfo=None, viewMode=None, viewLayer=None, tocMode=None): 775 798 """returns pageinfo with the given parameters""" 776 799 logging.debug("getPageInfo(current=%s, start=%s, rows=%s, cols=%s, viewMode=%s, viewLayer=%s, tocMode=%s)"%(current,start,rows,cols,viewMode,viewLayer,tocMode)) -
version.txt
r535 r543 1 DocumentViewer 2.2. 01 DocumentViewer 2.2.2 -
zpt/common_template.zpt
r536 r543 12 12 bib docinfo/bib | nothing; bibType docinfo/bibType | nothing; 13 13 formattedLabel python:here.metadataService.getBibFormattedLabel(bibdata=bib);"> 14 <div class="logo" tal:condition="exists:here/template/ logo.png">15 < img tal:attributes="src here/template/logo.png/absolute_url"/>14 <div class="logo" tal:condition="exists:here/template/site_template.pt/macros/logo"> 15 <metal:block metal:use-macro="here/template/site_template.pt/macros/logo"/> 16 16 </div> 17 17 <div class="title-block"> -
zpt/layer_text_gis.zpt
r526 r543 31 31 pidlist python:','.join([p['id'] for p in places]);"> 32 32 <h4>Places</h4> 33 <ul> 33 Show all places 34 <ul class="list"> 34 35 <li> 35 36 <a -
zpt/viewer_images.zpt
r540 r543 111 111 <div class="errortext">Sorry, access to this document is restricted.</div> 112 112 </div> 113 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 114 <!-- footer --> 115 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 116 </tal:block> 117 113 118 </tal:block> 114 119 </body> 115 120 <body tal:condition="not:numPages"> 116 121 <div class="errortext">Sorry, document doesn't exist.</div> 122 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 123 <!-- footer --> 124 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 125 </tal:block> 117 126 </body> 118 127 </html> -
zpt/viewer_index.zpt
r542 r543 128 128 </div> 129 129 130 <div class="options" >130 <div class="options" tal:condition="docpath"> 131 131 <h4>Search</h4> 132 132 <form tal:define="queryType string:fulltextMorph" tal:condition="docpath" tal:attributes="action viewerUrl"> 133 <input type="hidden" tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewMode':None,'viewLayer':None})" 134 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> <input type="hidden" 135 name="viewLayer" value="search" /> 133 <input type="hidden" tal:define="params python:here.getParams(params={'query':None,'queryType':None,'viewMode':None,'viewLayer':'search'})" 134 tal:repeat="param params" tal:attributes="name param; value python:params[param]" /> 136 135 <!-- query text --> 137 136 <input type="text" name="query" tal:attributes="value query" /> <br /> <input type="submit" value="Search" /> <a … … 150 149 </div> 151 150 <!-- end search options--> 152 <!--BEGIN search153 <form tal:define="queryType string:fulltextMorph" tal:condition="docpath" tal:attributes="action python:here.getLink()">154 <input type="hidden" tal:define="params python:here.getParams('viewMode', None)" tal:repeat="param params"155 tal:attributes="name param; value python:params[param]" /> <input type="hidden" name="viewLayer" value="search" />156 <input type="text" name="query" tal:attributes="value query" /> <input type="submit" value="Search full document" /> <a157 tal:condition="query" tal:attributes="href python:here.getLink('query',None)">Clear</a><br /> <input type="radio"158 name="queryType" value="fulltext" tal:attributes="checked python:queryType=='fulltext'" /> Exact <input type="radio"159 name="queryType" value="fulltextMorph" tal:attributes="checked python:queryType=='fulltextMorph'" /> All forms <input160 type="radio" name="queryType" value="ftIndex" tal:attributes="checked python:queryType=='ftIndex'" /> Fulltext index161 <input type="radio" name="queryType" value="ftIndexMorph" tal:attributes="checked python:queryType=='ftIndexMorph'" />162 Morphological index163 </form>164 END search-->165 151 </div> 166 152 </div> 153 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 154 <!-- footer --> 155 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 156 </tal:block> 157 167 158 </body> 168 159 <body tal:condition="not:numPages"> 169 160 <div class="errortext">Sorry, document doesn't exist.</div> 161 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 162 <!-- footer --> 163 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 164 </tal:block> 170 165 </body> 171 166 </html> -
zpt/viewer_text.zpt
r540 r543 15 15 <script type="text/javascript" tal:attributes="src string:$rootUrl/template/jquery_js"></script> 16 16 <script type="text/javascript"> 17 17 // <!-- 18 18 $(document).ready(function() { 19 19 // autosubmit forms … … 38 38 pn pageinfo/pn; 39 39 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl'; 40 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">40 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo);"> 41 41 <!-- header --> 42 42 <div class="page-head"> … … 55 55 <metal:block metal:use-macro="here/template/common_template/macros/page_ruler" /> 56 56 </div> 57 <div class="content text" >57 <div class="content text" tal:condition="textPage"> 58 58 <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" 59 59 tal:content="structure pageinfo/pageHeaderTitle" /> 60 <tal:block tal:replace="structure textPage" /> 60 <tal:block tal:condition="textPage" tal:replace="structure textPage"/> 61 <div class="emptyPage" tal:condition="not:textPage">[Empty page]</div> 61 62 </div> 62 63 </div> … … 140 141 <div class="errortext">Sorry, access to this document is restricted.</div> 141 142 </div> 142 143 144 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 145 <!-- footer --> 146 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 147 </tal:block> 143 148 </tal:block> 144 149 </body> 145 150 <body tal:condition="not:numPages"> 146 151 <div class="errortext">Sorry, document doesn't exist.</div> 152 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 153 <!-- footer --> 154 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 155 </tal:block> 147 156 </body> 148 157 </html> -
zpt/viewer_thumbs.zpt
r540 r543 96 96 <div class="errortext">Sorry, access to this document is restricted.</div> 97 97 </div> 98 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 99 <!-- footer --> 100 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 101 </tal:block> 98 102 </tal:block> 99 103 </body> 100 104 <body tal:condition="not:numPages"> 101 105 <div class="errortext">Sorry, document doesn't exist.</div> 106 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 107 <!-- footer --> 108 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 109 </tal:block> 102 110 </body> 103 111 </html> -
zpt/viewer_xml.zpt
r540 r543 83 83 </div> 84 84 85 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 86 <!-- footer --> 87 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 88 </tal:block> 85 89 </tal:block> 86 90 </body> 87 91 <body tal:condition="not:numPages"> 88 92 <div class="errortext">Sorry, document doesn't exist.</div> 93 <tal:block tal:condition="exists:here/template/site_template.pt/macros/footer"> 94 <!-- footer --> 95 <metal:block metal:use-macro="here/template/site_template.pt/macros/footer"/> 96 </tal:block> 89 97 </body> 90 98 </html>
Note: See TracChangeset
for help on using the changeset viewer.