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
Paul Graydon
erp5
Commits
745f70e1
Commit
745f70e1
authored
Sep 06, 2016
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ci_slideshow: add print layout including notes
parent
293043c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
193 additions
and
11 deletions
+193
-11
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
...eItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
+68
-3
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom.css.css
...ateItem/portal_skins/erp5_ci_slideshow/css/custom.css.css
+17
-8
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.css
...al_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.css
+80
-0
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.xml
...al_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.xml
+28
-0
No files found.
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/WebPage_viewAsWeb.py
View file @
745f70e1
"""
================================================================================
Presentation Layout ?portal_skin=CI_
presentation
Presentation Layout ?portal_skin=CI_
slideshow
================================================================================
"""
import
re
def
getSlideList
(
content
):
return
re
.
findall
(
r'<section[^>]*?>(.*?)</section>'
,
content
,
re
.
S
)
def
getDetails
(
content
):
return
content
.
find
(
"</details>"
)
>
-
1
def
getNestedSection
(
content
):
return
content
.
find
(
"<section"
)
>
-
1
def
removeSlidesWithoutDetailsFromNotes
(
content
):
slide_list
=
getSlideList
(
content
)
# empty slide if no <detail>
for
slide
in
slide_list
:
if
getNestedSection
(
slide
)
is
False
:
content
=
content
.
replace
(
slide
,
''
)
# remove empty slides
content
=
content
.
replace
(
'<section></section>'
,
''
)
content
=
re
.
sub
(
r'<section class="[^"]*"></section>'
,
''
,
content
)
# remove empty slides with class
return
content
def
removeEmptyDetails
(
content
):
return
content
.
replace
(
'<details open="open"></details>'
,
''
)
def
getThemeFromFirstFollowUpProduct
():
follow_up_list
=
context
.
getFollowUpValueList
(
portal_type
=
"Product"
,
...
...
@@ -24,7 +48,7 @@ document = context
# wkhtmltopdf
document_output_type
=
document
.
REQUEST
.
form
.
get
(
"output"
,
default
=
None
)
document_content
=
document
.
getTextContent
(
)
document_content
=
removeEmptyDetails
(
document
.
getTextContent
()
)
document_theme
=
getThemeFromFirstFollowUpProduct
()
document_title
=
document
.
getTitle
()
document_description
=
document
.
getDescription
()
...
...
@@ -42,7 +66,7 @@ document_contributor_list = ""
# <section> tags. this is done here
has_details
=
getDetails
(
document_content
)
if
has_details
is
True
:
slide_list
=
re
.
findall
(
r'<section[^>]*?>(.*?)</section>'
,
document_content
,
re
.
S
)
slide_list
=
getSlideList
(
document_content
)
for
slide
in
slide_list
:
if
getDetails
(
slide
)
is
True
:
...
...
@@ -186,6 +210,47 @@ if document_output_type == "content":
document_content
)
# handouts
if
document_output_type
==
"details"
:
return
"""
<!Doctype html>
<html class="ci-%s">
<head>
<meta charset="utf-8">
<title>%s</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<!-- fonts -->
<link rel="stylesheet" href="roboto/roboto.css" />
<link rel="stylesheet" href="roboto/roboto-condensed.css" />
<link rel="stylesheet" href="css/theme/white_custom.css?portal_skin=CI_slideshow" id="theme" />
<link rel="stylesheet" href="css/custom.css?portal_skin=CI_slideshow" />
<link rel="stylesheet" href="lib/css/zenburn.css?portal_skin=CI_slideshow" />
<link rel="stylesheet" href="css/custom_pdf.css?portal_skin=CI_slideshow" />
<link rel="stylesheet" href="css/custom_wkhtmltopdf.css?portal_skin=CI_slideshow" />
</head>
<body class="ci-presentation ci-handout">
<!-- <div class="reveal">
<div class="slides"> -->
<section>
<h1>Notes</h1>
</section>
%s
<!-- </div>
</div> -->
</body>
</html>
"""
%
(
document_theme
,
document_title
,
#document_content
removeSlidesWithoutDetailsFromNotes
(
document_content
)
)
# DEFAULT WebPage_viewAsWeb
return
"""
...
...
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom.css.css
View file @
745f70e1
...
...
@@ -55,12 +55,6 @@ html .ci-presentation ul {
html
.ci-presentation
ul
li
{
font-size
:
1.5em
;
}
html
.ci-presentation
details
ul
{
margin-top
:
5%
;
}
html
.ci-presentation
details
ul
li
{
font-size
:
100%
;
}
html
.ci-presentation
img
+
ul
,
html
.ci-presentation
div
+
ul
{
margin
:
0
;
...
...
@@ -89,6 +83,20 @@ html .ci-presentation li code pre {
font-size
:
100%
;
}
/* details */
html
.ci-presentation
details
{
text-align
:
justify
;
-moz-text-align-last
:
left
;
text-align-last
:
left
;
}
html
.ci-presentation
details
ul
{
margin-top
:
5%
;
}
html
.ci-presentation
details
ul
li
{
font-size
:
100%
;
}
/* footer */
html
.ci-presentation
.ci-presentation-footer
{
position
:
absolute
;
...
...
@@ -123,10 +131,11 @@ html .ci-presentation .ci-presentation-container-right {
/* introductory slide */
html
.ci-presentation
.ci-presentation-intro.present
{
width
:
100%
;
height
:
80%
;
height
:
96%
!important
;
padding
:
0
.5em
;
top
:
0
!important
;
/* overwrite reveal-js */
}
html
.ci-presentation
.ci-presentation-intro.present
>
h2
{
width
:
100%
;
}
...
...
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.css
0 → 100644
View file @
745f70e1
/* ========================================================================== */
/* CSS ci_presentation - wkhtmltopdf specific */
/* ========================================================================== */
/* NOTES ON OPTIONS */
/*
margin-bottom 8 show half, margin-bottom: 12 show full, but not displayed
reason stuff above is too large
*/
/* details */
.ci-presentation.ci-handout
>
section
:first-child
h1
{
position
:
relative
;
top
:
60mm
;
}
.ci-presentation.ci-handout
section
:not
(
:first-child
)
{
-webkit-transform
:
scale
(
0.4
);
-moz-transform
:
scale
(
0.4
);
-ms-transform
:
scale
(
0.4
);
transform
:
scale
(
0.4
);
-webkit-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
box-sizing
:
border-box
;
margin-left
:
0
;
margin-right
:
0
;
width
:
100%
;
}
/* nothing works in wkhtmltopdf */
.ci-presentation.ci-handout
section
:not
(
:first-child
)
{
/*-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: url(grayscale.svg);
filter: gray;
*/
/* mask: url("https://nexedi.erp5.net/portal_skins/erp5_ci_slideshow/css/grayscale.svg#greyscale"); */
border
:
1px
solid
#a1a1a1
;
-webkit-box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
box-sizing
:
border-box
;
}
.ci-presentation.ci-handout
>
section
{
position
:
relative
;
top
:
-40mm
;
}
.ci-presentation.ci-handout
>
section
section
{
-webkit-transform
:
none
;
-moz-transform
:
none
;
-ms-transform
:
none
;
transform
:
none
;
width
:
inherit
;
}
.ci-presentation.ci-handout
section
{
height
:
initial
;
}
.ci-presentation.ci-handout
section
img
{
position
:
relative
;
top
:
-20mm
;
max-width
:
80%
;
}
.ci-presentation.ci-handout
section
pre
{
max-width
:
90%
;
margin
:
0
auto
;
background
:
#F0F0F0
;
}
.ci-presentation.ci-handout
details
{
display
:
block
;
-webkit-transform
:
scale
(
1.5
);
-moz-transform
:
scale
(
1.5
);
-ms-transform
:
scale
(
1.5
);
transform
:
scale
(
1.5
);
}
details
{
color
:
white
;
display
:
block
!important
;
}
summary
::-webkit-details-marker
{
display
:
none
;
}
\ No newline at end of file
bt5/erp5_ci_slideshow/SkinTemplateItem/portal_skins/erp5_ci_slideshow/css/custom_wkhtmltopdf.css.xml
0 → 100644
View file @
745f70e1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
custom_wkhtmltopdf.css
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/css
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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