Commit 55f49d3b authored by Romain Courteaud's avatar Romain Courteaud

Use render_css and get_javascript_list methods instead of adding specific script for PlanningBox

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14923 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 43261890
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</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 encoding="cdata"><![CDATA[
# Return first planningbox in a form that is enabled and not hidden\n
# Christophe Dumez <christophe@nexedi.com>\n
# This script should be used to detect a listbox planningbox having to name it "planningbox"\n
\n
form=context\n
\n
if form.meta_type != \'ERP5 Form\':\n
return None\n
\n
# we start with \'bottom\' because most of the time\n
# the planningbox is there.\n
for group in (\'bottom\', \'center\', \'left\', \'right\'):\n
for field in form.get_fields_in_group(group):\n
if field.meta_type == \'PlanningBox\' and not(field[\'hidden\']) and field[\'enabled\']:\n
return field\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></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>context</string>
<string>form</string>
<string>_getattr_</string>
<string>None</string>
<string>_getiter_</string>
<string>group</string>
<string>field</string>
<string>_getitem_</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>Form_getPlanningBox</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -77,7 +77,7 @@
global js_list js_list | python: [\'%s/erp5_xhtml_appearance.js\' % portal_path,];\n
global js_list python:[\'%s/MochiKit/MochiKit.js\' % portal_path,\n
\'%s/erp5.js\' % portal_path,\n
] + js_list;\n
] + js_list;\n
\n
global http_parameter_list python: here.ERP5Site_filterParameterList(request.form);\n
dummy python: http_parameter_list.update(local_parameter_list);\n
......@@ -109,24 +109,6 @@
tal:attributes="name python: parameter[0];\n
value python: parameter[1];"/>\n
</tal:block>\n
</tal:block>\n
\n
<!-- ============================================================== -->\n
\n
<tal:block metal:define-macro="planning_box_definitions">\n
<tal:block tal:condition="form/pt | nothing">\n
<tal:block tal:define="planning_box python: form.Form_getPlanningBox()">\n
<tal:block tal:condition="python: planning_box">\n
<!-- PlanningBox generic stuff -->\n
<style tal:content="structure python: planning_box.render_css(None,REQUEST=request)"\n
tal:attributes="type python:\'text/css\'">\n
</style>\n
<tal:block tal:condition="python: planning_box.get_value(\'js_enabled\')">\n
<tal:block tal:define="dummy python:js_list.append(\'%s/wz_dragdrop.js\' % (here.portal_url.getPortalPath(), ));" />\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></string> </value>
......
......@@ -453,7 +453,6 @@ Beware this only generates the HTML code, no CSS generation is done in this scri
<!--/div-->\n
</div>\n
</tal:block>\n
</tal:block>\n
]]></string> </value>
......
......@@ -96,8 +96,33 @@ IDEAS:\n
<link tal:attributes="href css" type="text/css" rel="stylesheet"/>\n
</tal:block>\n
\n
<tal:block metal:use-macro="global_definitions_macros/planning_box_definitions"/>\n
<tal:block tal:replace="nothing">\n
<!-- Render each field\'s css and javascript. -->\n
</tal:block>\n
<tal:block tal:condition="python: form is not None">\n
<tal:block tal:repeat="group python: form.Form_getGroupTitleAndId()">\n
<tal:block tal:define="gid group/gid;">\n
<tal:block tal:condition="python: gid.find(\'hidden\') < 0">\n
<tal:block tal:repeat="field python: form.get_fields_in_group(group[\'goid\'])">\n
\n
<tal:block tal:define="css python: field.render_css(REQUEST=request)">\n
<tal:block tal:condition="python: css is not None">\n
<style tal:content="css"\n
tal:attributes="type python:\'text/css\'">\n
</style>\n
</tal:block>\n
</tal:block>\n
\n
<tal:block tal:define="dummy python: js_list.extend(field.get_javascript_list(REQUEST=request))" />\n
\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
\n
\n
<!-- May need to remove duplicates -->\n
<tal:block tal:repeat="js js_list">\n
<script tal:attributes="src js" type="text/javascript"></script>\n
</tal:block>\n
......
389
\ No newline at end of file
391
\ 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