Commit d57dc7ae authored by Sven Franck's avatar Sven Franck

erp5_ci_slideshow: correctly set theme

parent 5a6f488e
...@@ -35,33 +35,46 @@ def removeEmptyDetails(content): ...@@ -35,33 +35,46 @@ def removeEmptyDetails(content):
def getThemeFromFirstFollowUpProduct(reference): def getThemeFromFirstFollowUpProduct(reference):
theme = None theme = None
osoe_match_string = "osoe" osoe_match_string = "osoe"
product_match_string = "product"
# first try to theme to Software software_match_string = " Software"
portal = context.getPortalObject()
# theme: try via followUpValue (most likely restricted)
follow_up_list = context.getFollowUpValueList( follow_up_list = context.getFollowUpValueList(
portal_type="Product", portal_type="Product",
checked_permission='View' checked_permission='View'
) )
if len(follow_up_list) > 0: if len(follow_up_list) > 0:
full_title = follow_up_list[0].getTitle() for follow_up in follow_up_list:
theme = full_title.split(" Software")[0].lower() follow_up_title = follow_up.getTitle()
if follow_up_title.find(software_match_string) > 1:
# then to OSOE extra for Klaus theme = follow_up_title.split(software_match_string)[0].lower()
# XXX this should be relative to the website the presentation is being
# viewed from. from OSOE => osoe theme, from ERP5 => erp5 theme # theme: then try via category
category_list = context.getCategoryList() category_list = context.getCategoryList()
if len(category_list) > 0: if len(category_list) > 0:
for category in category_list: for category in category_list:
if category.find(product_match_string) > 1:
relative_url = category.split("follow_up/")[1]
category_object = portal.portal_catalog(relative_url=relative_url,limit=1)
category_title = category_object[0].getTitle()
theme = category_title.split(software_match_string)[0].lower()
# OSOE extra handle
# XXX this should be relative to the website the presentation is being
# viewed from. from OSOE => osoe theme, from ERP5 => erp5 theme
if category.find(osoe_match_string) > 1: if category.find(osoe_match_string) > 1:
theme = osoe_match_string theme = osoe_match_string
# theme: fallback to Nexedi
if theme is None:
theme = "nexedi"
#3 fallback to Nexedi return theme
if theme is not None:
return theme
return "nexedi"
document = context document = context
# wkhtmltopdf # wkhtmltopdf
...@@ -293,7 +306,7 @@ return """ ...@@ -293,7 +306,7 @@ return """
<style type="text/css"> <style type="text/css">
html .ci-presentation .slides .ci-presentation-intro.present:before { html .ci-presentation .slides .ci-presentation-intro.present:before {
content: "%s"; content: "%s";
background: #FFF url("%s?format=png") center no-repeat; background: #FFF url("%s?format=png&amp;display=small") center no-repeat;
background-size: auto 120px; background-size: auto 120px;
} }
</style> </style>
......
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