[Erp5-dev] [PATCH] use big icons for workflow actions

Boris Kocherov bk at raskon.org
Thu Dec 22 12:49:56 CET 2011


If the field  "Icon URL (formatted)" in
portal_workflow/test_workflow/transitions/test_action/manage_properties is
fulfiled by the icon url, then the icon appears in top right conner (near the
save button) of the documents which have the test_workflow

---
 .../portal_skins/erp5_xhtml_style/view_main.xml    |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 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 8ed3d47..2d00c3a 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
@@ -62,7 +62,7 @@
             tal:content="string:installUnsavedChangesWarning(\'$message\')">\n
           </script>\n
           <div class="document"\n
-               tal:define="actions actions/object_view | python: []">\n
+               tal:define="actions_object_view actions/object_view | python: []">\n
             <div class="actions"\n
                  tal:condition="python: (not is_web_mode or editable_mode) and len(actions)">\n
               <button tal:condition="python: not is_web_mode and form_action"\n
@@ -73,8 +73,18 @@
                 <span class="image"></span>\n
                 <span class="description" i18n:translate="" i18n:domain="ui">Save</span>\n
               </button>\n
+              <tal:block tal:repeat="action actions/workflow">\n
+                <button type="button" name="Base_doAction:method" tal:condition="action/icon"\n
+                  class="save"\n
+                  tal:attributes="title action/name;\n
+                  onclick string:location.href=\'${action/url}\';"\n
+                  i18n:attributes="title" i18n:domain="ui" >\n
+                  <span class="image" tal:attributes="style string:background-image:url(\'${portal/portal_url}/${action/icon}\');"></span>\n
+                  <span class="description" tal:content="action/name"></span>\n
+                </button>\n
+              </tal:block>\n
               <ul>\n
-                <li tal:repeat="action actions"\n
+                <li tal:repeat="action actions_object_view"\n
                     tal:attributes="class python: action == current_action and \'selected\' or \'not_selected\'">\n
                   <a tal:attributes="href python: \'%s%s%s\' % (action[\'url\'], \'?\' in action[\'url\'] and \'&amp;\' or \'?\', http_parameters)"\n
                     ><span i18n:translate="" i18n:domain="ui" tal:content="action/name">action_name</span></a>\n
@@ -84,7 +94,7 @@
             <div tal:attributes="class python: editable_mode and \'content editable\' or \'content\'">\n
               <tal:block metal:define-slot="main" />\n
               <div class="bottom_actions"\n
-                   tal:condition="python: is_web_mode and editable_mode and len(actions) and form_action">\n
+                   tal:condition="python: is_web_mode and editable_mode and len(actions_object_view) and form_action">\n
                 <input type="hidden" name="form_action" value=""\n
                        tal:attributes="value form_action" />\n
                 <input type="hidden" name="edit_document_url" value=""\n
@@ -114,8 +124,7 @@
       </tal:block>\n
     </tal:block>\n
   </tal:block>\n
-</tal:block>\n
-
+</tal:block>
 
 ]]></unicode> </value>
         </item>
-- 
1.7.8.rc3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-use-big-icons-for-workflow-actions.png
Type: image/png
Size: 202623 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20111222/e5e84958/attachment.png>


More information about the Erp5-dev mailing list