Commit c0bcfeaa authored by Jérome Perrin's avatar Jérome Perrin

remove some duplicated parts, and unusued macros; now the listbox title line...

remove some duplicated parts, and unusued macros; now the listbox title line is displayed in listbox_ods_macro, and rendered differently based on "display_header" variable, which is true in the case of form_list, or the first form_list rendered in form_report

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35055 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 995e13c7
......@@ -50,7 +50,7 @@
xmlns:metal=\'http://xml.zope.org/namespaces/metal\'\n
tal:attributes=\'dummy python:request.RESPONSE.setHeader("Content-Type", "text/html;; charset=utf-8")\'\n
office:version=\'1.0\'\n
tal:define="global frame_width python:25.8" metal:define-macro="master"\n
metal:define-macro="master"\n
i18n:domain="erp5_ui">\n
<tal:block metal:use-macro="here/style_macros/macros/style_macro"/>\n
<office:body>\n
......@@ -58,56 +58,21 @@
<table:table table:style-name=\'ta1\' table:print=\'false\' tal:attributes="table:name here/getTitle" i18n:attributes="table:name">\n
<tal:block metal:define-macro="form_layout"\n
tal:define="dummy python: request.set(\'here\', here);\n
global display_header display_header|python:True;\n
listbox form/listbox | nothing;">\n
<tal:block tal:condition="listbox">\n
<tal:block metal:use-macro="here/listbox_ods_macro/macros/listbox">\n
<tal:block metal:fill-slot="list_header">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList"> \n
<tal:block tal:define="column_property python: column_item[1]; column_id python: column_item[0]">\n
<table:table-column table:style-name=\'co2\' table:default-cell-style-name=\'report-column-title\'/>\n
</tal:block>\n
</tal:block>\n
<table:table-header-rows>\n
<table:table-row table:style-name=\'ro4\'>\n
<tal:block tal:condition="python: is_report_tree_mode">\n
<table:table-cell table:style-name=\'report-column-title\' table:number-columns-spanned=\'1\' office:value-type=\'string\' >\n
<tal:block tal:condition="listboxline/getSectionName">\n
<text:p tal:content="python: here.Localizer.erp5_ui.gettext(listboxline.getSectionName()).encode(\'utf-8\')"/>\n
</tal:block>\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="listboxline/isTitleLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1]; column_id python: column_item[0]">\n
<tal:block tal:condition="python: column_property is not None" >\n
<table:table-cell table:number-rows-spanned=\'1\' table:style-name=\'report-column-title\' table:number-columns-spanned=\'1\' office:value-type=\'string\' >\n
<text:p i18n:translate="" i18n:domain="ui" tal:content="column_property">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="python: column_property is None">\n
<table:table-cell table:number-rows-spanned=\'1\' table:style-name=\'report-column-title\' table:number-colwithdrawnumns-spanned=\'1\' office:value-type=\'string\'>\n
<text:p tal:content="python: \'\'">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</table:table-header-rows>\n
</tal:block>\n
<tal:block metal:fill-slot=\'table_bottom_line\'>\n
<tal:block metal:fill-slot=\'table_bottom_line\' \n
tal:define="global display_header python:False;">\n
<tal:block tal:replace="nothing"> don\'t write bottom line in case of this form_list, \'Page Format\' of OOo works instead of it.</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table>\n
</office:spreadsheet>\n
</office:body>\n
</office:document-content>\n
</office:document-content>
]]></string> </value>
</item>
......
......@@ -62,9 +62,8 @@ dQEAAAAA</string> </value>
table:default-cell-style-name=\'report-column-title\'/>\n
\n
<!-- macro form_layout -->\n
<tal:block metal:define-macro="form_layout">\n
<tal:block metal:define-macro="form_layout" tal:define="display_header python:False">\n
<tal:block tal:define="global group_list python:form.get_groups()"/>\n
<!-- Use the user preferences -->\n
<tal:block tal:repeat="group python: [g for g in group_list if g not in (\'hidden\', )]">\n
<tal:block tal:define="field_list python: form.get_fields_in_group(group)">\n
<tal:block tal:condition="python: field_list not in [None, []]">\n
......
......@@ -47,7 +47,7 @@
<tal:block metal:use-macro="here/style_macros/macros/style_macro"/>\n
<office:scripts/>\n
\n
<office:body metal:define-macro="form_layout">\n
<office:body>\n
<office:spreadsheet>\n
\n
<tal:block metal:define-macro="listbox_line">\n
......@@ -55,47 +55,8 @@
<tal:block tal:condition="python: listbox_line_structure[\'line\'] is not None"\n
tal:define="listboxline python: listbox_line_structure[\'line\']">\n
\n
<tal:block metal:define-slot="for_form_list"\n
tal:condition="listboxline/isTitleLine">\n
<tal:block metal:define-slot="list_header">\n
<table:table-row table:style-name=\'ro4\'>\n
<tal:block tal:condition="python: is_report_tree_mode">\n
<table:table-cell table:style-name=\'report-column-title\'\n
table:number-columns-spanned=\'1\'\n
office:value-type=\'string\'>\n
<tal:block tal:condition="listboxline/getSectionName">\n
<text:p tal:content="listboxline/getSectionName"/>\n
</tal:block>\n
</table:table-cell>\n
<tal:block tal:repeat="empty_index python: xrange(0, max_section_depth-1)">\n
<table:table-cell table:style-name=\'report-column-title\'\n
table:number-columns-spanned=\'1\'\n
office:value-type=\'string\'>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
\n
<tal:block tal:condition="listboxline/isTitleLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1];\n
column_id python: column_item[0]">\n
<table:table-cell table:number-rows-spanned=\'1\' \n
table:style-name=\'report-column-title\'\n
table:number-columns-spanned=\'1\'\n
office:value-type=\'string\'>\n
<text:p i18n:translate="" i18n:domain="ui"\n
tal:content="python: column_property or \'\'">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</tal:block>\n
</tal:block>\n
\n
<!-- title line itself is rendered in listbox_ods_macro --> \n
<tal:block tal:condition="not:listboxline/isTitleLine">\n
\n
<table:table-row>\n
<tal:block tal:condition="python: listboxline.isDataLine()">\n
<tal:block tal:repeat="empty_index python: xrange(0, max_section_depth)">\n
......
......@@ -65,13 +65,48 @@
max_section_depth python: max([x.getSectionDepth() for x in listboxline_list]) + int(is_report_tree_mode);\n
" i18n:domain="ui">\n
\n
<!-- Define a slot specific for form_list, because in list mode we want to use a \n
<table:table-header-rows> so that header is repeated on all pages, and we can\'t\n
do this in form_view, because only one table-header-rows is allowed in <table:table>.\n
-->\n
<tal:block metal:define-slot="for_form_list"\n
tal:condition="listboxline/isTitleLine">\n
<tal:block metal:define-slot="list_header">\n
<tal:block tal:condition="listboxline/isTitleLine">\n
\n
<tal:block tal:condition="display_header | nothing">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1]; column_id python: column_item[0]">\n
<table:table-column table:style-name=\'co2\'\n
table:default-cell-style-name=\'report-column-title\'/>\n
</tal:block>\n
</tal:block> \n
\n
<table:table-header-rows>\n
<table:table-row table:style-name=\'ro4\'>\n
<tal:block tal:condition="python: is_report_tree_mode">\n
<table:table-cell table:style-name=\'report-column-title\' table:number-columns-spanned=\'1\' office:value-type=\'string\' >\n
<tal:block tal:condition="listboxline/getSectionName">\n
<text:p tal:content="python: here.Localizer.erp5_ui.gettext(listboxline.getSectionName()).encode(\'utf-8\')"/>\n
</tal:block>\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="listboxline/isTitleLine">\n
<tal:block tal:repeat="column_item listboxline/getColumnItemList">\n
<tal:block tal:define="column_property python: column_item[1]; column_id python: column_item[0]">\n
<tal:block tal:condition="python: column_property is not None" >\n
<table:table-cell table:number-rows-spanned=\'1\' table:style-name=\'report-column-title\' table:number-columns-spanned=\'1\' office:value-type=\'string\' >\n
<text:p i18n:translate="" i18n:domain="ui" tal:content="column_property">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
<tal:block tal:condition="python: column_property is None">\n
<table:table-cell table:number-rows-spanned=\'1\' table:style-name=\'report-column-title\' table:number-colwithdrawnumns-spanned=\'1\' office:value-type=\'string\'>\n
<text:p tal:content="python: \'\'">\n
</text:p>\n
</table:table-cell>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</table:table-header-rows>\n
</tal:block>\n
\n
<tal:block tal:condition="not:display_header">\n
<table:table-row table:style-name=\'ro4\'>\n
<tal:block tal:repeat="empty_index python: xrange(0, max_section_depth)">\n
<table:table-cell table:style-name=\'report-column-title\'\n
......@@ -92,7 +127,7 @@
</tal:block>\n
</tal:block>\n
</table:table-row>\n
</tal:block>\n
</tal:block> \n
</tal:block>\n
\n
<tal:block metal:use-macro="here/listbox_line_ods_macro/macros/listbox_line"/>\n
......
234
\ No newline at end of file
237
\ 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