Commit c94060b9 authored by Sven Franck's avatar Sven Franck Committed by Tristan Cavelier

erp5_corporate_identity: pass skin for custom theme parameter lookup

parent 0e73e571
......@@ -18,6 +18,11 @@ css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?format=png"
# theme content might not be visible on the default View
lookup_skin = blank
if skin:
lookup_skin = "?portal_skin=" + skin
theme_logo_list = []
theme_logo_dict = {}
theme_reference = None
......@@ -49,5 +54,9 @@ theme_dict["theme_css_font_list"] = []
theme_font_list = context.Base_getTemplateParameter(font) or []
for font in theme_font_list:
theme_dict["theme_css_font_list"].append(font + pdf)
theme_dict["theme_css_url"] = context.Base_getTemplateParameter(css) or context.Base_getTemplateParameter(css) or blank
theme_css_url = context.Base_getTemplateParameter(css)
if theme_css_url:
theme_dict["theme_css_url"] = context.Base_getTemplateParameter(css) + lookup_skin
else:
theme_dict["theme_css_url"] = blank
return theme_dict
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>doc_format=None, css_path=None</string> </value>
<value> <string>doc_format=None, css_path=None, skin=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -90,7 +90,7 @@ if letter_reference is None:
letter_full_reference = '-'.join([letter_reference, letter_version, letter_language])
# --------------------------- Layout Parameters --------------------------------
letter_theme = letter.Base_getThemeDict(doc_format=letter_format, css_path="template_css/letter")
letter_theme = letter.Base_getThemeDict(doc_format=letter_format, css_path="template_css/letter", skin="Letter")
# --------------------------- Source/Destination -------------------------------
letter_source = letter.Base_getSourceDict(
......
......@@ -129,7 +129,7 @@ doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
doc_short_date = doc_modification_date.strftime('%Y-%m-%d')
# ------------------------------- Theme ----------------------------------------
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="template_css/book")
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="template_css/book", skin="Book")
# --------------------------- Source/Destination -------------------------------
doc_source = doc.Base_getSourceDict(
......
......@@ -106,7 +106,7 @@ if book_reference is None:
book_full_reference = '-'.join([book_reference, book_version, book_language])
# ------------------------------- Theme ----------------------------------------
book_theme = book.Base_getThemeDict(doc_format=book_format, css_path="template_css/book")
book_theme = book.Base_getThemeDict(doc_format=book_format, css_path="template_css/book", skin="Book")
# --------------------------- Source/Destination -------------------------------
book_source = book.Base_getSourceDict(
......
......@@ -75,7 +75,7 @@ if leaflet_reference is None:
leaflet_full_reference = '-'.join([leaflet_reference, leaflet_version, leaflet_language])
# ---------------------------- Theme Parameters --------------------------------
leaflet_theme = leaflet.Base_getThemeDict(doc_format=leaflet_format, css_path="template_css/leaflet")
leaflet_theme = leaflet.Base_getThemeDict(doc_format=leaflet_format, css_path="template_css/leaflet", skin="Leaflet")
if override_leaflet_header_title and override_leaflet_header_title != blank:
leaflet_theme["theme_logo_description"] = html_quote(override_leaflet_header_title)
......@@ -267,7 +267,6 @@ if leaflet_format == "pdf":
footer_spacing=3
)
)
return leaflet.WebPage_finishPdfCreation(
doc_download=leaflet_download,
doc_save=leaflet_save,
......
......@@ -77,7 +77,7 @@ if release_reference is None:
release_full_reference = '-'.join([release_reference, release_version, release_language])
# ---------------------------- Theme Parameters --------------------------------
release_theme = release.Base_getThemeDict(doc_format=release_format, css_path="template_css/release")
release_theme = release.Base_getThemeDict(doc_format=release_format, css_path="template_css/release", skin="Release")
release_css = ''.join([
'html .ci-press-release .ci-press-release-logo:before {',
'background: url("%s") center no-repeat;' % (release_theme.get("theme_logo_url")),
......
......@@ -219,7 +219,7 @@ if doc_reference is None:
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# --------------------------- Layout Parameters --------------------------------
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="template_css/slide")
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="template_css/slide", skin="Slide")
doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {',
'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")),
......
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