Commit 097ed941 authored by Fabien Morin's avatar Fabien Morin

Improve GadgetTool_viewPrettyGadgetDialog form :

* GadgetTool_viewPrettyGadgetDialog is used to add a gadget in the current Knowledge Pad.
It previously used an sub EditorField to display the gadget image. Instead of this, replace it by a ImageField, which will be use to standardize the rendering and size of all screenshots.
* Add a new columns which shows the gadget description.
* Replace the custom listmethod GadgetTool_getGadgetList by the standard portal_catalog call.
* Use the portal type parameter to filter only Gadget.
* Use the default parameters's parameter to pass the value of gadget_type_uid.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32218 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12e5781a
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
Filter found gadgets in respect to the current mode.\n
"""\n
portal = context.getPortalObject()\n
mode = kw.get(\'mode\', None)\n
if mode is not None:\n
gadget_type_category = portal.restrictedTraverse(\'portal_categories/gadget_type/%s\' %mode,\n
None)\n
if gadget_type_category is not None:\n
kw[\'gadget_type_uid\'] = gadget_type_category.getUid()\n
return portal.portal_gadgets.searchFolder(**kw)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>None</string>
<string>mode</string>
<string>gadget_type_category</string>
<string>_write_</string>
<string>_apply_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>GadgetTool_getGadgetList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <value>
<list> <list>
<string>listbox_description</string> <string>listbox_thumbnail</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -16,12 +16,15 @@ ...@@ -16,12 +16,15 @@
<string>columns</string> <string>columns</string>
<string>count_method</string> <string>count_method</string>
<string>css_class</string> <string>css_class</string>
<string>default_params</string>
<string>editable_columns</string> <string>editable_columns</string>
<string>hide_rows_on_no_search_criterion</string> <string>hide_rows_on_no_search_criterion</string>
<string>list_method</string> <string>list_method</string>
<string>portal_types</string> <string>portal_types</string>
<string>search_columns</string> <string>search_columns</string>
<string>selection_name</string> <string>selection_name</string>
<string>sort</string>
<string>sort_columns</string>
<string>title</string> <string>title</string>
<string>url_columns</string> <string>url_columns</string>
</list> </list>
...@@ -65,6 +68,28 @@ ...@@ -65,6 +68,28 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>count_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default_params</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>field_id</string> </key> <key> <string>field_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -73,10 +98,46 @@ ...@@ -73,10 +98,46 @@
<key> <string>form_id</string> </key> <key> <string>form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>hide_rows_on_no_search_criterion</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>list_method</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>search_columns</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -96,6 +157,10 @@ ...@@ -96,6 +157,10 @@
<string>description</string> <string>description</string>
<string>Description</string> <string>Description</string>
</tuple> </tuple>
<tuple>
<string>thumbnail</string>
<string>Thumbnail</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
...@@ -107,13 +172,19 @@ ...@@ -107,13 +172,19 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>full_width</string> </value> <value> <string>full_width</string> </value>
</item> </item>
<item>
<key> <string>default_params</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>editable_columns</string> </key> <key> <string>editable_columns</string> </key>
<value> <value>
<list> <list>
<tuple> <tuple>
<string>description</string> <string>thumbnail</string>
<string>Description</string> <string>Thumbnail</string>
</tuple> </tuple>
</list> </list>
</value> </value>
...@@ -133,7 +204,7 @@ ...@@ -133,7 +204,7 @@
<item> <item>
<key> <string>list_method</string> </key> <key> <string>list_method</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -155,6 +226,10 @@ ...@@ -155,6 +226,10 @@
<string>translated_title</string> <string>translated_title</string>
<string>Title</string> <string>Title</string>
</tuple> </tuple>
<tuple>
<string>description</string>
<string>Description</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
...@@ -162,6 +237,23 @@ ...@@ -162,6 +237,23 @@
<key> <string>selection_name</string> </key> <key> <string>selection_name</string> </key>
<value> <string>gadget_tool_view_pretty_gadget_dialog</string> </value> <value> <string>gadget_tool_view_pretty_gadget_dialog</string> </value>
</item> </item>
<item>
<key> <string>sort</string> </key>
<value>
<list>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>sort_columns</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>target</string> </key> <key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value> <value> <string>Click to edit the target</string> </value>
...@@ -192,6 +284,22 @@ ...@@ -192,6 +284,22 @@
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:[[\'gadget_type_uid\', context.getPortalObject().restrictedTraverse(\'portal_categories/gadget_type/%s\' %request.get(\'mode\', None) , None) is not None and context.getPortalObject().restrictedTraverse(\'portal_categories/gadget_type/%s\' %request.get(\'mode\',None), None).getUid() or \'\'],]</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<tuple> <tuple>
<global name="Method" module="Products.Formulator.MethodField"/> <global name="Method" module="Products.Formulator.MethodField"/>
...@@ -202,7 +310,7 @@ ...@@ -202,7 +310,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>method_name</string> </key> <key> <string>method_name</string> </key>
<value> <string>GadgetTool_getGadgetList</string> </value> <value> <string>portal_catalog</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<global name="EditorField" module="Products.ERP5Form.EditorField"/> <global name="ImageField" module="Products.ERP5Form.ImageField"/>
<tuple/> <tuple/>
</tuple> </tuple>
</pickle> </pickle>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>listbox_description</string> </value> <value> <string>listbox_thumbnail</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -21,21 +21,13 @@ ...@@ -21,21 +21,13 @@
<key> <string>external_validator_failed</string> </key> <key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </item>
<item>
<key> <string>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item> <item>
<key> <string>required_not_found</string> </key> <key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value> <value> <string>Input is required but no input given.</string> </value>
</item> </item>
<item> <item>
<key> <string>too_long</string> </key> <key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value> <value> <string>Too much input was given.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -60,6 +52,14 @@ ...@@ -60,6 +52,14 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -77,23 +77,23 @@ ...@@ -77,23 +77,23 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>image_display</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>image_format</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_linelength</string> </key> <key> <string>image_resolution</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -101,11 +101,11 @@ ...@@ -101,11 +101,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>text_editor</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>truncate</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -116,10 +116,6 @@ ...@@ -116,10 +116,6 @@
<key> <string>whitespace_preserve</string> </key> <key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -145,6 +141,14 @@ ...@@ -145,6 +141,14 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -162,23 +166,23 @@ ...@@ -162,23 +166,23 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>image_display</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>image_format</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_linelength</string> </key> <key> <string>image_resolution</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -186,11 +190,11 @@ ...@@ -186,11 +190,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>text_editor</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>truncate</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -201,10 +205,6 @@ ...@@ -201,10 +205,6 @@
<key> <string>whitespace_preserve</string> </key> <key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
</item> </item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string>hidden</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
...@@ -228,6 +228,14 @@ ...@@ -228,6 +228,14 @@
<key> <string>description</string> </key> <key> <string>description</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
...@@ -244,24 +252,24 @@ ...@@ -244,24 +252,24 @@
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>image_display</string> </key>
<value> <string></string> </value> <value> <string>xsmall</string> </value>
</item> </item>
<item> <item>
<key> <string>max_linelength</string> </key> <key> <string>image_format</string> </key>
<value> <string></string> </value> <value> <string>png</string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>image_resolution</string> </key>
<value> <int>75</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -269,16 +277,12 @@ ...@@ -269,16 +277,12 @@
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>text_editor</string> </key> <key> <string>title</string> </key>
<value> <string>text_area</string> </value> <value> <string>Thumbnail</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>truncate</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <int>0</int> </value>
&nbsp;
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>unicode</string> </key> <key> <string>unicode</string> </key>
...@@ -288,10 +292,6 @@ ...@@ -288,10 +292,6 @@
<key> <string>whitespace_preserve</string> </key> <key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -301,18 +301,15 @@ ...@@ -301,18 +301,15 @@
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="TALESMethod" module="Products.Formulator.TALESField"/>
<string>Products.Formulator.TALESField</string> <tuple/>
<string>TALESMethod</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.Gadget_viewPrettyHTMLDescriptionRenderer(cell=cell)</string> </value> <value> <string>python:hasattr(cell, \'getObject\') and getattr(cell.getObject(), \'image_id\', None) is not None and \'%s/%s\' % (cell.getObject().absolute_url(), getattr(cell.getObject(), \'image_id\', None)) or \'\'</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
445 446
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment