Discussion:
[Erp5-dev] [PATCH] use big icons for workflow actions
Boris Kocherov
2011-12-22 11:49:56 UTC
Permalink
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: <Loading Image...>
bartek
2011-12-30 12:38:11 UTC
Permalink
On Thu, 22 Dec 2011 15:49:56 +0400
Post by Boris Kocherov
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
I think it is a very good idea - I once did a similar thing myself, it
is still available on sourceforge
(see
http://sourceforge.net/apps/trac/addons-erp5/wiki/PatchsetContents#save_and_process_button
- the implementation is maybe a bit hackish, sorry for that).
It was done on a client's request, to speed up user's work. I went a
bit farther then you, because I combined workflow action with saving,
to prevent the user from losing his changes should he forget to save
before proceeding. The client was very happy because it saved two
clicks and one round-trip on every operation, which means a few seconds
every time, and for some users it can sum up to half an hour a day.
Plus, plus it eliminated many issues like "shucks, I did a worklflow
transition but I forgot to save".

Hope you find it useful.

Bartek
--
Do you know, where your towel is?
(re: Hitchhikers Guide to the Galaxy)
Jean-Paul Smets
2011-12-30 13:47:20 UTC
Permalink
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.
Post by Boris Kocherov
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>
Loading...