From 29f11b331ad8f5affbd6b705cbec1c4dbcd6b899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Thu, 1 Nov 2007 10:22:07 +0000 Subject: [PATCH] Use xml mode for page templates ( to make macros reusable ) git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17340 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_pdf_style/empty_pdf.xml | 7 ++----- .../erp5_pdf_style/field_pdf_macro.xml | 14 ++++++++------ .../portal_skins/erp5_pdf_style/form_list.xml | 9 +++------ .../portal_skins/erp5_pdf_style/form_view.xml | 12 +++++------- .../erp5_pdf_style/listbox_pdf_macro.xml | 18 +++++++++--------- .../erp5_pdf_style/matrixbox_pdf_macro.xml | 14 +++++++------- .../erp5_pdf_style/report_view.xml | 3 ++- bt5/erp5_pdf_style/bt/revision | 2 +- 8 files changed, 37 insertions(+), 42 deletions(-) diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/empty_pdf.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/empty_pdf.xml index c783989412..6f5c865ff6 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/empty_pdf.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/empty_pdf.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PageTemplates.ZopePageTemplate</string> - <string>ZopePageTemplate</string> - </tuple> - <none/> + <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> + <tuple/> </tuple> </pickle> <pickle> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/field_pdf_macro.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/field_pdf_macro.xml index 83a155ddf3..b3d7f5b885 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/field_pdf_macro.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/field_pdf_macro.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PageTemplates.ZopePageTemplate</string> - <string>ZopePageTemplate</string> - </tuple> - <none/> + <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> + <tuple/> </tuple> </pickle> <pickle> @@ -54,6 +51,10 @@ <key> <string>_text</string> </key> <value> <string encoding="cdata"><![CDATA[ +<?xml version="1.0" encoding="iso-8859-1" ?>\n +<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n + xmlns:metal="http://xml.zope.org/namespaces/metal"\n + xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n <tal:block tal:replace="nothing">\n Users of this page template must define \'field\' name.\n It will dispatch to the good macro, and supports proxy fields (in a quite ad-hoc way).\n @@ -72,13 +73,14 @@ It will dispatch to the good macro, and supports proxy fields (in a quite ad-hoc <table><tr><td tal:content="python: \' \'"></td></tr></table>\n </tal:block>\n \n +</tal:block>\n </tal:block> ]]></string> </value> </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_list.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_list.xml index 1e7e8984c3..6c62477ad1 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_list.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_list.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.ERP5Form.PDFTemplate</string> - <string>PDFTemplate</string> - </tuple> - <none/> + <global name="PDFTemplate" module="Products.ERP5Form.PDFTemplate"/> + <tuple/> </tuple> </pickle> <pickle> @@ -78,7 +75,7 @@ </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_view.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_view.xml index de751ea9cb..9dcc4b76b2 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_view.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/form_view.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.ERP5Form.PDFTemplate</string> - <string>PDFTemplate</string> - </tuple> - <none/> + <global name="PDFTemplate" module="Products.ERP5Form.PDFTemplate"/> + <tuple/> </tuple> </pickle> <pickle> @@ -58,6 +55,7 @@ <document filename="erp5_list.pdf"\n xmlns:tal="http://xml.zope.org/namespaces/tal"\n xmlns:metal="http://xml.zope.org/namespaces/metal"\n + xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n tal:define="global frame_width python:25.8"\n metal:define-macro="master">\n <title>List Print</title>\n @@ -95,7 +93,7 @@ tal:content="python: str(value)"\n tal:condition="not:item_list" />\n <para style="TableStandard"\n - tal:content="python: [i[0].replace(\' \', \'\') for i in item_list if i[1] == value][0]"\n + tal:content="python: [i[0].replace(\'&nbsp;\', \'\') for i in item_list if i[1] == value][0]"\n tal:condition="item_list" />\n </tal:block>\n <tal:block tal:condition="python: value == None">\n @@ -131,7 +129,7 @@ </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml index 88bc5cae37..7d2dfbc1e5 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/listbox_pdf_macro.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PageTemplates.ZopePageTemplate</string> - <string>ZopePageTemplate</string> - </tuple> - <none/> + <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> + <tuple/> </tuple> </pickle> <pickle> @@ -54,7 +51,10 @@ <key> <string>_text</string> </key> <value> <string encoding="cdata"><![CDATA[ -<html>\n +<?xml version="1.0" encoding="iso-8859-1" ?>\n +<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n + xmlns:metal="http://xml.zope.org/namespaces/metal"\n + xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n <head>\n <title tal:content="python: here.Localizer.erp5_ui.gettext(template.title).encode(\'utf8\')" >Listbox PDF Macro</title>\n </head>\n @@ -143,7 +143,7 @@ <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])"\n tal:define="field python: editable_fields.get(column_id, None)" >\n <para tal:condition="python: field is None"\n - style="TableStandard" tal:content="string:${column_property}"\n + style="TableStandard" tal:content="column_property"\n tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableStandardRightAligned\' or \'TableStandardLeftAligned\'" />\n <para tal:condition="python: field is not None"\n style="TableStandard" tal:content="python:field.render_pdf(column_property)"\n @@ -167,7 +167,7 @@ <td tal:attributes="colwidth python:\'%.2fcm\' % float(column_width[column_id])"\n tal:define="field python: editable_fields.get(column_id, None)">\n <para tal:condition="python: field is None"\n - style="TableLastLine" tal:content="string:${column_property}"\n + style="TableLastLine" tal:content="column_property"\n tal:attributes="style python:isinstance(column_property, (int, long, float)) and \'TableLastLineRightAligned\' or \'TableLastLineLeftAligned\'" />\n <para tal:condition="python: field is not None"\n style="TableLastLine" tal:content="python: field.render_pdf(column_property)"\n @@ -204,7 +204,7 @@ </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/matrixbox_pdf_macro.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/matrixbox_pdf_macro.xml index 7a090e339d..09090479ba 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/matrixbox_pdf_macro.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/matrixbox_pdf_macro.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>Products.PageTemplates.ZopePageTemplate</string> - <string>ZopePageTemplate</string> - </tuple> - <none/> + <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> + <tuple/> </tuple> </pickle> <pickle> @@ -54,7 +51,10 @@ <key> <string>_text</string> </key> <value> <string encoding="cdata"><![CDATA[ -<html>\n +<?xml version="1.0" encoding="iso-8859-1" ?>\n +<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n + xmlns:metal="http://xml.zope.org/namespaces/metal"\n + xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n <head>\n <title tal:content="template/title">Matrixbox PDF Macro</title>\n </head>\n @@ -97,7 +97,7 @@ </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/report_view.xml b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/report_view.xml index a960600673..24e09ef392 100644 --- a/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/report_view.xml +++ b/bt5/erp5_pdf_style/SkinTemplateItem/portal_skins/erp5_pdf_style/report_view.xml @@ -55,6 +55,7 @@ <document filename="erp5_list.pdf"\n xmlns:tal="http://xml.zope.org/namespaces/tal"\n xmlns:metal="http://xml.zope.org/namespaces/metal"\n + xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n tal:define="landscape python: int(request.get(\'landscape\', 0) or 0);\n global frame_width python:landscape and 25.8 or 19"\n metal:define-macro="master">\n @@ -169,7 +170,7 @@ </item> <item> <key> <string>content_type</string> </key> - <value> <string>text/html</string> </value> + <value> <string>application/xml</string> </value> </item> <item> <key> <string>expand</string> </key> diff --git a/bt5/erp5_pdf_style/bt/revision b/bt5/erp5_pdf_style/bt/revision index 7003e7fe1f..8783e30511 100644 --- a/bt5/erp5_pdf_style/bt/revision +++ b/bt5/erp5_pdf_style/bt/revision @@ -1 +1 @@ -51 \ No newline at end of file +53 \ No newline at end of file -- 2.30.9