Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
2348d74a
Commit
2348d74a
authored
Oct 31, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip page template continued"
parent
fb3802f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
product/ERP5/Document/PageTemplate.py
product/ERP5/Document/PageTemplate.py
+4
-4
product/ERP5Type/patches/SourceCodeEditorZMI.py
product/ERP5Type/patches/SourceCodeEditorZMI.py
+5
-1
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
+1
-1
No files found.
product/ERP5/Document/PageTemplate.py
View file @
2348d74a
...
...
@@ -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'
)
...
...
product/ERP5Type/patches/SourceCodeEditorZMI.py
View file @
2348d74a
...
...
@@ -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'
...
...
product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py
View file @
2348d74a
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment