summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-10-02 16:26:15 +0200
committerXavier Morel <xmo@openerp.com>2012-10-02 16:26:15 +0200
commite3dc230335b47c252ff5e9a93dee792bf92a724f (patch)
tree219bd883de28020a5f979a4bce572d40f0883017 /doc
parent79f39b9c12f097f87e618a8af2fa8ffcfca8510f (diff)
[IMP] extract header generic template
bzr revid: xmo@openerp.com-20121002142615-7ewhu2snadhqd9c1
Diffstat (limited to 'doc')
-rw-r--r--doc/index.rst2
-rw-r--r--doc/templates.rst45
2 files changed, 47 insertions, 0 deletions
diff --git a/doc/index.rst b/doc/index.rst
index 4aa9dcd3b25..0f0c4bf87f5 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -22,6 +22,8 @@ Contents:
list-view
form-notes
+ templates
+
Indices and tables
==================
diff --git a/doc/templates.rst b/doc/templates.rst
new file mode 100644
index 00000000000..3977682399a
--- /dev/null
+++ b/doc/templates.rst
@@ -0,0 +1,45 @@
+.. highlight:: xml
+
+Generic templates
+=================
+
+Generic template names should be prefixed by ``ui.`` to indicate their
+special role.
+
+Global Header: ``ui.Header``
+----------------------------
+
+Role
+++++
+
+This template is mostly dedicated to client actions taking over the
+whole content area, and full-HTML form views (especially those opening
+in the ``inline`` target).
+
+It is used to display a buttons container (and can also be used for
+status bars). The buttons should simply be placed inside the
+``ui.Header`` body.
+
+Arguments
++++++++++
+
+The template only uses its body as argument.
+
+Example
++++++++
+
+::
+
+ <t t-call="ui.Header">
+ <button string="Apply" type="object" name="execute" class="oe_highlight"/>
+ or
+ <button string="Cancel" type="object" name="cancel" class="oe_link"/>
+ </t>
+
+This block demonstrates a common pattern in OpenERP views and widgets:
+a highlighted button, and a discard button styled as a link to cancel
+the action:
+
+.. image:: /images/templates/ui.Header.*
+
+In this case, both buttons are OpenERP action buttons.