Commit 29f11b33 authored by Jérome Perrin's avatar Jérome Perrin

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
parent f1e5737f
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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(\'&nbsp;\', \'\') for i in item_list if i[1] == value][0]"\n
tal:content="python: [i[0].replace(\'&amp;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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
51
\ No newline at end of file
53
\ 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