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

Jean-Paul Smets jp at nexedi.com
Fri Dec 30 14:47:20 CET 2011


Hi,

Thanks. Interesting idea. To be integrated in a consistent way, here are 
the necessary steps.

1- Use of the existing areas (ex. object_vorkflow, object_button, etc.) 
instead of creating a new one or using a hack (ie. presence of icon 
property) to take decision of displaying something in an implicitely 
defined UI area
2- Port portal type actions so that workflow actions and portal type 
actions use same data structrure (ideally, by replacing DCWorkflow with 
ERP5Workflow and merging all patches to DCWorkflow into ERP5Workflow). 
This way, implementation will be consistent for all types of actions and 
there will be no question whether workflow actions should provide icons 
or not. Moreover, workflow actions in menus could also display icons in 
this case.
3- Add functional test

Once this is done, it can be integrated. Else, it is better to keep it 
as a patch for customer specific configuration.

Also, use of icons should be limited to minimum in generic bt5 since 
menus are more explicit and require less training / documentation. Icons 
are useful for customer projects whenever productivity matters more than 
UI consistency.

Regards,

JPS.



Le 22/12/2011 12:49, Boris Kocherov a écrit :
> 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>
>
>
> _______________________________________________
> Erp5-dev mailing list
> Erp5-dev at erp5.org
> https://mail.tiolive.com/mailman/listinfo/erp5-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20111230/24f74562/attachment.htm>


More information about the Erp5-dev mailing list