Mercurial > hg > documentViewer
diff zpt/viewer_thumbs.zpt @ 528:f8a5f63eafc0
new viewMode=thumbs.
author | casties |
---|---|
date | Fri, 13 Apr 2012 16:55:16 +0200 |
parents | |
children | abd36d4d97b8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/zpt/viewer_thumbs.zpt Fri Apr 13 16:55:16 2012 +0200 @@ -0,0 +1,116 @@ +<!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; + viewerUrl docinfo/viewerUrl; + rootUrl here/getDocumentViewerURL; + 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" /> +<script type="text/javascript" tal:attributes="src string:$rootUrl/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> +</head> +<body tal:condition="numPages"> + <tal:block + tal:define="pn pageinfo/pn; + start pageinfo/start; + thumbRows python:int(request.get('thumbRows', 10)); + thumbCols python:int(request.get('thumbCols', 12)); + thumbSize python:int(request.get('thumbSize', 100)); + flowLtr python:docinfo.get('pageFlow','ltr')!='rtl'; + pageBatch python:here.getPageBatch(start=start, rows=thumbRows, cols=thumbCols, pageFlowLtr=flowLtr, maxIdx=numPages); + pageNumbers docinfo/pageNumbers | nothing; + left python:test(flowLtr,pageBatch['prevStart'],pageBatch['nextStart']); + right python:test(flowLtr,pageBatch['nextStart'],pageBatch['prevStart']);"> + <div class="page-head"> + <metal:block metal:use-macro="here/template/common_template/macros/head" /> + </div> + <div class="page-body" tal:condition="python:here.isAccessible(docinfo)"> + <!-- col-main: text page --> + <div class="col main"> + <div class="ruler"> + <metal:block + metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> + </div> + + <table class="thumbs"> + <tr tal:repeat="row pageBatch/pages"> + <td tal:repeat="thumb row" + tal:attributes="class python:here.getStyle(thumb['idx'],pn,'thumb')"> + <a tal:define="idx thumb/idx" tal:condition="idx" + tal:attributes="href python:here.getLink(params={'pn':idx, 'viewMode':'images'})"> <img + tal:attributes="src python:test(docinfo['imageURL'],here.getScalerUrl(pn=idx,dw=thumbSize,dh=thumbSize,docinfo=docinfo),'images/pic'); + alt idx" /><br /> + <span title="Scan number" tal:content="idx" /> <span + tal:condition="python:pageNumbers and pageNumbers.get(idx, False) and pageNumbers[idx]['no']" + title="Original page number" + tal:content="python:' (%s)'%(pageNumbers[idx]['no'])" /> + </a> + </td> + </tr> + </table> + + <div class="ruler"> + <metal:block + metal:use-macro="here/template/common_template/macros/toc_ruler_thumbs" /> + </div> + + </div> + <!-- /col-main --> + + <!-- right-side options --> + <div class="col buttons"> + <!--"BEGIN TEXT DISPLAY" --> + <div class="options"> + <h4>Thumbnail display</h4> + <form tal:attributes="action viewerUrl" class="autosubmit"> + <input type="hidden" + tal:define="params python:here.getParams(params={'thumbRows':None,'thumbCols':None,'thumbSize':None})" + tal:repeat="param params" + tal:attributes="name param; value python:params[param]" /> + <ul> + <li> + Rows + <select class="autosubmit" name="thumbRows" tal:define="rows python:[2,3,5,10,12,15,20,50,100]"> + <option tal:repeat="row rows" tal:attributes="selected python:thumbRows==row; value row" tal:content="row"/> + </select> + </li> + <li> + Columns + <select class="autosubmit" name="thumbCols" tal:define="cols python:[2,3,5,10,12,15,20,50,100]"> + <option tal:repeat="col cols" tal:attributes="selected python:thumbCols==col; value col" tal:content="col"/> + </select> + </li> + <li> + Thumbnail size + <select class="autosubmit" name="thumbSize" tal:define="sizes python:[100,150,200,300,500]"> + <option tal:repeat="size sizes" tal:attributes="selected python:thumbSize==size; value size" tal:content="size"/> + </select> + </li> + </ul> + </form> + </div> + </div> + </div> + <!-- page-body --> + <div class="page-body" tal:condition="python:not here.isAccessible(docinfo)"> + <div class="errortext">Sorry, access to this document is restricted.</div> + </div> + </tal:block> +</body> +<body tal:condition="not:numPages"> + <div class="errortext">Sorry, document doesn't exist.</div> +</body> +</html> \ No newline at end of file