summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-07-22 12:59:07 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-07-22 12:59:07 (GMT)
commitcf67ef183c606aa60298cd90df9402c74b93254b (patch)
treebdbeb2caeda19d9f8a465b5877943320804eafb2
parentb54e32e70d7e8825d8a00385b057c3b5bc97b36e (diff)
downloadthemis.looks-cf67ef183c606aa60298cd90df9402c74b93254b.zip
themis.looks-cf67ef183c606aa60298cd90df9402c74b93254b.tar.gz
themis.looks-cf67ef183c606aa60298cd90df9402c74b93254b.tar.bz2
Override form macros to have buttons on top
-rw-r--r--themis/looks/configure.zcml10
-rw-r--r--themis/looks/form-macros.pt112
2 files changed, 122 insertions, 0 deletions
diff --git a/themis/looks/configure.zcml b/themis/looks/configure.zcml
index 71988d2..cb5a8c2 100644
--- a/themis/looks/configure.zcml
+++ b/themis/looks/configure.zcml
@@ -55,4 +55,14 @@
permission="zope2.View"
/>
+ <browser:page
+ name="ploneform-macros"
+ for="plone.dexterity.interfaces.IDexterityContent"
+ layer="plone.app.z3cform.interfaces.IPloneFormLayer"
+ class="plone.app.z3cform.templates.Macros"
+ template="form-macros.pt"
+ allowed_interface="zope.interface.common.mapping.IItemMapping"
+ permission="zope.Public"
+ />
+
</configure>
diff --git a/themis/looks/form-macros.pt b/themis/looks/form-macros.pt
new file mode 100644
index 0000000..d02cde8
--- /dev/null
+++ b/themis/looks/form-macros.pt
@@ -0,0 +1,112 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:metal="http://xml.zope.org/namespaces/metal"
+ xmlns:tal="http://xml.zope.org/namespaces/tal"
+ xmlns:i18n="http://xml.zope.org/namespaces/i18n"
+ i18n:domain="plone.z3cform"
+ tal:omit-tag="">
+
+ <head></head>
+
+ <body>
+
+ <div class="form" metal:define-macro="form">
+
+ <metal:title-slot define-slot="title">
+ <h3 tal:condition="view/label | nothing">
+ <span tal:replace="view/label">Form title</span>:</h3>
+ </metal:title-slot>
+
+ <metal:description-slot define-slot="description">
+ <div class="description"
+ tal:condition="view/description | nothing"
+ tal:content="structure view/description">Form description</div>
+ </metal:description-slot>
+
+ <metal:define define-macro="titlelessform">
+ <div class="portalMessage"
+ tal:condition="view/status" tal:content="view/status">
+ </div>
+
+ <form action="." method="post"
+ tal:attributes="action request/getURL; enctype view/enctype">
+
+ <div span="actions">
+ <span class="action" tal:repeat="action view/actions/values|nothing">
+ <input type="submit" tal:replace="structure action/render" />
+ </span>
+ </div>
+
+ <metal:block define-slot="formtop" />
+
+ <metal:fields-slot define-slot="fields">
+ <metal:define define-macro="fields">
+
+ <tal:widgets repeat="widget view/widgets/values">
+ <div class="row"
+ tal:define="hidden python:widget.mode == 'hidden'"
+ tal:omit-tag="hidden">
+
+ <metal:field-slot define-slot="field">
+ <metal:field define-macro="field">
+ <div class="field"
+ tal:define="error widget/error;
+ hidden python:widget.mode == 'hidden';"
+ tal:attributes="class python:'field' + (error and ' error' or '')">
+ <label for=""
+ tal:attributes="for widget/id"
+ tal:condition="not:hidden">
+ <span i18n:translate=""
+ tal:content="widget/label">label</span>
+ </label>
+
+ <span class="fieldRequired" title="Required"
+ tal:condition="python:widget.required and not hidden"
+ i18n:translate="label_required"
+ i18n:attributes="title title_required;">
+ (Required)
+ </span>
+
+ <div class="formHelp"
+ tal:define="description widget/field/description"
+ i18n:translate=""
+ tal:content="description"
+ tal:condition="python:description and not hidden"
+ >field description</div>
+
+ <div tal:condition="error"
+ tal:content="structure error/render">
+ Error
+ </div>
+
+ <div class="widget">
+ <input type="text" tal:replace="structure widget/render" />
+ </div>
+ </div>
+ </metal:field>
+ </metal:field-slot>
+
+ </div>
+ </tal:widgets>
+
+ </metal:define>
+ </metal:fields-slot>
+
+ <metal:actions-slot define-slot="actions">
+ <metal:define define-macro="actions">
+ <div span="actions">
+ <span class="action" tal:repeat="action view/actions/values|nothing">
+ <input type="submit" tal:replace="structure action/render" />
+ </span>
+ </div>
+ </metal:define>
+ </metal:actions-slot>
+
+ <metal:block define-slot="formbottom" />
+
+ </form>
+ </metal:define>
+ </div>
+
+
+ </body>
+</html>