Commit 084ef66c authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: add display to Base_setUrl and force smaller size on large logos

parent fb47827a
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13899444.92</string> </value>
<value> <string>ts13926038.91</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>056bf568edbefa5d4decf78a8b16b0ac</string> </value>
<value> <string>5564d9bbe028a5da43d37592ae680c6a</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>375471</int> </value>
<value> <int>375470</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13899490.19</string> </value>
<value> <string>ts13926193.75</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>79c316af45838d8512ecaa12f3d72019</string> </value>
<value> <string>540b8a32acd603aff2d4204a4e9390ef</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>377617</int> </value>
<value> <int>377618</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13899511.52</string> </value>
<value> <string>ts13926238.79</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>6b2e7b677f511dcd14e0bb4a1eaf7a5d</string> </value>
<value> <string>3028744e0cfe9cc71ab2a60b48914d1a</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>380516</int> </value>
<value> <int>380517</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13899471.91</string> </value>
<value> <string>ts13926080.85</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>78dc6ace316c2c6bc802d4f2cd18b5a2</string> </value>
<value> <string>0e487b921fb15491049adc7ee42d2d27</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>389081</int> </value>
<value> <int>389080</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13899537.13</string> </value>
<value> <string>ts13926302.45</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>6bded42777378af19c195e085ef7407f</string> </value>
<value> <string>b7aa9d536f7ac9e80e1ee3eafd0e0cb3</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>390916</int> </value>
<value> <int>390914</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>ee348964486e6a674b36ce81dd2ae866</string> </value>
<value> <string>2b69a7af236bccfd6a5625b18bd64921</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>af08fc3f74bed6ae227095df69f3dde6</string> </value>
<value> <string>15f2ac717a9096c3c709e9ea98354653</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>1307805fc899d0e644086007b91bd794</string> </value>
<value> <string>e49a56dc6b1efa0ea16cd3cdffa59ff7</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......
......@@ -14,7 +14,7 @@
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" href="default_themes/themes.css" />
<link rel="stylesheet" href="slide_css/slide.css" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 45% !important;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -36,7 +36,7 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<div class="ci-slideshow-footer-image-wrapper">
<img alt="" src="common_images/fallback.png" />
<img src="common_images/fallback.png" alt="logo" />
</div>
</div>
<div class="ci-slideshow-container-center"></div>
......
......@@ -14,7 +14,7 @@
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" href="default_themes/themes.css" />
<link rel="stylesheet" href="slide_css/slide.css" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 45% !important;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -36,8 +36,8 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<div class="ci-slideshow-footer-image-wrapper">
<img alt=""
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=thumbnail" />
<img src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=thumbnail"
alt="logo" />
</div>
</div>
<div class="ci-slideshow-container-center"></div>
......
......@@ -14,7 +14,7 @@
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" href="default_themes/themes.css" />
<link rel="stylesheet" href="slide_css/slide.css" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 45% !important;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -36,7 +36,7 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<div class="ci-slideshow-footer-image-wrapper">
<img alt="" src="common_images/fallback.png" />
<img src="common_images/fallback.png" alt="logo" />
</div>
</div>
<div class="ci-slideshow-container-center">Some description</div>
......
......@@ -38,7 +38,9 @@ if theme is not None:
theme_logo_url = logo_prefix + theme.capitalize()
try:
theme_logo = context.restrictedTraverse(theme_logo_url)
theme_logo_relative_url = theme_logo.getRelativeUrl()
theme_logo_relative_url = theme_logo_url
# XXX does not work in test-environment
#theme_logo_relative_url = theme_logo.getRelativeUrl()
theme_logo_description = theme_logo.getDescription()
except LookupError:
#__traceback_info__ = "theme_logo_url: %r" % (theme_logo_url,)
......
......@@ -15,4 +15,4 @@ Add image size conversion only if image is not the default image
if path.find("common") > -1:
return path
else:
return path + "&display=thumbnail"
return path + "&display=%s" % (display or "thumbnail")
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>path=None</string> </value>
<value> <string>path=None, display=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -119,7 +119,7 @@ if doc_format == "html":
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_template_css_url=doc_theme.get("template_css_url"),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url")),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_logo_title=doc_source.get("theme_logo_description"),
book_short_title=doc_short_title,
book_reference=doc_reference,
......@@ -166,7 +166,7 @@ if doc_format == "pdf":
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_template_css_url=doc_theme.get("template_css_url"),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url")),
book_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_logo_title=doc_source.get("theme_logo_description"),
book_short_title=doc_short_title,
book_reference=doc_reference,
......@@ -181,7 +181,7 @@ if doc_format == "pdf":
book_language=doc_language,
book_theme_css_font_list=doc_theme.get("theme_css_font_list"),
book_theme_css_url=doc_theme.get("theme_css_url"),
book_theme_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url")),
book_theme_logo_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
book_theme_logo_alt=doc_theme.get("theme_logo_description"),
book_template_css_url=doc_theme.get("template_css_url"),
book_full_reference=doc_full_reference,
......
......@@ -229,7 +229,7 @@ if book_format == "html" or book_format == "mhtml":
book_signature_list=book_signature_list,
book_version_list=book_version_list,
book_distribution_list=book_distribution_list,
book_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url")),
book_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url"), display=None),
book_logo_title=book_theme.get("theme_logo_description"),
book_reference=book_reference,
book_revision=book_revision,
......@@ -279,7 +279,7 @@ if book_format == "pdf":
book_language=book_language,
book_theme_css_font_list=book_theme.get("theme_css_font_list"),
book_theme_css_url=book_theme.get("theme_css_url"),
book_theme_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url")),
book_theme_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url"), display=None),
book_theme_logo_alt=book_theme.get("theme_logo_alt"),
book_template_css_url=book_theme.get("template_css_url"),
book_include_history=book_include_history_table,
......@@ -308,7 +308,7 @@ if book_format == "pdf":
book_theme_css_font_list=book_theme.get("theme_css_font_list"),
book_theme_css_url=book_theme.get("theme_css_url"),
book_template_css_url=book_theme.get("template_css_url"),
book_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url")),
book_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url"), display=None),
book_logo_title=book_theme.get("theme_logo_description"),
book_short_title=book_short_title,
book_reference=book_reference,
......@@ -323,7 +323,7 @@ if book_format == "pdf":
book_language=book_language,
book_theme_css_font_list=book_theme.get("theme_css_font_list"),
book_theme_css_url=book_theme.get("theme_css_url"),
book_theme_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url")),
book_theme_logo_url=book.Base_setUrl(path=book_source.get("enhanced_logo_url"), display=None),
book_theme_logo_alt=book_theme.get("theme_logo_description"),
book_template_css_url=book_theme.get("template_css_url"),
book_full_reference=book_full_reference,
......
......@@ -187,7 +187,7 @@ if leaflet_format == "html":
leaflet_template_css_url=leaflet_theme.get("template_css_url"),
leaflet_organisation=leaflet_source.get("organisation_title", blank),
leaflet_organisation_claim=leaflet_theme.get("theme_logo_description") or blank,
leaflet_logo_url=leaflet.Base_setUrl(path=leaflet_source.get("enhanced_logo_url")),
leaflet_logo_url=leaflet.Base_setUrl(path=leaflet_source.get("enhanced_logo_url"), display=None),
leaflet_copyright=leaflet_source.get("organisation_title", blank),
leaflet_full_reference=leaflet_full_reference,
leaflet_year=leaflet_year,
......@@ -232,7 +232,7 @@ if leaflet_format == "pdf":
leaflet_theme_css_font_list=leaflet_theme.get("theme_css_font_list"),
leaflet_theme_css_url=leaflet_theme.get("theme_css_url"),
leaflet_template_css_url=leaflet_theme.get("template_css_url"),
leaflet_logo_url=leaflet.Base_setUrl(path=leaflet_source.get("enhanced_logo_url")),
leaflet_logo_url=leaflet.Base_setUrl(path=leaflet_source.get("enhanced_logo_url"), display=None),
leaflet_copyright=leaflet_source.get("organisation_title", blank),
leaflet_full_reference=leaflet_full_reference,
leaflet_year=leaflet_year,
......
......@@ -136,7 +136,7 @@ if letter_format == "html":
letter_theme_css_font_list=letter_theme.get("theme_css_font_list"),
letter_theme_css_url=letter_theme.get("theme_css_url"),
letter_template_css_url=letter_theme.get("template_css_url"),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url")),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url"), display=None),
letter_theme_logo_alt=letter_theme.get("theme_logo_description"),
letter_timestamp=letter_modification_date.strftime('%Y-%m-%d'),
letter_destination_company=letter_destination.get("organisation_title", blank),
......@@ -191,7 +191,7 @@ if letter_format == "pdf":
letter_theme_css_font_list=letter_theme.get("theme_css_font_list"),
letter_theme_css_url=letter_theme.get("theme_css_url"),
letter_template_css_url=letter_theme.get("template_css_url"),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url")),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url"), display=None),
letter_theme_logo_alt=letter_theme.get("theme_logo_description"),
letter_timestamp=letter_modification_date.strftime('%Y-%m-%d'),
letter_source_city=letter_source.get("city", blank)
......@@ -205,7 +205,7 @@ if letter_format == "pdf":
letter_theme_css_font_list=letter_theme.get("theme_css_font_list"),
letter_theme_css_url=letter_theme.get("theme_css_url"),
letter_template_css_url=letter_theme.get("template_css_url"),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url")),
letter_theme_logo_url=letter.Base_setUrl(path=letter_source.get("enhanced_logo_url"), display=None),
letter_theme_logo_alt=letter_theme.get("theme_logo_description"),
letter_timestamp=letter_modification_date.strftime('%Y-%m-%d'),
letter_destination_company=letter_destination.get("organisation_title", blank),
......
......@@ -12,6 +12,7 @@ Generates the complete slideshow
doc_template_css_url python: options.get('doc_template_css_url');
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_footer_url_description python: options.get('doc_footer_url_description');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
......
......@@ -12,6 +12,7 @@ Creates the Slideshow footer section.
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_template_css_url python: options.get('doc_template_css_url');
doc_footer_url_description python: options.get('doc_footer_url_description');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
......@@ -59,7 +60,8 @@ Creates the Slideshow footer section.
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<div class="ci-slideshow-footer-image-wrapper">
<img tal:attributes="src python: doc_footer_url" alt="" />
<img tal:attributes="src python: doc_footer_url;
alt python: doc_footer_url_description or 'logo'" />
</div>
</div>
<div class="ci-slideshow-container-center" tal:content="doc_description"></div>
......
......@@ -205,8 +205,9 @@ doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
doc_theme = doc.Base_getThemeDict(format=doc_format, css_path="slide_css/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_theme.get("theme_logo_url")),
'background-size: auto 120px;'
'background: #FFF url("%s") center no-repeat;' % (doc.Base_setUrl(path=doc_theme.get("theme_logo_url"), display="medium")),
#'background-size: auto 120px;',
'background-size: auto 45% !important;',
'}'])
# ---------------------------------- Source ------------------------------------
......@@ -279,7 +280,8 @@ if doc_format == "html" or doc_format == "mhtml":
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_footer_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url")),
doc_footer_url_description=doc_theme.get("theme_logo_description"),
doc_footer_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
doc_description=doc_description,
doc_creation_year=doc_creation_year,
doc_copyright=doc_source.get("organisation_title", blank),
......@@ -316,7 +318,8 @@ if doc_format == "pdf":
doc_template_css_url=doc_theme.get("template_css_url"),
doc_theme_css_font_list=doc_theme.get("theme_css_font_list"),
doc_theme_css_url=doc_theme.get("theme_css_url"),
doc_footer_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url")),
doc_footer_url_description=doc_theme.get("theme_logo_description"),
doc_footer_url=doc.Base_setUrl(path=doc_source.get("enhanced_logo_url"), display=None),
doc_description=doc_description,
doc_creation_year=doc_creation_year,
doc_copyright=doc_source.get("organisation_title", blank),
......
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