Commit cebaa641 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: move files to common folder

parent 51a90517
...@@ -3,6 +3,29 @@ ...@@ -3,6 +3,29 @@
Export WebPage as Report Export WebPage as Report
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
return context.Base_viewAsReport( return context.Base_viewAsReport(
format=format, format=format,
document_save=document_save, document_save=document_save,
......
"""
================================================================================
Return relevant (predecessor) context if Letter is a subobject
================================================================================
"""
# parameters
# ------------------------------------------------------------------------------
# context_url: relative url of the context calling this script
if context_url is not None:
try:
underlying_context = context.restrictedTraverse(context_url)
underlying_portal_type = underlying_context.getPortalType()
if underlying_portal_type == "Letter":
for aggregate in underlying_context.getAggregateValueList() or []:
for predecessor in aggregate.getPredecessorValueList() or []:
if predecessor.getRelativeUrl() == context_url:
return aggregate
except:
pass
return context
#setPredecessorValueList([object]) = referenced documents
#setSuccessorValueList([object]) = related documents
#getPredecessor()
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>context_url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getRelevantContext</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
""" """
================================================================================ ================================================================================
Create a theme dict for filling templates Create a theme dict for filling templates
=====================================r=========================================== =================================================================================
""" """
# parameters: # parameters:
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
...@@ -30,8 +30,7 @@ theme = ( ...@@ -30,8 +30,7 @@ theme = (
) )
if theme is not None: if theme is not None:
theme = theme.lower() theme = theme.lower()
#theme_logo_prefix = context.Base_getCustomTemplateParameter("default_logo_prefix") theme_logo_prefix = context.Base_getCustomTemplateParameter("default_logo_prefix")
theme_logo_prefix = "NXD-Template.Logo."
if theme_logo_prefix: if theme_logo_prefix:
theme_reference = theme_logo_prefix + theme.capitalize() theme_reference = theme_logo_prefix + theme.capitalize()
theme_logo_list = context.Base_getCustomTemplateProxyParameter("logo", theme_reference) theme_logo_list = context.Base_getCustomTemplateProxyParameter("logo", theme_reference)
...@@ -43,7 +42,6 @@ if theme is None: ...@@ -43,7 +42,6 @@ if theme is None:
theme_dict = {} theme_dict = {}
theme_dict["theme"] = theme theme_dict["theme"] = theme
theme_dict["theme_logo_description"] = theme_logo_dict.get("description", blank) theme_dict["theme_logo_description"] = theme_logo_dict.get("description", blank)
# XXX this one is hard to get in test environment
theme_dict["theme_logo_url"] = context.Base_getCustomTemplateParameter("fallback_image") theme_dict["theme_logo_url"] = context.Base_getCustomTemplateParameter("fallback_image")
if theme_logo_dict.get("relative_url", None) is not None: if theme_logo_dict.get("relative_url", None) is not None:
theme_dict["theme_logo_url"] = theme_logo_dict.get("relative_url") + param theme_dict["theme_logo_url"] = theme_logo_dict.get("relative_url") + param
......
...@@ -3,6 +3,29 @@ ...@@ -3,6 +3,29 @@
Export WebPage as Report Export WebPage as Report
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
return context.Base_viewAsReport( return context.Base_viewAsReport(
format=format, format=format,
document_save=document_save, document_save=document_save,
...@@ -10,11 +33,13 @@ return context.Base_viewAsReport( ...@@ -10,11 +33,13 @@ return context.Base_viewAsReport(
document_language=document_language, document_language=document_language,
document_reference=document_reference, document_reference=document_reference,
document_version=document_version, document_version=document_version,
document_title=document_title,
display_depth=display_depth, display_depth=display_depth,
display_detail=display_detail, display_detail=display_detail,
display_comment=display_comment, display_comment=display_comment,
display_header=display_header, display_header=display_header,
report_name=report_name, report_name=report_name,
report_title=report_title,
requirement_relative_url=requirement_relative_url, requirement_relative_url=requirement_relative_url,
batch_mode=batch_mode, batch_mode=batch_mode,
**kw **kw
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>format=\'pdf\', batch_mode=None, requirement_relative_url=None, document_save=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_header=None, display_detail=None, display_comment=None, display_depth=None, report_name=None, *args,**kw</string> </value> <value> <string>format=\'pdf\', batch_mode=None, requirement_relative_url=None, document_save=None, document_download=None, document_language=None, document_reference=None, document_version=None, display_header=None, display_detail=None, display_comment=None, document_title=None, display_depth=None, report_title=None, report_name=None, *args,**kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -12,7 +12,7 @@ Add image size conversion only if image is not the default image ...@@ -12,7 +12,7 @@ Add image size conversion only if image is not the default image
# XXX Note, this is necessary, because it seems images scored in skin folders # XXX Note, this is necessary, because it seems images scored in skin folders
# cannot convert (neither format nor size) and in wkhtmltopdf fail if a # cannot convert (neither format nor size) and in wkhtmltopdf fail if a
# conversion parameter is provided. # conversion parameter is provided.
if path.find("common") > -1: if path.find("template_images") > -1:
return path return path
else: else:
return path + "&display=%s" % (display or "thumbnail") return path + ("&" if path.find("?") > -1 else "?") + "display=%s" % (display or "thumbnail")
...@@ -3,6 +3,31 @@ ...@@ -3,6 +3,31 @@
Update a book report dialog with parameters manually entered Update a book report dialog with parameters manually entered
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# cancel_url: url to cancel dialog
# dialog_id: id of current_dialog
# portal_skin: portal_skin used
#
# document_version: use as document version
# document_language: use as document version
# document_reference: use as document reference
# document_title use as document title
# override_batch_mode used for tests
#
# document_download: download file directly
# document_save: save file in document module
#
# display_header start headers at what level
# display_comment include comments where applicable
# display_detail include details where applicable
# display_depth level of depth to display
#
# report_name report to generate
# report_title report title
# requirement_relative_url XXX sale order has no direct relation to requirement
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
if dialog_id is not None: if dialog_id is not None:
return context.Base_redirect( return context.Base_redirect(
......
...@@ -13,7 +13,7 @@ MAIN FILE: generate report (book header/footer and report content) ...@@ -13,7 +13,7 @@ MAIN FILE: generate report (book header/footer and report content)
# document_title use as document title # document_title use as document title
# override_batch_mode used for tests # override_batch_mode used for tests
# ------ # ------
# document_download: download file directly (default None) # document_download: download file directly (default None)
# document_save: save file in document module (default None) # document_save: save file in document module (default None)
# ------ # ------
# display_header start headers at what level # display_header start headers at what level
...@@ -97,7 +97,7 @@ if doc_reference is blank: ...@@ -97,7 +97,7 @@ if doc_reference is blank:
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language]) doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# ------------------------------- Theme ---------------------------------------- # ------------------------------- Theme ----------------------------------------
doc_theme = doc.Base_getThemeDict(format=doc_format, css_path="book_css/book") doc_theme = doc.Base_getThemeDict(format=doc_format, css_path="template_css/book")
# --------------------------- Source/Destination ------------------------------- # --------------------------- Source/Destination -------------------------------
doc_source = doc.Base_getSourceDict( doc_source = doc.Base_getSourceDict(
......
...@@ -63,10 +63,10 @@ Creates the Letter footer section. ...@@ -63,10 +63,10 @@ Creates the Letter footer section.
<span tal:content="python: ''.join([letter_source_address, ', ', letter_source_postal_code, ' ', letter_source_city])"></span> <span tal:content="python: ''.join([letter_source_address, ', ', letter_source_postal_code, ' ', letter_source_city])"></span>
<br/> <br/>
<tal:block tal:condition="python: letter_source_registered_court is not None"> <tal:block tal:condition="python: letter_source_registered_court is not None">
<span tal:content="python: letter_source_registered_court"></span> - <span tal:content="python: letter_source_registered_court"></span> -
</tal:block> </tal:block>
<tal:block tal:condition="python: letter_source_ape_code is not None"> <tal:block tal:condition="python: letter_source_ape_code is not None">
<span i18n:translate="" i18n:domain="erp5_ui">APE</span> : <span tal:content="letter_source_ape_code"></span> - <span i18n:translate="" i18n:domain="erp5_ui">APE</span> : <span tal:content="letter_source_ape_code"></span> -
</tal:block> </tal:block>
<span i18n:translate="" i18n:domain="erp5_ui">N° TVA</span> : <span tal:content="python: letter_source_vat"></span> <span i18n:translate="" i18n:domain="erp5_ui">N° TVA</span> : <span tal:content="python: letter_source_vat"></span>
<br/> <br/>
...@@ -79,6 +79,7 @@ Creates the Letter footer section. ...@@ -79,6 +79,7 @@ Creates the Letter footer section.
<b i18n:translate="" i18n:domain="erp5_ui">Tel</b><b>:</b> <b tal:content="python: letter_source_phone"></b> <b i18n:translate="" i18n:domain="erp5_ui">Tel</b><b>:</b> <b tal:content="python: letter_source_phone"></b>
</span> </span>
</p> </p>
</div>
</tal:block> </tal:block>
</tal:block> </tal:block>
......
...@@ -82,7 +82,7 @@ Generates the letter header ...@@ -82,7 +82,7 @@ Generates the letter header
<tr> <tr>
<td></td> <td></td>
<td class="ci-letter-page"> <td class="ci-letter-page">
<span i18n:translate="" i18n:domain="erp5_ui">Page</span><span><span class="page"></span><span>/</span><span class="topage"></span><span> <span i18n:translate="" i18n:domain="erp5_ui">Page</span><span><span class="page"></span><span>/</span><span class="topage"></span></span>
</td> </td>
<td></td> <td></td>
</tr> </tr>
......
...@@ -3,6 +3,26 @@ ...@@ -3,6 +3,26 @@
Print letter in any of the supported formats Print letter in any of the supported formats
================================================================================ ================================================================================
""" """
# parameters (*default)
# ------------------------------------------------------------------------------
# REQUEST: request object
# format: output format
# portal_skin: skin to use for output
# batch_mode: used for tests
# display_source_address display source (!) adress in adress field or not*
# display_svg display images in svg or png*
# display_head display letter adress head (1)* or not (0)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# override_source_organisation_title: override event sender career subordinate
# override_source_person_title: override event sender title
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
new_skin_name = "Letter" new_skin_name = "Letter"
context.getPortalObject().portal_skins.changeSkin(new_skin_name) context.getPortalObject().portal_skins.changeSkin(new_skin_name)
if REQUEST is None: if REQUEST is None:
......
...@@ -15,7 +15,7 @@ MAIN FILE: generate letter in different output formats ...@@ -15,7 +15,7 @@ MAIN FILE: generate letter in different output formats
# override_date to use instead of current date # override_date to use instead of current date
# override_batch_mode used for tests # override_batch_mode used for tests
# ------ # ------
# document_download: download file directly (default None) # document_download: download file directly (default None)
# document_save: save file in document module (default None) # document_save: save file in document module (default None)
# ------ # ------
# display_head: display letter adress head (1)* or not (0) # display_head: display letter adress head (1)* or not (0)
...@@ -98,7 +98,7 @@ if letter_reference is None: ...@@ -98,7 +98,7 @@ if letter_reference is None:
letter_full_reference = '-'.join([letter_reference, letter_version, letter_language]) letter_full_reference = '-'.join([letter_reference, letter_version, letter_language])
# --------------------------- Layout Parameters -------------------------------- # --------------------------- Layout Parameters --------------------------------
letter_theme = letter.Base_getThemeDict(format=letter_format, css_path="letter_css/letter") letter_theme = letter.Base_getThemeDict(format=letter_format, css_path="template_css/letter")
# --------------------------- Source/Destination ------------------------------- # --------------------------- Source/Destination -------------------------------
letter_source = letter.Base_getSourceDict( letter_source = letter.Base_getSourceDict(
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>content</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>document_title</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Letter_viewPreview</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebPage_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Letter Preview</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -87,7 +87,7 @@ Creates the Book sections (version, authors, etc). ...@@ -87,7 +87,7 @@ Creates the Book sections (version, authors, etc).
<li tal:condition="person/odd"> <li tal:condition="person/odd">
<div tal:content="python: person.title"></div> <div tal:content="python: person.title"></div>
<div tal:content="python: person.career_function"></div> <div tal:content="python: person.career_function"></div>
</li> </li>
</tal:block> </tal:block>
</tal:block> </tal:block>
<tal:block tal:condition="python: len(book_distribution_list) == 0"> <tal:block tal:condition="python: len(book_distribution_list) == 0">
......
...@@ -49,19 +49,19 @@ Creates the Tables of references. ...@@ -49,19 +49,19 @@ Creates the Tables of references.
<p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of applicable documents and references.</p> <p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of applicable documents and references.</p>
<h3 i18n:translate="" i18n:domain="erp5_ui">Applicable Documents</h3> <h3 i18n:translate="" i18n:domain="erp5_ui">Applicable Documents</h3>
<p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of applicable documents.</p> <p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of applicable documents.</p>
<table class="ci-book-table ci-book-applicable-list" border="1" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0"> <table class="ci-book-table ci-book-applicable-list" border="1" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th width="9%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th> <th width="9%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th>
<th width="56%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b><b>/</b><b i18n:translate="" i18n:domain="erp5_ui">Reference</b></th> <th width="56%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b><b>/</b><b i18n:translate="" i18n:domain="erp5_ui">Reference</b></th>
<th width="21%"><b i18n:translate="" i18n:domain="erp5_ui">Document Number</b></th> <th width="21%"><b i18n:translate="" i18n:domain="erp5_ui">Document Number</b></th>
<th width="14%"><b i18n:translate="" i18n:domain="erp5_ui">Issue.</b><br /><b i18n:translate="" i18n:domain="erp5_ui">Rev.</b></th> <th width="14%"><b i18n:translate="" i18n:domain="erp5_ui">Issue.</b><br /><b i18n:translate="" i18n:domain="erp5_ui">Rev.</b></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tal:block tal:condition="python: len(book_applicable_document_list) > 0"> <tal:block tal:condition="python: len(book_applicable_document_list) > 0">
<tal:block tal:repeat="applicable_document book_applicable_document_list"> <tal:block tal:repeat="applicable_document book_applicable_document_list">
<tr> <tr>
<td width="9%"><a tal:attributes="id python: applicable_document.get('id')"></a><span tal:content="python: applicable_document.get('id')"></span></td> <td width="9%"><a tal:attributes="id python: applicable_document.get('id')"></a><span tal:content="python: applicable_document.get('id')"></span></td>
<td width="56%" style="text-align:left"><span tal:content="python: applicable_document.get('title')"></span><br/><a tal:attributes="href python: applicable_document.get('href')"><span tal:content="python: applicable_document.get('href')"></span></a></td> <td width="56%" style="text-align:left"><span tal:content="python: applicable_document.get('title')"></span><br/><a tal:attributes="href python: applicable_document.get('href')"><span tal:content="python: applicable_document.get('href')"></span></a></td>
<td width="21%" tal:content="python: applicable_document.get('number')"></td> <td width="21%" tal:content="python: applicable_document.get('number')"></td>
...@@ -85,7 +85,7 @@ Creates the Tables of references. ...@@ -85,7 +85,7 @@ Creates the Tables of references.
<tbody> <tbody>
<tal:block tal:condition="python: len(book_reference_list) > 0"> <tal:block tal:condition="python: len(book_reference_list) > 0">
<tal:block tal:repeat="reference_document book_reference_list"> <tal:block tal:repeat="reference_document book_reference_list">
<tr> <tr>
<td width="9%"><a tal:attributes="id python: reference_document.get('id')"></a><span tal:content="python: reference_document.get('id')"></span></td> <td width="9%"><a tal:attributes="id python: reference_document.get('id')"></a><span tal:content="python: reference_document.get('id')"></span></td>
<td width="56%" style="text-align:left"><span tal:content="python: reference_document.get('title')"></span><br/><a tal:attributes="href python: reference_document.get('href')"><span tal:content="python: reference_document.get('href')"></span></a></td> <td width="56%" style="text-align:left"><span tal:content="python: reference_document.get('title')"></span><br/><a tal:attributes="href python: reference_document.get('href')"><span tal:content="python: reference_document.get('href')"></span></a></td>
<td width="21%" tal:content="python: reference_document.get('number')"></td> <td width="21%" tal:content="python: reference_document.get('number')"></td>
...@@ -98,18 +98,18 @@ Creates the Tables of references. ...@@ -98,18 +98,18 @@ Creates the Tables of references.
<h2 i18n:translate="" i18n:domain="erp5_ui">Abbreviations</h2> <h2 i18n:translate="" i18n:domain="erp5_ui">Abbreviations</h2>
<p i18n:translate="" i18n:domain="erp5_ui">This section provides the lists of the applicable abbreviations.</p> <p i18n:translate="" i18n:domain="erp5_ui">This section provides the lists of the applicable abbreviations.</p>
<table border="1" class="ci-book-table ci-book-abbreviation-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0"> <table border="1" class="ci-book-table ci-book-abbreviation-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th> <th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th>
<th width="15%"><b i18n:translate="" i18n:domain="erp5_ui">Abbreviation</b></th> <th width="15%"><b i18n:translate="" i18n:domain="erp5_ui">Abbreviation</b></th>
<th width="31%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th> <th width="31%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th>
<th width="43%"><b i18n:translate="" i18n:domain="erp5_ui">Description</b></th> <th width="43%"><b i18n:translate="" i18n:domain="erp5_ui">Description</b></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tal:block tal:condition="python: len(book_abbreviation_list) > 0"> <tal:block tal:condition="python: len(book_abbreviation_list) > 0">
<tal:block tal:repeat="abbreviation book_abbreviation_list"> <tal:block tal:repeat="abbreviation book_abbreviation_list">
<tr> <tr>
<td width="9%"><a tal:attributes="id python: abbreviation.get('id')"></a><span tal:content="python: abbreviation.get('id')"></span></td> <td width="9%"><a tal:attributes="id python: abbreviation.get('id')"></a><span tal:content="python: abbreviation.get('id')"></span></td>
<td width="56%" style="text-align:left"><a tal:attributes="href python: abbreviation.get('href')"><span tal:content="python: abbreviation.get('abbreviation')"></span></a></td> <td width="56%" style="text-align:left"><a tal:attributes="href python: abbreviation.get('href')"><span tal:content="python: abbreviation.get('abbreviation')"></span></a></td>
<td width="21%" style="text-align:left" tal:content="python: abbreviation.get('title')"></td> <td width="21%" style="text-align:left" tal:content="python: abbreviation.get('title')"></td>
...@@ -121,19 +121,19 @@ Creates the Tables of references. ...@@ -121,19 +121,19 @@ Creates the Tables of references.
</table> </table>
<h2 i18n:translate="" i18n:domain="erp5_ui">Figures</h2> <h2 i18n:translate="" i18n:domain="erp5_ui">Figures</h2>
<p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of figures and images.</p> <p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of figures and images.</p>
<table border="1" class="ci-book-table ci-book-figure-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0"> <table border="1" class="ci-book-table ci-book-figure-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th> <th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th>
<th width="90%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th> <th width="90%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tal:block tal:condition="python: len(book_image_list) > 0"> <tal:block tal:condition="python: len(book_image_list) > 0">
<tal:block tal:repeat="image book_image_list"> <tal:block tal:repeat="image book_image_list">
<tr> <tr>
<td width="10%"><a tal:attributes="id python: image.get('id')"></a><span tal:content="python: image.get('id')"></span></td> <td width="10%"><a tal:attributes="id python: image.get('id')"></a><span tal:content="python: image.get('id')"></span></td>
<td width="90%" style="text-align: left; vertical-align: top" tal:content="python: image.get('title')"></td> <td width="90%" style="text-align: left; vertical-align: top" tal:content="python: image.get('title')"></td>
</tr> </tr>
</tal:block> </tal:block>
</tal:block> </tal:block>
...@@ -141,19 +141,19 @@ Creates the Tables of references. ...@@ -141,19 +141,19 @@ Creates the Tables of references.
</table> </table>
<h2 i18n:translate="" i18n:domain="erp5_ui">Tables</h2> <h2 i18n:translate="" i18n:domain="erp5_ui">Tables</h2>
<p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of tables.</p> <p i18n:translate="" i18n:domain="erp5_ui">This section provides the list of tables.</p>
<table border="1" class="ci-book-table ci-book-figure-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0"> <table border="1" class="ci-book-table ci-book-figure-list" width="100%" style="table-layout:fixed;" cellpadding="0" cellspacing="0">
<thead> <thead>
<tr> <tr>
<th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th> <th width="10%"><b i18n:translate="" i18n:domain="erp5_ui">ID</b></th>
<th width="90%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th> <th width="90%"><b i18n:translate="" i18n:domain="erp5_ui">Title</b></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tal:block tal:condition="book_table_list"> <tal:block tal:condition="book_table_list">
<tal:block tal:repeat="table book_table_list"> <tal:block tal:repeat="table book_table_list">
<tr> <tr>
<td width="10%"><a tal:attributes="id python: table.get('id')"></a><span tal:content="python: table.get('id')"></span></td> <td width="10%"><a tal:attributes="id python: table.get('id')"></a><span tal:content="python: table.get('id')"></span></td>
<td width="90%" style="text-align: left; vertical-align: top" tal:content="python: table.get('title')"></td> <td width="90%" style="text-align: left; vertical-align: top" tal:content="python: table.get('title')"></td>
</tr> </tr>
</tal:block> </tal:block>
</tal:block> </tal:block>
......
...@@ -16,9 +16,8 @@ Generate leaflet legalese ...@@ -16,9 +16,8 @@ Generate leaflet legalese
leaflet_date python: options.get('leaflet_date'); leaflet_date python: options.get('leaflet_date');
leaflet_year python: options.get('leaflet_year'); leaflet_year python: options.get('leaflet_year');
leaflet_recycle_url python: options.get('leaflet_recycle_url');"> leaflet_recycle_url python: options.get('leaflet_recycle_url');">
<div id="legalese"> <div id="legalese">
<p class="top"><span>&copy;</span><span tal:content="python: ''.join([leaflet_organisation, ' ', leaflet_year])"></span> <p class="top"><span>&copy;</span><span tal:content="python: ''.join([leaflet_organisation, ' ', leaflet_year])"></span></p>
</p>
<p> <p>
<span tal:content="python: leaflet_organisation"></span><br /> <span tal:content="python: leaflet_organisation"></span><br />
<span tal:content="python: leaflet_address"></span><br /> <span tal:content="python: leaflet_address"></span><br />
...@@ -39,18 +38,18 @@ Generate leaflet legalese ...@@ -39,18 +38,18 @@ Generate leaflet legalese
in this publication to the companies products or services do not imply that in this publication to the companies products or services do not imply that
the company intends to make these available in all countries in which it the company intends to make these available in all countries in which it
operates. operates.
</p> </p>
<p i18n:translate="" i18n:domain="erp5_ui"> <p i18n:translate="" i18n:domain="erp5_ui">
The customer is responsible for ensuring compliance with legal requirements. The customer is responsible for ensuring compliance with legal requirements.
It is the responsibility of the customer to seek the advice of competent legal It is the responsibility of the customer to seek the advice of competent legal
counsel as to the identification and interpretation of relevant laws and counsel as to the identification and interpretation of relevant laws and
regulatory requirements that may affect the customer's business and any regulatory requirements that may affect the customer's business and any
actions the customer may have to take to comply with these laws. actions the customer may have to take to comply with these laws.
</p> </p>
<p class="bottom"> <p class="bottom">
<img tal:attributes="src python: leaflet_recycle_url" alt="foo" /> <img tal:attributes="src python: leaflet_recycle_url" alt="foo" />
<span i18n:translate="" i18n:domain="erp5_ui">Please recycle</span> <span i18n:translate="" i18n:domain="erp5_ui">Please recycle</span>
</p> </p>
</div> </div>
</tal:block> </tal:block>
\ No newline at end of file
...@@ -30,10 +30,10 @@ Generates the complete slideshow ...@@ -30,10 +30,10 @@ Generates the complete slideshow
<link rel="stylesheet" tal:attributes="href font_url" /> <link rel="stylesheet" tal:attributes="href font_url" />
</tal:block> </tal:block>
<tal:block tal:condition="python: doc_format == 'html'"> <tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" /> <link rel="stylesheet" tal:attributes="href python: 'template_css/reveal.custom.css'" />
</tal:block> </tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" /> <link rel="stylesheet" href="template_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" /> <link rel="stylesheet" href="template_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href doc_theme_css_url" /> <link rel="stylesheet" tal:attributes="href doc_theme_css_url" />
<link rel="stylesheet" tal:attributes="href doc_template_css_url" /> <link rel="stylesheet" tal:attributes="href doc_template_css_url" />
<style type="text/css" tal:content="structure doc_css"></style> <style type="text/css" tal:content="structure doc_css"></style>
...@@ -59,8 +59,8 @@ Generates the complete slideshow ...@@ -59,8 +59,8 @@ Generates the complete slideshow
<tal:block metal:use-macro="context/WebPage_createSlideshowContent/macros/slide_content" /> <tal:block metal:use-macro="context/WebPage_createSlideshowContent/macros/slide_content" />
</div> </div>
</div> </div>
<script src="slide_js/head.min.js"></script> <script src="template_js/head.min.js"></script>
<script src="slide_js/reveal.custom.js"></script> <script src="template_js/reveal.custom.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
width: 1280, width: 1280,
...@@ -75,9 +75,9 @@ Generates the complete slideshow ...@@ -75,9 +75,9 @@ Generates the complete slideshow
// Dispatches all reveal.js events to the parent window through postMessage // Dispatches all reveal.js events to the parent window through postMessage
postMessageEvents: false, postMessageEvents: false,
dependencies: [ dependencies: [
{ src: 'slide_js/classList.min.js', condition: function() { return !document.body.classList; } }, { src: 'template_js/classList.min.js', condition: function() { return !document.body.classList; } },
{ src: 'slide_js/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'template_js/highlight.js', async: true, condition: function() { return !!document.querySelector( 'pre code' ); }, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'slide_js/zoom.js', async: true } { src: 'template_js/zoom.js', async: true }
] ]
}); });
Reveal.configure({ slideNumber: 'c / t' }); Reveal.configure({ slideNumber: 'c / t' });
......
...@@ -23,10 +23,10 @@ Creates the Slideshow content section. ...@@ -23,10 +23,10 @@ Creates the Slideshow content section.
<link rel="stylesheet" tal:attributes="href font_url" /> <link rel="stylesheet" tal:attributes="href font_url" />
</tal:block> </tal:block>
<tal:block tal:condition="python: doc_format == 'html'"> <tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" /> <link rel="stylesheet" tal:attributes="href python: 'template_css/reveal.custom.css'" />
</tal:block> </tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" /> <link rel="stylesheet" href="template_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" /> <link rel="stylesheet" href="template_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href doc_theme_css_url" /> <link rel="stylesheet" tal:attributes="href doc_theme_css_url" />
<link rel="stylesheet" tal:attributes="href doc_template_css_url" /> <link rel="stylesheet" tal:attributes="href doc_template_css_url" />
</head> </head>
......
...@@ -23,10 +23,10 @@ Creates the Slideshow cover section. ...@@ -23,10 +23,10 @@ Creates the Slideshow cover section.
<link rel="stylesheet" tal:attributes="href font_url" /> <link rel="stylesheet" tal:attributes="href font_url" />
</tal:block> </tal:block>
<tal:block tal:condition="python: doc_format == 'html'"> <tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" /> <link rel="stylesheet" tal:attributes="href python: 'template_css/reveal.custom.css'" />
</tal:block> </tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" /> <link rel="stylesheet" href="template_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" /> <link rel="stylesheet" href="template_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href doc_theme_css_url" /> <link rel="stylesheet" tal:attributes="href doc_theme_css_url" />
<link rel="stylesheet" tal:attributes="href doc_template_css_url" /> <link rel="stylesheet" tal:attributes="href doc_template_css_url" />
<style type="text/css" tal:content="doc_css"></style> <style type="text/css" tal:content="doc_css"></style>
......
...@@ -29,10 +29,10 @@ Creates the Slideshow footer section. ...@@ -29,10 +29,10 @@ Creates the Slideshow footer section.
<link rel="stylesheet" tal:attributes="href font_url" /> <link rel="stylesheet" tal:attributes="href font_url" />
</tal:block> </tal:block>
<tal:block tal:condition="python: doc_format == 'html'"> <tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" /> <link rel="stylesheet" tal:attributes="href python: 'template_css/reveal.custom.css'" />
</tal:block> </tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" /> <link rel="stylesheet" href="template_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" /> <link rel="stylesheet" href="template_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href python: doc_theme_css_url" /> <link rel="stylesheet" tal:attributes="href python: doc_theme_css_url" />
<link rel="stylesheet" tal:attributes="href python: doc_template_css_url" /> <link rel="stylesheet" tal:attributes="href python: doc_template_css_url" />
<style type="text/css" tal:content="structure doc_css"></style> <style type="text/css" tal:content="structure doc_css"></style>
......
...@@ -23,10 +23,10 @@ Creates the Slideshow note section. ...@@ -23,10 +23,10 @@ Creates the Slideshow note section.
<link rel="stylesheet" tal:attributes="href font_url" /> <link rel="stylesheet" tal:attributes="href font_url" />
</tal:block> </tal:block>
<tal:block tal:condition="python: doc_format == 'html'"> <tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" /> <link rel="stylesheet" tal:attributes="href python: 'template_css/reveal.custom.css'" />
</tal:block> </tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" /> <link rel="stylesheet" href="template_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" /> <link rel="stylesheet" href="template_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href doc_theme_css_url" /> <link rel="stylesheet" tal:attributes="href doc_theme_css_url" />
<link rel="stylesheet" tal:attributes="href doc_template_css_url" /> <link rel="stylesheet" tal:attributes="href doc_template_css_url" />
</head> </head>
......
...@@ -3,6 +3,30 @@ ...@@ -3,6 +3,30 @@
Export WebPage as Book Export WebPage as Book
================================================================================ ================================================================================
""" """
# parameters
# ------------------------------------------------------------------------------
# format output (html*, pdf)
# batch_mode used for tests
#
# document_download download file directly (None*)
# document_save save file in document module (None*)
#
# override_source_person_title use instead of the document author
# override_source_organisation_title use as publishing organisation
# override_document_description use as cover page description
# override_document_short_title use as cover page subtitle
# override_document_title use as cover page title
# override_document_version use as document version
# override_document_reference use as document reference
# override_logo_reference use as document header logo
#
# include_content_table include table of content (True*)
# include_history_table include history/authors (XXX not done)
# include_reference_table include table of links/images/tables
# include_linked_content embed content of linked documents
# include_report_content embed content of report documents
#
# display_svg format for svg images (svg, png*)
return context.WebPage_viewAsBook( return context.WebPage_viewAsBook(
override_document_description=override_document_description, override_document_description=override_document_description,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
Export WebPage as Leaflet Export WebPage as Leaflet
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# display_side: display side bar (1)* or not (0)
# display_svg: display images as svg or png*
# batch_mode: used for tests
# override_leaflet_header_title: custom title to use in the leaflet header
# override_source_organisation_title: used instead of follow-up organisation
# override_source_person_title: used instead of contributor
# document_downalod: download file directly
# document_save: save file in document module
return context.WebPage_viewAsLeaflet( return context.WebPage_viewAsLeaflet(
format=format, format=format,
display_side=display_side, display_side=display_side,
......
...@@ -3,6 +3,25 @@ ...@@ -3,6 +3,25 @@
Export this web page as letter in specified format Export this web page as letter in specified format
================================================================================ ================================================================================
""" """
# parameters (*default)
# ------------------------------------------------------------------------------
# format: output format
# portal_skin: skin to use for output
# batch_mode: used for tests
# display_source_address display source (!) adress in adress field or not*
# display_svg display images in svg or png*
# display_head display letter adress head (1)* or not (0)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# override_source_organisation_title: override event sender career subordinate
# override_source_person_title: override event sender title
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
return context.Letter_viewAsLetter( return context.Letter_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
Export slideshow in any of the supported formats Export slideshow in any of the supported formats
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
# override_source_organisation_title: to use instead of default company
# override_logo_reference: to use instead of default company logo in footer
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# display_note: display slide notes (1) or not (0)*
# display_svg: display svg-images as svg or png*
return context.WebPage_viewAsSlideshow( return context.WebPage_viewAsSlideshow(
format=format, format=format,
display_note=display_note, display_note=display_note,
......
...@@ -8,9 +8,9 @@ Return custom hardcoded parameters ...@@ -8,9 +8,9 @@ Return custom hardcoded parameters
# parameter Parameter to lookup # parameter Parameter to lookup
if parameter == "fallback_image": if parameter == "fallback_image":
return "common_images/fallback.png" return "template_images/fallback.png"
if parameter == "default_theme_css_url": if parameter == "default_theme_css_url":
return "default_themes/themes.css" return "template_themes/themes.css"
if parameter == "wkhtmltopdf_rendering_fix": if parameter == "wkhtmltopdf_rendering_fix":
return """ return """
......
...@@ -3,6 +3,31 @@ ...@@ -3,6 +3,31 @@
Print WebPage as Book Print WebPage as Book
================================================================================ ================================================================================
""" """
# parameters
# ------------------------------------------------------------------------------
# format output (html*, pdf)
# batch_mode used for tests
#
# document_download download file directly (None*)
# document_save save file in document module (None*)
#
# override_source_person_title use instead of the document author
# override_source_organisation_title use as publishing organisation
# override_document_description use as cover page description
# override_document_short_title use as cover page subtitle
# override_document_title use as cover page title
# override_document_version use as document version
# override_document_reference use as document reference
# override_logo_reference use as document header logo
#
# include_content_table include table of content (True*)
# include_history_table include history/authors (XXX not done)
# include_reference_table include table of links/images/tables
# include_linked_content embed content of linked documents
# include_report_content embed content of report documents
#
# display_svg format for svg images (svg, png*)
return context.WebPage_viewAsBook( return context.WebPage_viewAsBook(
format=format, format=format,
override_document_description=override_document_description, override_document_description=override_document_description,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
Print WebPage as Leaflet Print WebPage as Leaflet
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# display_side: display side bar (1)* or not (0)
# display_svg: display images as svg or png*
# batch_mode: used for tests
# override_leaflet_header_title: custom title to use in the leaflet header
# override_source_organisation_title: used instead of follow-up organisation
# override_source_person_title: used instead of contributor
# document_downalod: download file directly
# document_save: save file in document module
return context.WebPage_viewAsLeaflet( return context.WebPage_viewAsLeaflet(
format=format, format=format,
display_side=display_side, display_side=display_side,
......
...@@ -3,6 +3,24 @@ ...@@ -3,6 +3,24 @@
Print letter in any of the supported formats Print letter in any of the supported formats
================================================================================ ================================================================================
""" """
# parameters (*default)
# ------------------------------------------------------------------------------
# format: output format
# batch_mode: used for tests
# display_source_address display source (!) adress in adress field or not*
# display_svg display images in svg or png*
# display_head display letter adress head (1)* or not (0)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# override_source_organisation_title: override event sender career subordinate
# override_source_person_title: override event sender title
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
return context.Letter_viewAsLetter( return context.Letter_viewAsLetter(
format=format, format=format,
display_head=display_head, display_head=display_head,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
Print and download slideshow in PDF format Print and download slideshow in PDF format
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
# override_source_organisation_title: to use instead of default company
# override_logo_reference: to use instead of default company logo in footer
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# display_note: display slide notes (1) or not (0)*
# display_svg: display svg-images as svg or png*
return context.WebPage_viewAsSlideshow( return context.WebPage_viewAsSlideshow(
format=format, format=format,
display_note=display_note, display_note=display_note,
......
...@@ -3,9 +3,35 @@ ...@@ -3,9 +3,35 @@
Update a book dialog with parameters manually entered Update a book dialog with parameters manually entered
================================================================================ ================================================================================
""" """
# XXX: url_param_string easily goes over 2000 chars and Base_callDialogMethod # XXX: url_param_string on this dialog goes easily over 2000 chars and
# sets an arbitrary limit for redirects at 2000 chars. Drop unnecessary fields, # Base_callDialogMethod sets an arbitrary limit for redirects at 2000 chars.
# it's just a dialog update # Drop unnecessary fields, it's just a dialog update.
# parameters
# ------------------------------------------------------------------------------
# format output (html*, pdf)
# cancel_url url to revert from dialog
# dialog_id id of current dialog
#
# document_download download file directly (None*)
# document_save save file in document module (None*)
#
# override_source_person_title use instead of the document author
# override_source_organisation_title use as publishing organisation
# override_document_description use as cover page description
# override_document_short_title use as cover page subtitle
# override_document_title use as cover page title
# override_document_version use as document version
# override_document_reference use as document reference
# override_logo_reference use as document header logo
#
# include_content_table include table of content (True*)
# include_history_table include history/authors (XXX not done)
# include_reference_table include table of links/images/tables
# include_linked_content embed content of linked documents
# include_report_content embed content of report documents
#
# display_svg format for svg images (svg, png*)
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
if dialog_id is not None: if dialog_id is not None:
......
...@@ -3,6 +3,22 @@ ...@@ -3,6 +3,22 @@
Update a leaflet dialog with parameters manually entered Update a leaflet dialog with parameters manually entered
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# display_side: display side bar (1)* or not (0)
# display_svg: display images as svg or png*
# cancel_url: url to go back from dialog
# dialog_id: current dialog id
# portal_skin: current skin used
# override_leaflet_header_title: custom title to use in the leaflet header
# override_source_organisation_title: used instead of follow-up organisation
# override_source_person_title: used instead of contributor
# document_downalod: download file directly
# document_save: save file in document module
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
if dialog_id is not None: if dialog_id is not None:
return context.Base_redirect( return context.Base_redirect(
......
...@@ -3,6 +3,27 @@ ...@@ -3,6 +3,27 @@
Update the letter dialog with parameters manually entered Update the letter dialog with parameters manually entered
================================================================================ ================================================================================
""" """
# parameters (*default)
# ------------------------------------------------------------------------------
# REQUEST: request object
# format: output format
# portal_skin: skin to use for output
# cancel_url: url to cancel dialog
# dialog_id: id of current dialog
# display_source_address display source (!) adress in adress field or not*
# display_svg display images in svg or png*
# display_head display letter adress head (1)* or not (0)
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# override_source_organisation_title: override event sender career subordinate
# override_source_person_title: override event sender title
# override_destination_organisation_title: override event recipient subordinate
# override_destination_person_title: overide event recipient
# override_date to use instead of current date
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
if dialog_id is not None: if dialog_id is not None:
return context.Base_redirect( return context.Base_redirect(
......
...@@ -3,6 +3,22 @@ ...@@ -3,6 +3,22 @@
Update the slide dialog with parameters manually entered Update the slide dialog with parameters manually entered
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
# cancel_url: url to revert from dialog
# dialog_id: id of the current dialog
# override_source_organisation_title: to use instead of default company
# override_logo_reference: to use instead of default company logo in footer
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# display_note: display slide notes (1) or not (0)*
# display_svg: display svg-images as svg or png*
from Products.ERP5Type.Message import translateString from Products.ERP5Type.Message import translateString
if dialog_id is not None: if dialog_id is not None:
return context.Base_redirect( return context.Base_redirect(
......
...@@ -24,7 +24,7 @@ MAIN FILE: generate book in different output formats ...@@ -24,7 +24,7 @@ MAIN FILE: generate book in different output formats
# book_include_linked_content embed content of linked documents # book_include_linked_content embed content of linked documents
# book_include_report_content embed content of report documents # book_include_report_content embed content of report documents
# ------ # ------
# document_download download file directly (None*) # document_download download file directly (None*)
# document_save save file in document module (None*) # document_save save file in document module (None*)
# ------ # ------
# display_svg format for svg images (svg, png*) # display_svg format for svg images (svg, png*)
...@@ -108,7 +108,7 @@ if book_reference is None: ...@@ -108,7 +108,7 @@ if book_reference is None:
book_full_reference = '-'.join([book_reference, book_version, book_language]) book_full_reference = '-'.join([book_reference, book_version, book_language])
# ------------------------------- Theme ---------------------------------------- # ------------------------------- Theme ----------------------------------------
book_theme = book.Base_getThemeDict(format=book_format, css_path="book_css/book") book_theme = book.Base_getThemeDict(format=book_format, css_path="template_css/book")
# --------------------------- Source/Destination ------------------------------- # --------------------------- Source/Destination -------------------------------
book_source = book.Base_getSourceDict( book_source = book.Base_getSourceDict(
...@@ -186,7 +186,7 @@ if book_include_reference_table is not None: ...@@ -186,7 +186,7 @@ if book_include_reference_table is not None:
) )
if book_format == 'html' or book_format == 'mhtml': if book_format == 'html' or book_format == 'mhtml':
book_content = book_references.encode('utf-8').strip() + book_content 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
if book_include_content_table is not None: if book_include_content_table is not None:
...@@ -211,7 +211,7 @@ for image in re.findall('(<img.*?/>)', book_content): ...@@ -211,7 +211,7 @@ for image in re.findall('(<img.*?/>)', book_content):
img_wrap=True img_wrap=True
) )
) )
# ============================ Transformation ================================== # ============================ Transformation ==================================
# ========================== Format: mhtml/html ================================ # ========================== Format: mhtml/html ================================
if book_format == "html" or book_format == "mhtml": if book_format == "html" or book_format == "mhtml":
...@@ -254,7 +254,7 @@ if book_format == "html" or book_format == "mhtml": ...@@ -254,7 +254,7 @@ if book_format == "html" or book_format == "mhtml":
doc_full_reference=book_full_reference, doc_full_reference=book_full_reference,
doc_html_file=book_output doc_html_file=book_output
) )
if book_format == "mhtml": if book_format == "mhtml":
context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;") context.REQUEST.RESPONSE.setHeader("Content-Type", "text/html;")
return book.Base_convertHtmlToSingleFile(book_output, allow_script=True) return book.Base_convertHtmlToSingleFile(book_output, allow_script=True)
...@@ -316,7 +316,7 @@ if book_format == "pdf": ...@@ -316,7 +316,7 @@ if book_format == "pdf":
book_version=book_version, book_version=book_version,
book_short_date=book_short_date book_short_date=book_short_date
) )
book_foot = book.WebPage_createBookFooter( book_foot = book.WebPage_createBookFooter(
book_theme=book_theme.get("theme"), book_theme=book_theme.get("theme"),
book_title=book_title, book_title=book_title,
......
...@@ -15,7 +15,7 @@ MAIN FILE: render two pager in different output formats ...@@ -15,7 +15,7 @@ MAIN FILE: render two pager in different output formats
# override_source_person_title used instead of contributor # override_source_person_title used instead of contributor
# override_batch_mode used for tests # override_batch_mode used for tests
# ------ # ------
# document_downalod: download file directly (default None) # document_downalod: download file directly (default None)
# document_save: save file in document module (default None) # document_save: save file in document module (default None)
import re import re
...@@ -81,17 +81,17 @@ if leaflet_language is None: ...@@ -81,17 +81,17 @@ if leaflet_language is None:
leaflet_language = blank leaflet_language = blank
if leaflet_reference is None: if leaflet_reference is None:
leaflet_reference = leaflet_prefix + leaflet_title.replace(" ", ".") leaflet_reference = leaflet_prefix + leaflet_title.replace(" ", ".")
leaflet_full_reference = '-'.join([leaflet_reference, leaflet_version, leaflet_language]) leaflet_full_reference = '-'.join([leaflet_reference, leaflet_version, leaflet_language])
# ---------------------------- Theme Parameters -------------------------------- # ---------------------------- Theme Parameters --------------------------------
leaflet_theme = leaflet.Base_getThemeDict(format=leaflet_format, css_path="leaflet_css/leaflet") leaflet_theme = leaflet.Base_getThemeDict(format=leaflet_format, css_path="template_css/leaflet")
# XXX set leaflet title, but not to theme (used elsewhere, but not on leaflet) # XXX set leaflet title, but not to theme (used elsewhere, but not on leaflet)
if override_leaflet_header_title is not None: if override_leaflet_header_title is not None:
leaflet_theme["theme_logo_description"] = html_quote(override_leaflet_header_title) leaflet_theme["theme_logo_description"] = html_quote(override_leaflet_header_title)
if leaflet_theme.get("theme").lower() == leaflet_theme.get("theme_logo_description").lower(): if leaflet_theme.get("theme").lower() == leaflet_theme.get("theme_logo_description").lower():
leaflet_theme["theme_logo_description"] = blank leaflet_theme["theme_logo_description"] = blank
leaflet_recycle_url = ''.join([leaflet_url, "/leaflet_img/recycle.png?portal_skin=Leaflet"]) leaflet_recycle_url = "template_images/recycle.png"
leaflet_css = ''.join([ leaflet_css = ''.join([
'html .ci-leaflet #left-summary:before {', 'html .ci-leaflet #left-summary:before {',
'background: url("%s") center no-repeat;' % (leaflet_theme.get("enhanced_logo_url")), 'background: url("%s") center no-repeat;' % (leaflet_theme.get("enhanced_logo_url")),
......
...@@ -12,7 +12,7 @@ MAIN FILE: generate presentation in different output formats ...@@ -12,7 +12,7 @@ MAIN FILE: generate presentation in different output formats
# override_logo_reference: to use instead of default company logo in footer # override_logo_reference: to use instead of default company logo in footer
# override_batch_mode: used for tests # override_batch_mode: used for tests
# ------ # ------
# document_download: download file directly (default None) # document_download: download file directly (default None)
# document_save: save file in document module (default None) # document_save: save file in document module (default None)
# ------ # ------
# display_note: display slide notes (1) or not (0)* # display_note: display slide notes (1) or not (0)*
...@@ -54,7 +54,7 @@ def removeSectionTags(my_content): ...@@ -54,7 +54,7 @@ def removeSectionTags(my_content):
content = content.replace('</section>', blank) content = content.replace('</section>', blank)
content = content.replace('<section>', blank) content = content.replace('<section>', blank)
return content return content
def removeDetailTags(my_content): def removeDetailTags(my_content):
content = my_content.replace('</details>', blank) content = my_content.replace('</details>', blank)
content = content.replace('<details>', blank) content = content.replace('<details>', blank)
...@@ -202,7 +202,7 @@ if doc_reference is None: ...@@ -202,7 +202,7 @@ if doc_reference is None:
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language]) doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# --------------------------- Layout Parameters -------------------------------- # --------------------------- Layout Parameters --------------------------------
doc_theme = doc.Base_getThemeDict(format=doc_format, css_path="slide_css/slide") doc_theme = doc.Base_getThemeDict(format=doc_format, css_path="template_css/slide")
doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {', doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {',
'content: "%s";' % (doc_theme.get("theme_logo_description")), 'content: "%s";' % (doc_theme.get("theme_logo_description")),
'background: #FFF url("%s") center no-repeat;' % (doc.Base_setUrl(path=doc_theme.get("theme_logo_url"), display="medium")), 'background: #FFF url("%s") center no-repeat;' % (doc.Base_setUrl(path=doc_theme.get("theme_logo_url"), display="medium")),
...@@ -255,7 +255,7 @@ for image in re.findall('(<img.*?/>)', doc_content): ...@@ -255,7 +255,7 @@ for image in re.findall('(<img.*?/>)', doc_content):
# #
# ------------- backwards compatability with old slideshow --------------------- # ------------- backwards compatability with old slideshow ---------------------
# requires to wrap content of slides that contain <details> into nested # requires to wrap content of slides that contain <details> into nested
# <section> tags. Done here, after book, because it adds more complexity # <section> tags. Done here, after book, because it adds more complexity
if getDetails(doc_content) > -1: if getDetails(doc_content) > -1:
for slide in getSlideList(doc_content): for slide in getSlideList(doc_content):
...@@ -263,7 +263,7 @@ if getDetails(doc_content) > -1: ...@@ -263,7 +263,7 @@ if getDetails(doc_content) > -1:
cleaned = slide.split('<details')[0] cleaned = slide.split('<details')[0]
wrapped = ''.join(["<section>", cleaned, "</section>"]) wrapped = ''.join(["<section>", cleaned, "</section>"])
updated = slide.replace(cleaned, wrapped) updated = slide.replace(cleaned, wrapped)
# fix closed details # fix closed details
details = updated.replace('<details>', '<details open="open">') details = updated.replace('<details>', '<details open="open">')
...@@ -361,7 +361,7 @@ if doc_format == "pdf" or doc_format == "mhtml": ...@@ -361,7 +361,7 @@ if doc_format == "pdf" or doc_format == "mhtml":
doc_theme_css_url=doc_theme.get("theme_css_url"), doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_notes=removeSlidesWithoutDetailsFromNotes(doc_content) doc_notes=removeSlidesWithoutDetailsFromNotes(doc_content)
) )
# ================ encode and build cloudoo elements ========================= # ================ encode and build cloudoo elements =========================
footer_embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_footer, allow_script=True) footer_embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_footer, allow_script=True)
embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_content, allow_script=True) embedded_html_data = doc.Base_convertHtmlToSingleFile(doc_slideshow_content, allow_script=True)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>common_images</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>letter_css</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slide_css</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slide_img</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slide_js</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>leaflet_img</string> </value> <value> <string>template_css</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>default_themes</string> </value> <value> <string>template_images</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>book_css</string> </value> <value> <string>template_js</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>leaflet_css</string> </value> <value> <string>template_themes</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -3,6 +3,45 @@ ...@@ -3,6 +3,45 @@
View WebPage as Book or Report View WebPage as Book or Report
================================================================================ ================================================================================
""" """
# parameters
# ------------------------------------------------------------------------------
# format output (html*, pdf)
# batch_mode used for tests
# transformation (not done)
#
# include_content_table include table of content (True*)
# include_history_table include history/authors (XXX not done)
# include_reference_table include table of links/images/tables
# include_linked_content embed content of linked documents
# include_report_content embed content of report documents
# document_download download file directly (None*)
# document_save save file in document module (None*)
# document_language language to generate report in
# document_reference reference of document for report
# document_version version of document for report
# document_title document title for report
#
# override_source_person_title use instead of the document author
# override_source_organisation_title use as publishing organisation
# override_document_description use as cover page description
# override_document_short_title use as cover page subtitle
# override_document_title use as cover page title
# override_document_version use as document version
# override_document_reference use as document reference
# override_logo_reference use as document header logo
#
# requirement_relative_url XXX relate sale order to requirement
#
# report_name name of report to call
# report_title title of report
#
# display_depth depth to report (eg sale order lines)
# display_detail show details on report
# display_comment show comments on report
# display_header display report header
# display_svg format for svg images (svg, png*)
if context.REQUEST["portal_skin"] == "Report": if context.REQUEST["portal_skin"] == "Report":
return context.Base_viewAsReport( return context.Base_viewAsReport(
format=format, format=format,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
View as Leaflet (using portal_skin=Leaflet) View as Leaflet (using portal_skin=Leaflet)
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# display_side: display side bar (1)* or not (0)
# display_svg: display images as svg or png*
# batch_mode: used for tests
# override_leaflet_header_title: custom title to use in the leaflet header
# override_source_organisation_title: used instead of follow-up organisation
# override_source_person_title: used instead of contributor
# document_downalod: download file directly
# document_save: save file in document module
return context.WebPage_viewAsLeaflet( return context.WebPage_viewAsLeaflet(
format=format, format=format,
display_side=display_side, display_side=display_side,
......
...@@ -3,6 +3,20 @@ ...@@ -3,6 +3,20 @@
Display WebPage as slideshow if called with portal_skin=Slide parameter Display WebPage as slideshow if called with portal_skin=Slide parameter
================================================================================ ================================================================================
""" """
# parameters (* default)
# ------------------------------------------------------------------------------
# format: output in html*, pdf
# batch_mode: used for tests
# override_source_organisation_title: to use instead of default company
# override_logo_reference: to use instead of default company logo in footer
# document_download: download file directly (default None)
# document_save: save file in document module (default None)
# display_note: display slide notes (1) or not (0)*
# display_svg: display svg-images as svg or png*
return context.WebPage_viewAsSlideshow( return context.WebPage_viewAsSlideshow(
format=format, format=format,
display_note=display_note, display_note=display_note,
......
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