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
5402c662
Commit
5402c662
authored
Jul 12, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity&test: get firstly last slide through reference
parent
c387f463
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
9 deletions
+38
-9
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
..._skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
+20
-9
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityTemplateList.py
...components/test.erp5.testCorporateIdentityTemplateList.py
+18
-0
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
View file @
5402c662
...
@@ -140,14 +140,24 @@ def removeEmptyDetails(my_content):
...
@@ -140,14 +140,24 @@ def removeEmptyDetails(my_content):
def addLastSlide(my_last_slide):
def addLastSlide(my_last_slide):
# XXXX This condition is not accurate
# XXXX This condition is not accurate
if my_last_slide.count("
<
div
") != 2:
if my_last_slide.count("
<
div
") != 2:
last_slide_relative_url = pref.getPreferredCorporateIdentityTemplateSlideLastSlideRelativeUrl()
last_slide=None
if last_slide_relative_url:
# search first through web reference
# try:
if doc_theme['theme']:
last_slide = doc.restrictedTraverse(last_slide_relative_url)
last_slide_list = context.portal_catalog(
if last_slide is not None:
portal_type='Web Page',
return last_slide.getTextContent()
reference='%s-Marketing.Slideshow.Last.Slide' % doc_theme['theme'].upper(),
#except AttributeError:
limit=1)
# last_slide_content = blank
if last_slide_list:
last_slide=last_slide_list[0]
if not last_slide:
# get default one
last_slide_relative_url = pref.getPreferredCorporateIdentityTemplateSlideLastSlideRelativeUrl()
if last_slide_relative_url:
last_slide = doc.restrictedTraverse(last_slide_relative_url)
if last_slide:
return last_slide.getTextContent()
return blank
return blank
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
...
@@ -169,6 +179,8 @@ override_source_organisation_title = kw.get("override_source_organisation_title"
...
@@ -169,6 +179,8 @@ override_source_organisation_title = kw.get("override_source_organisation_title"
override_batch_mode = kw.get('batch_mode')
override_batch_mode = kw.get('batch_mode')
override_source_person_title = None
override_source_person_title = None
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="
template_css
/
slide
", skin="
Slide
")
# --------------------- Convert any page into a slideshow ----------------------
# --------------------- Convert any page into a slideshow ----------------------
# Note: mileage varies depending on the cleanliness of the HTML page
# Note: mileage varies depending on the cleanliness of the HTML page
if doc_is_slideshow is None:
if doc_is_slideshow is None:
...
@@ -250,7 +262,6 @@ if doc_reference is None:
...
@@ -250,7 +262,6 @@ if doc_reference is None:
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
# --------------------------- Layout Parameters --------------------------------
# --------------------------- Layout Parameters --------------------------------
doc_theme = doc.Base_getThemeDict(doc_format=doc_format, css_path="
template_css
/
slide
", skin="
Slide
")
doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {',
doc_css = ''.join(['.ci-slideshow-intro.present:not(.slide-background):before {',
'content: "
%
s
";' % (doc_theme.get("
theme_logo_description
")),
'content: "
%
s
";' % (doc_theme.get("
theme_logo_description
")),
'background: #FFF url("
%
s
") center no-repeat;' % (doc.Base_setUrl(path=doc_theme.get("
theme_logo_url
"), display="
medium
")),
'background: #FFF url("
%
s
") center no-repeat;' % (doc.Base_setUrl(path=doc_theme.get("
theme_logo_url
"), display="
medium
")),
...
...
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityTemplateList.py
View file @
5402c662
...
@@ -460,6 +460,24 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
...
@@ -460,6 +460,24 @@ class TestCorporateIdentityTemplateList(ERP5TypeTestCase):
)
)
self
.
tic
()
self
.
tic
()
@
changeSkin
(
'Slide'
)
def
test_pdfAddLastSlideThroughReference
(
self
):
self
.
portal
.
web_page_module
.
template_test_last_slide_html
.
edit
(
reference
=
'DEFAULT-Marketing.Slideshow.Last.Slide'
)
self
.
tic
()
self
.
runPdfTestPattern
(
"template_test_convert_to_slideview"
,
"template_test_last_view_bmp"
,
"template_test_image_source_pdf"
,
**
dict
(
page_number
=
4
,
use_skin
=
"Slide"
,
test_method
=
"WebPage_exportAsSlideshow"
,
format
=
"pdf"
)
)
self
.
portal
.
web_page_module
.
template_test_last_slide_html
.
edit
(
reference
=
''
)
self
.
tic
()
@
changeSkin
(
'Slide'
)
@
changeSkin
(
'Slide'
)
def
test_pdfSlideShowForAnonymous
(
self
):
def
test_pdfSlideShowForAnonymous
(
self
):
"""
"""
...
...
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