Author: jmorliaguet
Date: Sun Jun 25 00:02:23 2006
New Revision: 3516

Modified:
   cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py
   
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/layout_mode.css
   
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/themepage.pt
   cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/views.py

Log:

- added an 'add pageblock' button at the bottom of the layout designer screen



Modified: cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/browser/rendering/viewer.py     Sun Jun 
25 00:02:23 2006
@@ -119,6 +119,7 @@
     info = ContextInfo({
         'element': node,
         'order': order,
+        'children': children,
         'data': None,
         'metadata': None,
         })

Modified: 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/layout_mode.css
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/layout_mode.css
  (original)
+++ 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/layout_mode.css
  Sun Jun 25 00:02:23 2006
@@ -3,9 +3,9 @@
 /* Page blocks */
 .pageBlockEdit {
   margin-top: 7px;
-  margin-bottom: 1px; 
-  margin-left: 1px; 
-  margin-right: 1px; 
+  margin-bottom: 1px;
+  margin-left: 1px;
+  margin-right: 1px;
 }
 
 .pageBlockEditHeader {
@@ -48,13 +48,21 @@
 }
 
 .pageBlockAddButton {
-  text-align: left; 
-  padding-left: 3px;
-  margin-top: 4px;
+  text-align: right;
+  padding-right: 4px;
+  margin-top: 5px;
+  margin-bottom: 5px;
 }
 
 .pageBlockAddButton img {
   border: none;
+  vertical-align: middle;
+  padding-right: 0.2em;
+}
+
+.pageBlockAddButton a {
+  color: #006;
+  font-size: 1.1em;
 }
 
 /* cell */
@@ -62,16 +70,16 @@
   padding: 0;
   margin: 0;
   height: 25px;
-  background: url(++resource++sizer_line.png); 
+  background: url(++resource++sizer_line.png);
   background-repeat: repeat-x;
   background-position: center top;
-  text-align: center; 
+  text-align: center;
 }
 .sizer .left {
   float: left;
   margin-left: 1px;
-  background: url(/++skin++cpsskins/@@/sizer_left.png); 
-  background-repeat: no-repeat; 
+  background: url(/++skin++cpsskins/@@/sizer_left.png);
+  background-repeat: no-repeat;
   height: 10px;
   width: 7px;
 }
@@ -79,8 +87,8 @@
 .sizer .right {
   float: right;
   margin-right: 1px;
-  background: url(++resource++sizer_right.png); 
-  background-repeat: no-repeat; 
+  background: url(++resource++sizer_right.png);
+  background-repeat: no-repeat;
   height: 10px;
   width: 7px;
 }

Modified: 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/themepage.pt
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/themepage.pt 
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/layout/themepage.pt 
    Sun Jun 25 00:02:23 2006
@@ -1,13 +1,24 @@
-<div tal:define="id context/identifier"
+<div tal:define="id context/identifier;
+                 children options/info/children;
+                 len python: len(children)"
      tal:attributes="id id">
 
   <div class="pageBlockAddButton">
   <a title="Add a page block"
-     tal:attributes="href string:@@addPageBlock?id=$id">
+     tal:attributes="href string:@@addPageBlock?id=$id&order=0">
     <img style="width: 46px; height: 18px"
-     src="++resource++add-pageblock.png" /></a>
+     src="++resource++add-pageblock.png" />
+     Add a page block</a>
   </div>
 
   <div tal:content="structure options/markup" />
 
+  <div class="pageBlockAddButton">
+  <a title="Add a page block"
+     tal:attributes="href string:@@addPageBlock?id=$id&order=$len">
+    <img style="width: 46px; height: 18px"
+     src="++resource++add-pageblock.png" />
+     Add a page block</a>
+  </div>
+
 </div>

Modified: cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/views.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/views.py        
(original)
+++ cpsskins/branches/paris-sprint-2006/ui/screens/pagedesigner/views.py        
Sun Jun 25 00:02:23 2006
@@ -36,7 +36,7 @@
         self.request = request
         self.tmutil = getThemeManager(context)
 
-    def addPageBlock(self, id):
+    def addPageBlock(self, id, order=0):
         """Add a page block containing one cell at the top of a given page
         """
         request = self.request
@@ -53,7 +53,7 @@
         getMultiAdapter((pageblock, request), INodeAdding).add(cell)
 
         ordering = getMultiAdapter((page, request), INodeOrdering)
-        ordering.setOrder(pageblock, 0)
+        ordering.setOrder(pageblock, int(order))
 
         IFormattable(pageblock).getFormat(u'layout')[u'width'] = u'100%'
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to