changeset 91:b8c491e52ebc

new version with new full-text infrastructure and some more changed templates
author casties
date Thu, 08 Apr 2010 13:04:51 +0200
parents 6a4a72033d58
children 727fa536860c
files zpt/toc_figures.zpt zpt/toc_text.zpt zpt/toc_thumbs.zpt zpt/viewer_main.zpt
diffstat 4 files changed, 62 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/toc_figures.zpt	Thu Apr 08 13:04:51 2010 +0200
@@ -0,0 +1,14 @@
+<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_figures']); grpsize python:int(pageinfo['tocPageSize']);
+  maxpn python:int(tocsize/grpsize);">
+  <div class="thumbruler">
+    <span tal:condition="python:(pn>1)">
+      <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)">&lt;</a>
+    </span>
+    <span tal:content="string:$pn of $maxpn"/>
+    <span>
+    <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">&gt;</a>
+  </span>
+</div>
+  <div tal:content="structure python:here.getTocPage(mode='figures',pageinfo=pageinfo,docinfo=docinfo)"/>
+</tal:block>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/toc_text.zpt	Thu Apr 08 13:04:51 2010 +0200
@@ -0,0 +1,14 @@
+<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  pn python:int(pageinfo['tocPN']); tocsize python:int(docinfo['tocSize_text']); grpsize python:int(pageinfo['tocPageSize']);
+  maxpn python:int(tocsize/grpsize);">
+  <div class="thumbruler">
+    <span tal:condition="python:(pn>1)">
+      <a tal:attributes="href python:here.getLink(param='tocPN',val=pn-1)">&lt;</a>
+    </span>
+    <span tal:content="string:$pn of $tocsize"/>
+    <span>
+    <a tal:attributes="href python:here.getLink(param='tocPN',val=pn+1)">&gt;</a>
+  </span>
+</div>
+  <div tal:content="structure python:here.getTocPage(mode='text',pageinfo=pageinfo,docinfo=docinfo)"/>
+</tal:block>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/zpt/toc_thumbs.zpt	Thu Apr 08 13:04:51 2010 +0200
@@ -0,0 +1,31 @@
+<div tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+  start pageinfo/start; end pageinfo/end; rows pageinfo/rows; cols pageinfo/cols;
+  current pageinfo/current; grpsize pageinfo/groupsize">
+
+<div class="thumbruler">
+  <span tal:condition="python:(start>1)">
+    <a tal:attributes="href python:here.getLink(param='start',val=max(start-grpsize,1))">&lt;</a>
+  </span>
+  <select tal:attributes="onChange python:'location.href=\''+here.getLink(param='start',val=None)+'&start=\'+this.options[this.selectedIndex].value'">
+    <option tal:repeat="grp python:range(pageinfo['numgroups'])" 
+      tal:attributes="selected python:(start==grp*grpsize+1); value python:(grp*grpsize+1)"
+      tal:content="python:(grp*grpsize+1)"/>
+  </select>
+  <span tal:condition="python:(start+grpsize<int(docinfo['numPages']))">
+    <a tal:attributes="href python:here.getLink(param='start',val=start+grpsize)">&gt;</a>
+  </span>
+</div>
+<table>
+  <tr tal:repeat="row python:range(rows)">
+    <tal:block tal:repeat="idx python:range(start+row*cols,start+(row+1)*cols)">
+      <td align="center" tal:condition="python:(idx<=end)"
+		  	tal:attributes="class python:here.getStyle(idx,current,'thumb')">
+		<a tal:attributes="href python:here.getLink(param='pn',val=idx)">
+		  <img class="thumbimg" border="0" tal:attributes="src string:${docinfo/imageURL}&pn=$idx&dw=100&dh=100"/>
+		  <div class="thumbcap" tal:content="idx"/>
+		</a>
+	  </td>
+    </tal:block>
+  </tr>
+</table>
+</div>
--- a/zpt/viewer_main.zpt	Thu Apr 08 13:04:51 2010 +0200
+++ b/zpt/viewer_main.zpt	Thu Apr 08 13:04:51 2010 +0200
@@ -1,7 +1,7 @@
 <!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 options/viewMode">
+ tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; tocMode pageinfo/tocMode">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <link rel="stylesheet" href="template/docuviewer_css" type="text/css">
@@ -12,11 +12,10 @@
 <table border="0" width="100%" height="100%">
   <tr>
     <td width="300px" valign="top">
-      <tal:block tal:replace="structure python:here.template.thumbs_main(docinfo=docinfo,pageinfo=pageinfo)" /> 
+      <tal:block tal:replace="structure python:getattr(here.template, 'toc_%s'%tocMode)(docinfo=docinfo,pageinfo=pageinfo)"/> 
     </td>
     <td width="100%" valign="top">
-      <tal:block tal:condition="python:viewMode=='images'" tal:content="structure python:here.template.page_main_images(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=options['mk'])" />
-      <tal:block tal:condition="python:viewMode.startswith('text')" tal:content="structure python:here.template.page_main_text(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=options['mk'])" />
+      <tal:block tal:content="structure python:getattr(here.template, 'page_main_%s'%viewMode)(docinfo=docinfo,pageinfo=pageinfo,mk=options['mk'])"/>
     </td>
   </tr>
 </table>