From 032acbc8fe4fd9f0dad036912b7f14470a3021e9 Mon Sep 17 00:00:00 2001
From: Kevin Deldycke <kevin@nexedi.com>
Date: Fri, 8 Sep 2006 09:29:33 +0000
Subject: [PATCH] Don't display action box in default web view Factorize
 conditions. Reduce tag soupness. Change code layout.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9760 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../erp5_xhtml_style/view_main.xml            | 54 +++++++++----------
 .../bootstrap/erp5_xhtml_style/bt/change_log  |  3 ++
 .../bootstrap/erp5_xhtml_style/bt/revision    |  2 +-
 .../bootstrap/erp5_xhtml_style/bt/version     |  2 +-
 4 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/view_main.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/view_main.xml
index 79d76bfdc8..337ea108db 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/view_main.xml
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/view_main.xml
@@ -72,16 +72,17 @@ along with this program; if not, write to the Free Software\n
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n
 -->\n
 </tal:block>\n
-<tal:block metal:define-macro="master">\n
-  <tal:block tal:define="object_uid   here/getUid | nothing;\n
-                         object_path  here/getPath | nothing;\n
-                         form         nocall: form | nothing;\n
-                         form_id      form/id | nothing;\n
-                         form_action  python: form and form.action not in (\'\', None) and here.portal_membership.checkPermission(\'Modify portal content\', here) and form.action or nothing;\n
 \n
-                         local_parameter_list local_parameter_list | python: {};\n
-                         dummy python: local_parameter_list.update({\'object_uid\': object_uid, \'object_path\': object_path, \'form_id\': form_id});\n
-                         ">\n
+<tal:block metal:define-macro="master">\n
+  <tal:block\n
+   tal:define="object_uid           here/getUid | nothing;\n
+               object_path          here/getPath | nothing;\n
+               form                 nocall: form | nothing;\n
+               form_id              form/id | nothing;\n
+               form_action          python: form and form.action not in (\'\', None) and here.portal_membership.checkPermission(\'Modify portal content\', here) and form.action or nothing;\n
+               local_parameter_list local_parameter_list | python: {};\n
+               dummy                python: local_parameter_list.update({\'object_uid\': object_uid, \'object_path\': object_path, \'form_id\': form_id});\n
+               ">\n
     <tal:block metal:use-macro="here/main_template/macros/master">\n
       <tal:block metal:fill-slot="context_bar">\n
         <tal:block metal:use-macro="here/context_box_render/macros/master" />\n
@@ -89,25 +90,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\n
       <tal:block metal:fill-slot="main">\n
         <div class="document"\n
               tal:define="actions actions/object_view | python: []">\n
-          <div class="actions">\n
-            <tal:block tal:condition="editable_mode">\n
-              <button tal:condition="form_action"\n
-                      type="submit" class="save" title="Save"\n
-                      tal:attributes="name python: \'%s:method\' % (form_action, )"\n
-                      i18n:attributes="title" i18n:domain="ui">\n
-                <span class="image"></span>\n
-                <span class="description"\n
-                      i18n:translate="" i18n:domain="ui">Save</span>\n
-              </button>\n
-            </tal:block>\n
-            <ul tal:condition="python: (not is_web_mode or editable_mode) and len(actions)">\n
-              <tal:block tal:repeat="action actions">\n
-                <li tal:attributes="class python: action == current_action and \'selected\' or \'not_selected\'">\n
-                  <a tal:attributes="href python: here.ERP5XhtmlStyle_renderLink(action[\'url\'], http_parameters)"\n
-                     tal:content="action/name"\n
-                     i18n:translate="" i18n:domain="ui"></a>\n
-                </li>\n
-              </tal:block>\n
+          <div class="actions"\n
+               tal:condition="python: (not is_web_mode or editable_mode) and len(actions)">\n
+            <button tal:condition="form_action"\n
+                    type="submit" class="save" title="Save"\n
+                    tal:attributes="name python: \'%s:method\' % (form_action, )"\n
+                    i18n:attributes="title" i18n:domain="ui">\n
+              <span class="image"></span>\n
+              <span class="description" i18n:translate="" i18n:domain="ui">Save</span>\n
+            </button>\n
+            <ul>\n
+              <li tal:repeat="action actions"\n
+                  tal:attributes="class python: action == current_action and \'selected\' or \'not_selected\'">\n
+                <a tal:attributes="href python: here.ERP5XhtmlStyle_renderLink(action[\'url\'], http_parameters)"\n
+                   tal:content="action/name"\n
+                   i18n:translate="" i18n:domain="ui"/>\n
+              </li>\n
             </ul>\n
           </div>\n
           <div class="content" tal:attributes="class python: editable_mode and \'content editable\' or \'content\'">\n
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
index 93ee0e023b..461833c255 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log
@@ -1,3 +1,6 @@
+2006-09-08 Kevin
+* Don't display action box in default web view and factorize conditions.
+
 2006-09-07 jerome
 * fix <title>s
 
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
index 9a1371776c..89a16a7ddc 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
@@ -1 +1 @@
-169
\ No newline at end of file
+172
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/version b/product/ERP5/bootstrap/erp5_xhtml_style/bt/version
index 4582474e93..930a24be08 100644
--- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/version
+++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/version
@@ -1 +1 @@
-1.2.25
\ No newline at end of file
+1.2.26
\ No newline at end of file
-- 
2.30.9