Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add three vertical layouts, of width 1/3, 1/2 and 2/3 of page width.

  • Loading branch information...
commit a1c3b51e965876c542473f55be42ca3a20c41d0f 1 parent ad308a3
@malthe malthe authored
View
3  CHANGES.rst
@@ -5,6 +5,9 @@ In next release ..
Features:
+- Added three new vertical layouts, assigned respectively 1/3, 1/2 and
+ 2/3 page width.
+
- Added option to select standard, double or triple spacing, all of
which are given as a percentage of the page width.
View
26 src/collective/panels/configure.zcml
@@ -161,28 +161,46 @@
<browser:panel
name="left"
- title="B"
+ title="B1"
template="templates/left.pt"
/>
<browser:panel
name="right"
- title="C"
+ title="B2"
template="templates/right.pt"
/>
<browser:panel
name="one-third-left"
- title="D"
+ title="C1"
template="templates/onethirdleft.pt"
/>
<browser:panel
name="one-third-right"
- title="E"
+ title="C2"
template="templates/onethirdright.pt"
/>
+ <browser:panel
+ name="split-one-third"
+ title="D1"
+ template="templates/splitonethird.pt"
+ />
+
+ <browser:panel
+ name="split-half"
+ title="D2"
+ template="templates/splithalf.pt"
+ />
+
+ <browser:panel
+ name="split-two-thirds"
+ title="D3"
+ template="templates/splittwothirds.pt"
+ />
+
<!-- Browser resources -->
<browser:resource
View
27 src/collective/panels/display.pt
@@ -1,24 +1,23 @@
<div class="panels" i18n:domain="collective.panels">
<tal:panels repeat="panel view/panels">
- <tal:display define="html panel/@@display">
- <div class="panel-content"
- tal:attributes="class string:panel panel-${repeat/panel/index}"
+ <tal:render define="html panel/@@display">
+
+ <div tal:attributes="class string:panel panel-${repeat/panel/index}"
tal:condition="html"
tal:content="structure html"
/>
- <dl class="portalMessage info"
- tal:condition="python: not html.strip() and view.can_manage">
- <dt i18n:translate="">Info</dt>
- <dd i18n:translate="">This panel is empty.</dd>
- </dl>
- </tal:display>
-
- <div class="visualClear"></div>
+ <tal:manage condition="view/can_manage">
+ <dl class="portalMessage info"
+ tal:condition="python: not html.strip() and view.can_manage">
+ <dt i18n:translate="">Info</dt>
+ <dd i18n:translate="">This panel is empty.</dd>
+ </dl>
- <tal:manage condition="view/can_manage"
- content="structure panel/@@manage"
- />
+ <div class="visualClear"></div>
+ <div tal:content="structure panel/@@manage" />
+ </tal:manage>
+ </tal:render>
</tal:panels>
</div>
View
10 src/collective/panels/styles.css
@@ -1,3 +1,7 @@
+.panel {
+ display: inline;
+}
+
.panels .row {
float: left;
width: 100%;
@@ -18,6 +22,10 @@
font-weight: bold !important;
}
+.add-panel {
+ width: 75%;
+}
+
.add-panel dd {
margin: 0 !important;
line-height: 4em;
@@ -37,7 +45,7 @@
border: 1px solid #999966 !important;
margin-right: 1em;
margin-bottom: 1em;
- width: 10%;
+ width: 7em;
background-color: #FFFFE3;
}
View
10 src/collective/panels/templates/splithalf.pt
@@ -0,0 +1,10 @@
+<div class="row"
+ tal:attributes="style string:width: ${width}%;; float: left;; margin-left: 1.125%;; margin-right: ${spacing}%"
+ tal:define="portlets portlets | python: ('&darr;', );
+ spacing spacing | python: 1.125;
+ width python: 50 - spacing - 1.125"
+ tal:condition="portlets">
+ <div class="cell" style="float: none; left: 0" tal:repeat="portlet portlets">
+ <div tal:content="structure portlet" />
+ </div>
+</div>
View
10 src/collective/panels/templates/splitonethird.pt
@@ -0,0 +1,10 @@
+<div class="row"
+ tal:attributes="style string:width: ${width}%;; float: left;; margin-left: 1.125%;; margin-right: ${spacing}%"
+ tal:define="portlets portlets | python: ('&darr;', );
+ spacing spacing | python: 1.125;
+ width python: 33.332 - spacing - 1.125"
+ tal:condition="portlets">
+ <div class="cell" style="float: none; left: 0" tal:repeat="portlet portlets">
+ <div tal:content="structure portlet" />
+ </div>
+</div>
View
10 src/collective/panels/templates/splittwothirds.pt
@@ -0,0 +1,10 @@
+<div class="row"
+ tal:attributes="style string:width: ${width}%;; float: left;; margin-left: 1.125%;; margin-right: ${spacing}%"
+ tal:define="portlets portlets | python: ('&darr;', );
+ spacing spacing | python: 1.125;
+ width python: 66.667 - spacing - 1.125"
+ tal:condition="portlets">
+ <div class="cell" style="float: none; left: 0" tal:repeat="portlet portlets">
+ <div tal:content="structure portlet" />
+ </div>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.