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
Yusei Tahara
erp5
Commits
4d2cd098
Commit
4d2cd098
authored
Feb 07, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: possible to define custom css and converison parameters
parent
43037d54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
...portal_skins/erp5_corporate_identity/Base_viewAsReport.py
+6
-4
No files found.
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
View file @
4d2cd098
...
@@ -66,6 +66,8 @@ override_document_reference = kw.get('document_reference')
...
@@ -66,6 +66,8 @@ override_document_reference = kw.get('document_reference')
override_document_language
=
kw
.
get
(
'document_language'
)
override_document_language
=
kw
.
get
(
'document_language'
)
override_source_organisation_title
=
kw
.
get
(
'override_source_organisation'
,
None
)
override_source_organisation_title
=
kw
.
get
(
'override_source_organisation'
,
None
)
override_batch_mode
=
kw
.
get
(
'batch_mode'
)
override_batch_mode
=
kw
.
get
(
'batch_mode'
)
css_path
=
kw
.
get
(
'css_path'
,
'template_css/book'
)
conversion_dict
=
kw
.
get
(
'conversion_dict'
,
{})
# we are just caller, so if no dates are passed, the report must decide what to set
# we are just caller, so if no dates are passed, the report must decide what to set
doc_report_start_date_input
=
kw
.
get
(
'start_date'
,
None
)
or
getattr
(
context
.
REQUEST
.
form
,
'start_date'
,
None
)
doc_report_start_date_input
=
kw
.
get
(
'start_date'
,
None
)
or
getattr
(
context
.
REQUEST
.
form
,
'start_date'
,
None
)
...
@@ -155,7 +157,7 @@ doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
...
@@ -155,7 +157,7 @@ doc_full_reference = '-'.join([doc_reference, doc_version, doc_language])
doc_short_date
=
doc_modification_date
.
strftime
(
'%Y-%m-%d'
)
doc_short_date
=
doc_modification_date
.
strftime
(
'%Y-%m-%d'
)
# ------------------------------- Theme ----------------------------------------
# ------------------------------- Theme ----------------------------------------
doc_theme
=
doc
.
Base_getThemeDict
(
doc_format
=
doc_format
,
css_path
=
"template_css/book"
,
skin
=
"Book"
)
doc_theme
=
doc
.
Base_getThemeDict
(
doc_format
=
doc_format
,
css_path
=
css_path
,
skin
=
"Book"
)
# --------------------------- Source/Destination -------------------------------
# --------------------------- Source/Destination -------------------------------
doc_source
=
doc
.
Base_getSourceDict
(
doc_source
=
doc
.
Base_getSourceDict
(
override_source_person_title
=
None
,
override_source_person_title
=
None
,
...
@@ -259,8 +261,7 @@ if doc_format == "pdf":
...
@@ -259,8 +261,7 @@ if doc_format == "pdf":
xsl_style_sheet_data
=
blank
xsl_style_sheet_data
=
blank
embedded_html_data
=
doc
.
Base_convertHtmlToSingleFile
(
doc_content
,
allow_script
=
True
)
embedded_html_data
=
doc
.
Base_convertHtmlToSingleFile
(
doc_content
,
allow_script
=
True
)
footer_embedded_html_data
=
doc
.
Base_convertHtmlToSingleFile
(
doc_foot
,
allow_script
=
True
)
footer_embedded_html_data
=
doc
.
Base_convertHtmlToSingleFile
(
doc_foot
,
allow_script
=
True
)
default_conversion_kw
=
dict
(
pdf_file
=
doc
.
Base_cloudoooDocumentConvert
(
embedded_html_data
,
"html"
,
"pdf"
,
conversion_kw
=
dict
(
encoding
=
"utf8"
,
encoding
=
"utf8"
,
margin_top
=
40
,
margin_top
=
40
,
margin_bottom
=
20
,
margin_bottom
=
20
,
...
@@ -272,7 +273,8 @@ if doc_format == "pdf":
...
@@ -272,7 +273,8 @@ if doc_format == "pdf":
footer_html_data
=
b64encode
(
footer_embedded_html_data
),
footer_html_data
=
b64encode
(
footer_embedded_html_data
),
footer_spacing
=
3
,
footer_spacing
=
3
,
)
)
)
default_conversion_kw
.
update
(
conversion_dict
)
pdf_file
=
doc
.
Base_cloudoooDocumentConvert
(
embedded_html_data
,
"html"
,
"pdf"
,
conversion_kw
=
default_conversion_kw
)
return
doc
.
WebPage_finishPdfCreation
(
return
doc
.
WebPage_finishPdfCreation
(
doc_download
=
doc_download
,
doc_download
=
doc_download
,
...
...
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