Commit 54107f82 authored by Łukasz Nowak's avatar Łukasz Nowak

- use precision on ODS table cells, using previous generated list of precision styles

- add scripts to get maximum precision and style prefix list and use them to parametrise list of styles
- fix rest of wrong 'decimal' names to 'figure'

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25346 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 66efe0f4
<?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>return 17 # The precision is 16 in reality, we need to use +1 for xrange support\n
</string> </value>
</item>
<item>
<key> <string>_code</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/>
</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>Base_getODSMaximumSupportedPrecision</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return (\'\',\'stat-\')\n
</string> </value>
</item>
<item>
<key> <string>_code</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/>
</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>Base_getODSSupportedStylePrefixList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -110,23 +110,14 @@
<tal:block tal:define="field python: editable_fields.get(column_id, None)">\n
<tal:block tal:condition="python: field is not None">\n
<tal:block tal:condition="python:field.meta_type in [\'FloatField\',\'IntegerField\'] or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type in [\'FloatField\',\'IntegerField\'])">\n
<tal:block tal:define="precision python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'precision\') or 0">\n
<tal:block tal:condition="python:precision>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name python: \'decimal_%s_%s\' % (style_prefix , precision)"\n
office:value-type="float"\n
table:style-name="decimal">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="not: python: precision>0">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}figure"\n
office:value-type="float"\n
table:style-name="figure">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
</tal:block> \n
<tal:block tal:define="precision python: (field.meta_type == \'FloatField\' or (field.meta_type == \'ProxyField\' and field.getRecursiveTemplateField().meta_type == \'FloatField\')) and field.get_value(\'precision\') or 0;\n
figure_style_name string:${style_prefix}figure_${precision}">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name figure_style_name"\n
office:value-type="float"\n
table:style-name="figure">\n
<text:p tal:content="python: field.render_pdf(value)" />\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="python:field.meta_type not in [\'FloatField\',\'IntegerField\'] and field.meta_type!=\'ProxyField\'">\n
<table:table-cell tal:attributes="table:style-name string:${style_prefix}string;"\n
......@@ -139,9 +130,9 @@
</tal:block>\n
<tal:block tal:condition="python: field is None">\n
<table:table-cell tal:attributes="office:value value;\n
table:style-name string:${style_prefix}decimal"\n
table:style-name string:${style_prefix}figure"\n
office:value-type="float"\n
table:style-name="decimal">\n
table:style-name="figure">\n
<text:p tal:condition="python: field is None"\n
tal:content="python: value"/>\n
<text:p tal:condition="python: field is not None"\n
......
......@@ -140,30 +140,16 @@
<style:style style:name="date_with_time" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="date_style">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<number:number-style style:name="four_decimal">\n
<number:number number:decimal-places="4" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="three_decimal">\n
<number:number number:decimal-places="3" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="two_decimal">\n
<number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<number:number-style style:name="one_decimal">\n
<number:number number:decimal-places="1" number:min-integer-digits="1" number:grouping="true"/>\n
</number:number-style>\n
<style:style style:name="decimal_4" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="four_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="decimal_3" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="three_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="decimal_2" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="two_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<style:style style:name="decimal_1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="one_decimal">\n
<style:table-cell-properties style:vertical-align=\'middle\' style:repeat-content=\'false\' style:text-align-source=\'fix\' fo:border-right=\'0.002cm solid #000000\' />\n
</style:style>\n
<tal:block tal:repeat="precision python: xrange(0,here.Base_getODSMaximumSupportedPrecision())">\n
<tal:block tal:define="figure_data_precision_style_name string:figure_data_precision_${precision}">\n
<number:number-style style:name="figure_data_precision_X" tal:attributes="style:name figure_data_precision_style_name">\n
<number:number number:decimal-places="X" number:min-integer-digits="1" number:grouping="true" tal:attributes="number:decimal-places precision"/>\n
</number:number-style>\n
<tal:block tal:repeat="style_prefix_name python: here.Base_getODSSupportedStylePrefixList()">\n
<style:style style:name="figure_X" style:family="table-cell" style:parent-style-name="figure" style:data-style-name="figure_data_precision_X" tal:attributes="style:name string:${style_prefix_name}figure_${precision}; style:data-style-name figure_data_precision_style_name ; style:parent-style-name string:${style_prefix_name}figure"/>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</office:automatic-styles>\n
</tal:block>\n
......
190
\ No newline at end of file
201
\ 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