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
Leo Le Bouter
erp5
Commits
3258cc10
Commit
3258cc10
authored
Jun 17, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: table reference can be displayed at the place where it's defined
parent
caee2837
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
13 deletions
+5
-13
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_embedReportDocumentList.py
...rp5_corporate_identity/WebPage_embedReportDocumentList.py
+2
-0
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
...ortal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
+3
-13
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_embedReportDocumentList.py
View file @
3258cc10
...
@@ -45,6 +45,8 @@ if (doc_content.find('${WebPage_')):
...
@@ -45,6 +45,8 @@ if (doc_content.find('${WebPage_')):
)]
)]
substitution_list
=
re
.
findall
(
r'\
${We
bPage_(.*)}'
,
doc_content
)
substitution_list
=
re
.
findall
(
r'\
${We
bPage_(.*)}'
,
doc_content
)
for
substitution_report
in
substitution_list
:
for
substitution_report
in
substitution_list
:
if
substitution_report
==
'insertTableOfReferences'
:
continue
placeholder
=
''
.
join
([
'${WebPage_'
,
substitution_report
,
'}'
])
placeholder
=
''
.
join
([
'${WebPage_'
,
substitution_report
,
'}'
])
substitution_content
=
getReportViaFancyName
(
substitution_report
)
substitution_content
=
getReportViaFancyName
(
substitution_report
)
doc_content
=
doc_content
.
replace
(
placeholder
,
substitution_content
)
doc_content
=
doc_content
.
replace
(
placeholder
,
substitution_content
)
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
View file @
3258cc10
...
@@ -89,9 +89,6 @@ book_title = html_quote(override_document_title) if override_document_title else
...
@@ -89,9 +89,6 @@ book_title = html_quote(override_document_title) if override_document_title else
if
isinstance
(
book_content
,
unicode
):
if
isinstance
(
book_content
,
unicode
):
book_content
=
book_content
.
encode
(
"UTF-8"
)
book_content
=
book_content
.
encode
(
"UTF-8"
)
# backcompat
book_history_section_list
=
re
.
findall
(
'<section*?>.+?</section>'
,
book_content
,
re
.
S
)
# override for tests
# override for tests
if
override_batch_mode
:
if
override_batch_mode
:
book_modification_date
=
DateTime
(
"1976-11-04"
)
book_modification_date
=
DateTime
(
"1976-11-04"
)
...
@@ -129,9 +126,6 @@ book_image_list = []
...
@@ -129,9 +126,6 @@ book_image_list = []
book_table_list
=
[]
book_table_list
=
[]
book_table_of_content
=
blank
book_table_of_content
=
blank
# backcompat
book_content
=
book_content
.
replace
(
"${WebPage_insertTableOfReferences}"
,
blank
)
# XXX: not done
# XXX: not done
if
book_include_history_table
:
if
book_include_history_table
:
book_signature_list
=
[]
book_signature_list
=
[]
...
@@ -188,13 +182,9 @@ if book_include_reference_table:
...
@@ -188,13 +182,9 @@ if book_include_reference_table:
)
)
#if book_format == 'html' or book_format == 'mhtml':
#if book_format == 'html' or book_format == 'mhtml':
# book_references = book_references.encode('UTF-8').strip()
# book_references = book_references.encode('UTF-8').strip()
book_content
=
book_content
.
replace
(
"${WebPage_insertTableOfReferences}"
,
book_references
.
encode
(
'UTF-8'
).
strip
())
# backcompat for manual history tables at the beginning of documents
else
:
# NOTE: assumes <section>s are not used elsewhere!
book_content
=
book_content
.
replace
(
"${WebPage_insertTableOfReferences}"
,
blank
)
if
len
(
book_history_section_list
)
>
0
:
book_content
=
book_content
.
replace
(
book_history_section_list
[
-
1
],
(
book_history_section_list
[
-
1
]
+
book_references
.
encode
(
'UTF-8'
).
strip
()))
else
:
book_content
=
book_references
.
encode
(
'UTF-8'
).
strip
()
+
book_content
# table of content has to be created manually to run over everything that
# table of content has to be created manually to run over everything that
# should be indexed in the toc
# should be indexed in the toc
...
...
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