Commit 964a9600 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_corporate_identity: display manually hisotry tables instead of fake one

book_signature_list, book_version_list, book_distribution_list are not done and always empty
parent 95b5ff34
...@@ -37,6 +37,7 @@ Generates the complete book (only called in HTML version) ...@@ -37,6 +37,7 @@ Generates the complete book (only called in HTML version)
book_full_reference python: options.get('book_full_reference'); book_full_reference python: options.get('book_full_reference');
book_source_organisation_title python: options.get('book_source_organisation_title'); book_source_organisation_title python: options.get('book_source_organisation_title');
margin_15mm python: options.get('margin_15mm'); margin_15mm python: options.get('margin_15mm');
book_history_section_list python: options.get('book_history_section_list');
book_table_of_content python: options.get('book_table_of_content');"> book_table_of_content python: options.get('book_table_of_content');">
<!DOCTYPE html> <!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', book_theme, ' ci-', book_language])"> <html tal:attributes="class python: ''.join(['ci-', book_theme, ' ci-', book_language])">
...@@ -75,7 +76,7 @@ Generates the complete book (only called in HTML version) ...@@ -75,7 +76,7 @@ Generates the complete book (only called in HTML version)
<tal:block tal:condition="python: book_raw_report != True"> <tal:block tal:condition="python: book_raw_report != True">
<tal:block metal:use-macro="context/WebPage_createBookCover/macros/book_cover" /> <tal:block metal:use-macro="context/WebPage_createBookCover/macros/book_cover" />
</tal:block> </tal:block>
<tal:block tal:condition="python: book_include_history is not None"> <tal:block tal:condition="python: book_include_history">
<tal:block metal:use-macro="context/WebPage_createBookTableOfHistory/macros/book_history" /> <tal:block metal:use-macro="context/WebPage_createBookTableOfHistory/macros/book_history" />
</tal:block> </tal:block>
<tal:block tal:replace="structure book_table_of_content"></tal:block> <tal:block tal:replace="structure book_table_of_content"></tal:block>
...@@ -99,7 +100,7 @@ Generates the complete book (only called in HTML version) ...@@ -99,7 +100,7 @@ Generates the complete book (only called in HTML version)
<tal:block tal:condition="python: book_raw_report != True"> <tal:block tal:condition="python: book_raw_report != True">
<tal:block metal:use-macro="context/WebPage_createBookCover/macros/book_cover" /> <tal:block metal:use-macro="context/WebPage_createBookCover/macros/book_cover" />
</tal:block> </tal:block>
<tal:block tal:condition="python: book_include_history is not None"> <tal:block tal:condition="python: book_include_history">
<tal:block metal:use-macro="context/WebPage_createBookTableOfHistory/macros/book_history" /> <tal:block metal:use-macro="context/WebPage_createBookTableOfHistory/macros/book_history" />
</tal:block> </tal:block>
<tal:block tal:replace="structure book_table_of_content"></tal:block> <tal:block tal:replace="structure book_table_of_content"></tal:block>
......
...@@ -15,6 +15,7 @@ Creates the Book sections (version, authors, etc). ...@@ -15,6 +15,7 @@ Creates the Book sections (version, authors, etc).
book_signature_list python: options.get('book_signature_list'); book_signature_list python: options.get('book_signature_list');
book_distribution_list python: options.get('book_distribution_list'); book_distribution_list python: options.get('book_distribution_list');
margin_15mm python: options.get('margin_15mm'); margin_15mm python: options.get('margin_15mm');
book_history_section_list python: options.get('book_history_section_list');
book_version_list python: options.get('book_version_list');"> book_version_list python: options.get('book_version_list');">
<!DOCTYPE html> <!DOCTYPE html>
<html tal:attributes="class python: ''.join(['ci-', book_theme, ' ci-', book_language])"> <html tal:attributes="class python: ''.join(['ci-', book_theme, ' ci-', book_language])">
...@@ -43,7 +44,10 @@ Creates the Book sections (version, authors, etc). ...@@ -43,7 +44,10 @@ Creates the Book sections (version, authors, etc).
<tal:block tal:condition="python: False"> <tal:block tal:condition="python: False">
<tal:block metal:define-macro="book_history"> <tal:block metal:define-macro="book_history">
<tal:comment replace="nothing">Directly called from WebPage_createBook, so need to check again</tal:comment> <tal:block tal:repeat="book_history_section book_history_section_list">
<tal:block tal:replace="structure book_history_section"></tal:block>
</tal:block>
<!--tal:comment replace="nothing">Directly called from WebPage_createBook, so need to check again</tal:comment>
<tal:block tal:condition="python: book_include_history != 0"> <tal:block tal:condition="python: book_include_history != 0">
<section> <section>
<table class="ci-book-table ci-book-signature-list" border="1" width="100%" cellpadding="0" cellspacing="0"> <table class="ci-book-table ci-book-signature-list" border="1" width="100%" cellpadding="0" cellspacing="0">
...@@ -162,6 +166,6 @@ Creates the Book sections (version, authors, etc). ...@@ -162,6 +166,6 @@ Creates the Book sections (version, authors, etc).
</tbody> </tbody>
</table> </table>
</section> </section>
</tal:block> </tal:block-->
</tal:block> </tal:block>
</tal:block> </tal:block>
\ No newline at end of file
...@@ -85,6 +85,11 @@ book_title = html_quote(override_document_title) if override_document_title else ...@@ -85,6 +85,11 @@ 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)
for book_history_section in book_history_section_list:
book_content = book_content.replace(book_history_section, '')
# 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")
...@@ -225,6 +230,7 @@ for image in re.findall('(<img.*?/>)', book_content): ...@@ -225,6 +230,7 @@ for image in re.findall('(<img.*?/>)', book_content):
if book_format == "html" or book_format == "mhtml": if book_format == "html" or book_format == "mhtml":
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html; charset=utf-8") context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html; charset=utf-8")
book_output = book.WebPage_createBook( book_output = book.WebPage_createBook(
book_history_section_list = book_history_section_list,
book_theme=book_theme.get("theme"), book_theme=book_theme.get("theme"),
book_title=book_title, book_title=book_title,
book_language=book_language, book_language=book_language,
...@@ -285,6 +291,7 @@ elif book_format == "pdf": ...@@ -285,6 +291,7 @@ elif book_format == "pdf":
) )
book_history = book.WebPage_createBookTableOfHistory( book_history = book.WebPage_createBookTableOfHistory(
book_history_section_list = book_history_section_list,
book_theme=book_theme.get("theme"), book_theme=book_theme.get("theme"),
book_title=book_title, book_title=book_title,
book_language=book_language, book_language=book_language,
......
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