Commit 2348d74a authored by Jérome Perrin's avatar Jérome Perrin

wip page template continued"

parent fb3802f7
......@@ -111,16 +111,16 @@ class PageTemplate(XMLObject, ZopePageTemplate, ExpressionMixin('expression')):
__call__ = ZopePageTemplate.__call__
# keep `text` stored as unicode for page template engine, but exposed
# as an utf-8 encoded string for ERP5 interface.
# BBB PY2: keep `text` stored as unicode for page template engine, but
# exposed as an utf-8 encoded str for ERP5 interface
def _setText(self, value):
print ('_setText', repr(value))
#print ('_setText', repr(value))
if six.PY2 and isinstance(value, str):
value = value.decode('utf-8')
self.pt_edit(value, self.getContentType())
def getText(self, default=''):
print('getText')
#print('getText')
value = self._text or default
if six.PY2:
value = value.encode('utf-8')
......
......@@ -71,7 +71,11 @@ def manage_page_footer(self):
elif document.meta_type in ('Z SQL Method', 'ERP5 SQL Method'):
mode = 'sql'
textarea_selector = 'textarea[name="template:text"]'
elif document.meta_type in ('Page Template', 'ERP5 OOo Template', ):
elif document.meta_type in (
'Page Template',
'ERP5 OOo Template',
'ERP5 Page Template',
):
if 'html' in document.content_type:
if editor == 'codemirror':
mode = 'htmlmixed'
......
......@@ -454,7 +454,7 @@ class ERP5TypeFunctionalTestCase(ERP5TypeTestCase):
for page_template_path, page_template in tests_tool.ZopeFind(
tests_tool[self.run_only] if self.run_only else tests_tool,
obj_metatypes=('Page Template',), search_sub=1):
obj_metatypes=('Page Template', 'ERP5 Page Template',), search_sub=1):
try:
page_template.pt_render()
except Exception:
......
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