changeset 481:0a0f7f570f90 elementtree

more new templates
author casties
date Tue, 16 Aug 2011 12:02:00 +0200
parents 50a28442f21c
children 7ca8ac7db06e
files css/docuviewer.css zpt/toc_figures.zpt zpt/toc_text.zpt zpt/toc_thumbs.zpt zpt/viewer_text.zpt
diffstat 5 files changed, 97 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/css/docuviewer.css	Mon Aug 15 21:09:08 2011 +0200
+++ b/css/docuviewer.css	Tue Aug 16 12:02:00 2011 +0200
@@ -1,21 +1,34 @@
 
 div.page_body {
-	display: table-row;
+    display: table-row;
 }
-div.toc {
-	display: table-cell;
+div.col_left {
+    display: table-cell;
 }
-div.text {
+div.col_main {
     display: table-cell;
 }
 
-.thumb {
-	padding: 3px;
+div.col_left {
+    /* would be better without fixed width */
+    max-width: 20em;
+}
+
+div.col_left .thumb {
+    padding: 3px;
+}
+div.col_left .thumbsel {
+    padding: 2px;
+    border: 1px solid blue;
 }
-.thumbsel {
-	padding: 2px;
-	border: 1px solid blue;
+div.col_left .thumbcap {
+    color: black;
 }
-.thumbcap {
-	color: black;
+
+div.col_left .toc {
+    float:left;
+    clear:right; 
+}
+div.col_left .toc.float.right {
+    float:right;
 }
\ No newline at end of file
--- a/zpt/toc_figures.zpt	Mon Aug 15 21:09:08 2011 +0200
+++ b/zpt/toc_figures.zpt	Tue Aug 16 12:02:00 2011 +0200
@@ -1,14 +1,54 @@
-<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 -->
+  <div class="col_left" metal:define-macro="main"
+    tal:define="pn pageinfo/tocPN; tocsize docinfo/tocSize_figures; grpsize pageinfo/tocPageSize;
+                maxpn python:int(math.ceil(tocsize/float(grpsize)));">
+    <ul class="switcher">
+      <li><a
+        tal:attributes="href python:here.getLink('tocMode','thumbs')">Thumbnails</a>
+      </li>
+      <li
+        tal:condition="python:docpath and docinfo.get('numTocEntries', None)">
+        <a tal:attributes="href python:here.getLink('tocMode','text')">Content</a>
+      </li>
+      <li
+        tal:condition="python:docpath and docinfo.get('numFigureEntries', None)">
+        <a
+        tal:attributes="href python:here.getLink('tocMode','figures')">Figures</a>
+      </li>
+      <li><a
+        tal:attributes="href python:here.getLink('tocMode','none')">None</a>
+      </li>
+    </ul>
+    <div class="ruler">
+      <form class="autosubmit" tal:attributes="action viewerUrl">
+        <input type="hidden"
+          tal:define="params python:here.getParams('tocPN', None)"
+          tal:repeat="param params"
+          tal:attributes="name param; value python:params[param]" /> 
+        <a tal:condition="python:(pn>1)"
+          tal:attributes="href python:here.getLink('tocPN',pn-1)">&lt;</a>
+        <span tal:condition="python:(pn<=1)">&lt;</span> 
+        <select class="autosubmit" name="tocPN">
+          <option tal:repeat="idx python:range(maxpn)"
+            tal:attributes="selected python:(pn==idx*grpsize+1); value python:(idx*grpsize+1)"
+            tal:content="python:str(idx*grpsize+1)" />
+        </select> 
+        <input type="submit" value="Go" /> 
+        <a tal:condition="python:(pn<maxpn)"
+          tal:attributes="href python:here.getLink('tocPN',pn+1)">&gt;</a>
+        <span tal:condition="python:(pn>=maxpn)">&gt;</span> 
+      </form>
+    </div>
+    <div class="content"
+      tal:content="structure python:here.getTocPage(mode='figures',pageinfo=pageinfo,docinfo=docinfo)" />
+  </div>
+  <!-- toc -->
+</body>
+</html>
--- a/zpt/toc_text.zpt	Mon Aug 15 21:09:08 2011 +0200
+++ b/zpt/toc_text.zpt	Tue Aug 16 12:02:00 2011 +0200
@@ -1,4 +1,13 @@
-<tal:block tal:define="docinfo options/docinfo; pageinfo options/pageinfo;  
+<!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 -->
+  <div class="col_left" metal:define-macro="main"
+     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">
@@ -10,5 +19,7 @@
     <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>
+  <div class="content" tal:content="structure python:here.getTocPage(mode='text',pageinfo=pageinfo,docinfo=docinfo)"/>
+</div> <!-- toc -->
+</body>
+</html>
--- a/zpt/toc_thumbs.zpt	Mon Aug 15 21:09:08 2011 +0200
+++ b/zpt/toc_thumbs.zpt	Tue Aug 16 12:02:00 2011 +0200
@@ -6,7 +6,7 @@
 </head>
 <body>
   <!-- block used for main content area -->
-  <div class="toc" metal:define-macro="main"
+  <div class="col_left" metal:define-macro="main"
     tal:define="start pageinfo/start;
                 grpsize pageinfo/groupsize;
                 numgroups pageinfo/numgroups;
--- a/zpt/viewer_text.zpt	Mon Aug 15 21:09:08 2011 +0200
+++ b/zpt/viewer_text.zpt	Tue Aug 16 12:02:00 2011 +0200
@@ -20,12 +20,12 @@
   <div class="page_head" metal:use-macro="here/template/head_main/macros/main" />
   <div class="page_body" tal:condition="python:here.isAccessible(docinfo)">
     <!--table of contents-->
-    <div class="toc"
+    <div class="col_left"
       metal:use-macro="python:path('here/template/toc_%s/macros/main'%tocMode)" />
     <!-- text page -->
-    <div class="text">
+    <div class="col_main">
       <div class="ruler">
-        <form class="autosubmit pageruler" tal:attributes="action viewerUrl">
+        <form class="autosubmit" tal:attributes="action viewerUrl">
           <input type="hidden" tal:define="params python:here.getParams('pn', None)"
             tal:repeat="param params" tal:attributes="name param; value python:params[param]" />
         page
@@ -47,7 +47,7 @@
         <span tal:condition="not:rightest">&gt;|</span>
         </form>
       </div>
-      <div class="page">
+      <div class="content">
         <div class="pageHeaderTitle" tal:condition="exists:pageinfo/pageHeaderTitle" tal:content="structure pageinfo/pageHeaderTitle"/>
         <tal:block tal:replace="structure textPage"/>
       </div>