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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
erp5
Commits
0becf2f2
Commit
0becf2f2
authored
Oct 20, 2016
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ci_slideshow: substitute strings in a more readable way
parent
50304da3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
65 deletions
+62
-65
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
...eItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
+62
-65
No files found.
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
View file @
0becf2f2
...
...
@@ -61,7 +61,8 @@ def getThemeFromFirstFollowUpProduct(reference):
relative_url
=
category
.
split
(
"follow_up/"
)[
1
]
category_object
=
portal
.
portal_catalog
(
relative_url
=
relative_url
,
limit
=
1
)
if
len
(
category_object
)
>
0
:
category_title
=
category_object
[
0
].
getTitle
()
category_title
=
category_object
[
0
]
category_title
=
category_title
.
getTitle
()
theme
=
category_title
.
split
(
software_match_string
)[
0
].
lower
()
# OSOE extra handle
...
...
@@ -109,14 +110,14 @@ if has_details is True:
updated
=
slide
.
replace
(
cleaned
,
wrapped
)
document_content
=
document_content
.
replace
(
slide
,
updated
)
# wkhtmltopdf
# wkhtmltopdf
if
document_output_type
==
"footer"
:
return
"""
<!Doctype html>
<html class="ci-%s">
<html class="ci-%
(document_theme)
s">
<head>
<meta charset="utf-8">
<title>%s</title>
<title>%
(document_title)
s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
...
...
@@ -146,29 +147,29 @@ if document_output_type == "footer":
<div class="ci-presentation-container-left">
<img src="NXD-Media.Logo.Nexedi?format=png&display=xsmall" alt="Nexedi Logo" />
</div>
<div class="ci-presentation-container-center">%s</div>
<div class="ci-presentation-container-center">%
(document_description)
s</div>
<div class="ci-presentation-container-right">
%s © Nexedi SA<br/>
%s<span class="page"></span> | <span class="topage"></span>
%
(document_creation_year)
s © Nexedi SA<br/>
%
(document_contributor_list)
s<span class="page"></span> | <span class="topage"></span>
</div>
</div>
</body>
</html>
"""
%
(
document_theme
,
document_title
,
document_description
,
document_creation_year
,
document_contributor_list
)
"""
%
{
'document_theme'
:
document_theme
,
'document_title'
:
document_title
,
'document_description'
:
document_description
,
'document_creation_year'
:
document_creation_year
,
'document_contributor_list'
:
document_contributor_list
}
if
document_output_type
==
"cover"
:
return
"""
<!Doctype html>
<html class="ci-pdf ci-%s">
<html class="ci-pdf ci-%
(document_theme)
s">
<head>
<meta charset="utf-8">
<title>%s</title>
<title>%
(document_title)
s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
...
...
@@ -183,8 +184,8 @@ if document_output_type == "cover":
<!-- logo-box and slogan -->
<style type="text/css">
html .ci-presentation-intro.present:before {
content: "%s";
background: #FFF url("%s?format=png&display=small") center no-repeat;
content: "%
(document_claim)
s";
background: #FFF url("%
(document_theme_logo_url)
s?format=png&display=small") center no-repeat;
}
</style>
</head>
...
...
@@ -192,19 +193,18 @@ if document_output_type == "cover":
<div class="reveal">
<div class="slides">
<section class="ci-presentation-intro present">
<h2>%s</h2>
<h2>%
(document_title)
s</h2>
</section>
</div>
</div>
</body>
</html>
"""
%
(
document_theme
,
document_title
,
document_claim
,
document_theme_logo_url
,
document_title
)
"""
%
{
'document_theme'
:
document_theme
,
'document_title'
:
document_title
,
'document_claim'
:
document_claim
,
'document_theme_logo_url'
:
document_theme_logo_url
}
# outputting just the content requires to drop wrapping <divs> (reveal/slides)
# and add extra css to recreate the same layout. so a separate output=content
...
...
@@ -212,10 +212,10 @@ if document_output_type == "cover":
if
document_output_type
==
"content"
:
return
"""
<!Doctype html>
<html class="ci-%s">
<html class="ci-%
(document_theme)
s">
<head>
<meta charset="utf-8">
<title>%s</title>
<title>%
(document_title)
s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
...
...
@@ -232,25 +232,25 @@ if document_output_type == "content":
<body class="ci-presentation">
<!-- <div class="reveal">
<div class="slides"> -->
%s
%
(document_content)
s
<!-- </div>
</div> -->
</body>
</html>
"""
%
(
document_theme
,
document_title
,
document_content
)
"""
%
{
'document_theme'
:
document_theme
,
'document_title'
:
document_title
,
'document_content'
:
document_content
}
# handouts
if
document_output_type
==
"details"
:
return
"""
<!Doctype html>
<html class="ci-%s">
<html class="ci-%
(document_theme)
s">
<head>
<meta charset="utf-8">
<title>%s</title>
<title>%
(document_title)
s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
...
...
@@ -271,27 +271,26 @@ if document_output_type == "details":
<section>
<h1>Notes</h1>
</section>
%s
%
(document_content)
s
<!-- </div>
</div> -->
</body>
</html>
"""
%
(
document_theme
,
document_title
,
#document_content
removeSlidesWithoutDetailsFromNotes
(
document_content
)
)
"""
%
{
'document_theme'
:
document_theme
,
'document_title'
:
document_title
,
'document_content'
:
removeSlidesWithoutDetailsFromNotes
(
document_content
)
}
# DEFAULT WebPage_viewAsWeb
return
"""
<!Doctype html>
<html class="ci-%s">
<html class="ci-%
(document_theme)
s">
<head>
<meta charset="utf-8">
<title>%s</title>
<title>%
(document_title)
s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
...
...
@@ -306,8 +305,8 @@ return """
<!-- logo-box and slogan -->
<style type="text/css">
html .ci-presentation .slides .ci-presentation-intro.present:before {
content: "%s";
background: #FFF url("%s?format=png&display=small") center no-repeat;
content: "%
(document_claim)
s";
background: #FFF url("%
(document_theme_logo_url)
s?format=png&display=small") center no-repeat;
background-size: auto 120px;
}
</style>
...
...
@@ -333,21 +332,21 @@ return """
<!-- intro slide -->
<section class="ci-presentation-intro">
<h2>%s</h2>
<h2>%
(document_title)
s</h2>
</section>
<div class="ci-presentation-header">
<h2>%s</h2>
<h2>%
(document_title)
s</h2>
</div>
%s
%
(document_content)
s
<div class="ci-presentation-footer">
<div class="ci-presentation-container-left">
<img src="NXD-Media.Logo.Nexedi?format=png" alt="Nexedi Logo" />
</div>
<div class="ci-presentation-container-center">%s</div>
<div class="ci-presentation-container-center">%
(document_description)
s</div>
<div class="ci-presentation-container-right">
%s © Nexedi SA<br/>
%s
%
(document_creation_year)
s © Nexedi SA<br/>
%
(document_contributor_list)
s
</div>
</div>
</div>
...
...
@@ -373,15 +372,13 @@ return """
Reveal.configure({ slideNumber: 'c / t' });
</script>
</body>
</html>"""
%
(
document_theme
,
document_title
,
document_claim
,
document_theme_logo_url
,
document_title
,
document_title
,
document_content
,
document_description
,
document_creation_year
,
document_contributor_list
)
</html>"""
%
{
'document_theme'
:
document_theme
,
'document_title'
:
document_title
,
'document_claim'
:
document_claim
,
'document_theme_logo_url'
:
document_theme_logo_url
,
'document_content'
:
document_content
,
'document_description'
:
document_description
,
'document_creation_year'
:
document_creation_year
,
'document_contributor_list'
:
document_contributor_list
}
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