changeset 94:9d08a21fdd83

more changed templates, now with metal:use-macro zogilib mostly working
author casties
date Fri, 09 Apr 2010 20:33:53 +0200
parents fd2e11a1c369
children db6d594aa4d9
files zpt/toc_figures.zpt zpt/toc_text.zpt zpt/toc_thumbs.zpt zpt/viewer_main.zpt
diffstat 4 files changed, 83 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/zpt/toc_figures.zpt	Fri Apr 09 20:33:53 2010 +0200
+++ b/zpt/toc_figures.zpt	Fri Apr 09 20:33:53 2010 +0200
@@ -1,14 +1,25 @@
-<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>
+<!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">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<body>
+  <!-- block used for main content area -->
+  <metal:block metal:define-macro="main">
+    <tal:block tal:define="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>
+  </metal:block>
+</body>
+</html>
--- a/zpt/toc_text.zpt	Fri Apr 09 20:33:53 2010 +0200
+++ b/zpt/toc_text.zpt	Fri Apr 09 20:33:53 2010 +0200
@@ -1,14 +1,25 @@
-<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>
+<!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">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<body>
+  <!-- block used for main content area -->
+  <metal:block metal:define-macro="main">
+    <tal:block tal:define="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 $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='text',pageinfo=pageinfo,docinfo=docinfo)"/>
+    </tal:block>
+  </metal:block>
+</body>
+</html>
\ No newline at end of file
--- a/zpt/toc_thumbs.zpt	Fri Apr 09 20:33:53 2010 +0200
+++ b/zpt/toc_thumbs.zpt	Fri Apr 09 20:33:53 2010 +0200
@@ -1,5 +1,13 @@
-<div tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
-  start pageinfo/start; end pageinfo/end; rows pageinfo/rows; cols pageinfo/cols;
+<!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">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+</head>
+<body>
+  <!-- block used for main content area -->
+  <metal:block metal:define-macro="main">
+    <div tal:define="start pageinfo/start; end pageinfo/end; rows pageinfo/rows; cols pageinfo/cols;
   current pageinfo/current; grpsize pageinfo/groupsize">
 
 <div class="thumbruler">
@@ -29,3 +37,6 @@
   </tr>
 </table>
 </div>
+  </metal:block>
+</body>
+</html>
\ No newline at end of file
--- a/zpt/viewer_main.zpt	Fri Apr 09 20:33:53 2010 +0200
+++ b/zpt/viewer_main.zpt	Fri Apr 09 20:33:53 2010 +0200
@@ -1,28 +1,30 @@
 <!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; tocMode pageinfo/tocMode">
+ tal:define="docinfo options/docinfo; pageinfo options/pageinfo; viewMode pageinfo/viewMode; tocMode pageinfo/tocMode;
+ body_onload nothing">
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <link rel="stylesheet" href="template/docuviewer_css" type="text/css">
+  <metal:block metal:use-macro="python:path('here/template/page_main_%s/macros/head'%viewMode)"/>
 </head>
-<body tal:condition="docinfo/numPages">
-<div tal:replace="structure python:here.template.head_main(docinfo=docinfo,viewMode=viewMode,pageinfo=pageinfo)"/>
-<tal:block tal:condition="python:here.isAccessible(docinfo)">
-<table border="0" width="100%" height="100%">
-  <tr>
-    <td width="300px" valign="top">
-      <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:content="structure python:getattr(here.template, 'page_main_%s'%viewMode)(docinfo=docinfo,pageinfo=pageinfo,mk=options['mk'])"/>
-    </td>
-  </tr>
-</table>
-</tal:block>
-<tal:block tal:condition="not:python:here.isAccessible(docinfo)">
-<div class="errortext">Sorry, access to this document is restricted.</div>
-</tal:block>
+<body tal:condition="docinfo/numPages" tal:attributes="onload body_onload">
+  <metal:block metal:use-macro="here/template/head_main/macros/main"/>
+  <tal:block tal:condition="python:here.isAccessible(docinfo)">
+  <table border="0" width="100%" height="100%">
+    <tr>
+      <td width="300px" valign="top">
+        <metal:block metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)"/> 
+      </td>
+      <td width="100%" valign="top">
+        <metal:block metal:use-macro="python:path('here/template/page_main_%s/macros/main'%viewMode)"/>
+      </td>
+    </tr>
+  </table>
+  </tal:block>
+  <tal:block tal:condition="not:python:here.isAccessible(docinfo)">
+    <div class="errortext">Sorry, access to this document is restricted.</div>
+  </tal:block>
 </body>
 <body tal:condition="not:docinfo/numPages">
 <div class="errortext">Sorry, document doesn't exist.</div>