Commit 3258cc10 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: table reference can be displayed at the place where it's defined

parent caee2837
......@@ -45,6 +45,8 @@ if (doc_content.find('${WebPage_')):
)]
substitution_list = re.findall(r'\${WebPage_(.*)}', doc_content)
for substitution_report in substitution_list:
if substitution_report == 'insertTableOfReferences':
continue
placeholder = ''.join(['${WebPage_', substitution_report, '}'])
substitution_content = getReportViaFancyName(substitution_report)
doc_content = doc_content.replace(placeholder, substitution_content)
......
......@@ -89,9 +89,6 @@ book_title = html_quote(override_document_title) if override_document_title else
if isinstance(book_content, unicode):
book_content = book_content.encode("UTF-8")
# backcompat
book_history_section_list = re.findall('<section*?>.+?</section>', book_content, re.S)
# override for tests
if override_batch_mode:
book_modification_date = DateTime("1976-11-04")
......@@ -129,9 +126,6 @@ book_image_list = []
book_table_list = []
book_table_of_content = blank
# backcompat
book_content = book_content.replace("${WebPage_insertTableOfReferences}", blank)
# XXX: not done
if book_include_history_table:
book_signature_list = []
......@@ -188,13 +182,9 @@ if book_include_reference_table:
)
#if book_format == 'html' or book_format == 'mhtml':
# book_references = book_references.encode('UTF-8').strip()
# backcompat for manual history tables at the beginning of documents
# NOTE: assumes <section>s are not used elsewhere!
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
book_content = book_content.replace("${WebPage_insertTableOfReferences}", book_references.encode('UTF-8').strip())
else:
book_content = book_content.replace("${WebPage_insertTableOfReferences}", blank)
# table of content has to be created manually to run over everything that
# should be indexed in the toc
......
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