Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
erp5
Commits
d57dc7ae
Commit
d57dc7ae
authored
Sep 20, 2016
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ci_slideshow: correctly set theme
parent
5a6f488e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
17 deletions
+30
-17
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
...eItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
+30
-17
No files found.
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
View file @
d57dc7ae
...
...
@@ -35,32 +35,45 @@ def removeEmptyDetails(content):
def
getThemeFromFirstFollowUpProduct
(
reference
):
theme
=
None
osoe_match_string
=
"osoe"
product_match_string
=
"product"
software_match_string
=
" Software"
# first try to theme to Software
portal
=
context
.
getPortalObject
()
# theme: try via followUpValue (most likely restricted)
follow_up_list
=
context
.
getFollowUpValueList
(
portal_type
=
"Product"
,
checked_permission
=
'View'
)
if
len
(
follow_up_list
)
>
0
:
full_title
=
follow_up_list
[
0
].
getTitle
()
theme
=
full_title
.
split
(
" Software"
)[
0
].
lower
()
# then to OSOE extra for Klaus
# XXX this should be relative to the website the presentation is being
# viewed from. from OSOE => osoe theme, from ERP5 => erp5 theme
for
follow_up
in
follow_up_list
:
follow_up_title
=
follow_up
.
getTitle
()
if
follow_up_title
.
find
(
software_match_string
)
>
1
:
theme
=
follow_up_title
.
split
(
software_match_string
)[
0
].
lower
()
# theme: then try via category
category_list
=
context
.
getCategoryList
()
if
len
(
category_list
)
>
0
:
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
:
theme
=
osoe_match_string
#3 fallback to Nexedi
if
theme
is
not
None
:
# theme: fallback to Nexedi
if
theme
is
None
:
theme
=
"nexedi"
return
theme
return
"nexedi"
document
=
context
...
...
@@ -293,7 +306,7 @@ return """
<style type="text/css">
html .ci-presentation .slides .ci-presentation-intro.present:before {
content: "%s";
background: #FFF url("%s?format=png") center no-repeat;
background: #FFF url("%s?format=png
&display=small
") center no-repeat;
background-size: auto 120px;
}
</style>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment