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
c5da4558
Commit
c5da4558
authored
Sep 25, 2018
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_corporate_identity: update to using preferences
parent
0c223280
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
146 additions
and
170 deletions
+146
-170
bt5/erp5_corporate_identity/ActionTemplateItem/portal_types/Preference/corporate_identity_style_preferences.xml
...types/Preference/corporate_identity_style_preferences.xml
+83
-0
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_css_color_swatch_property.xml
...corporate_identity_template_css_color_swatch_property.xml
+0
-46
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_report_css_property.xml
...erred_corporate_identity_template_report_css_property.xml
+1
-3
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_report_js_property.xml
...ferred_corporate_identity_template_report_js_property.xml
+2
-4
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_id_property.xml
...orate_identity_template_site_registration_id_property.xml
+1
-1
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_url_property.xml
...rate_identity_template_site_registration_url_property.xml
+1
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getSourceDict.py
...ortal_skins/erp5_corporate_identity/Base_getSourceDict.py
+11
-8
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.py
...kins/erp5_corporate_identity/Base_getTemplateParameter.py
+0
-19
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.xml
...ins/erp5_corporate_identity/Base_getTemplateParameter.xml
+0
-62
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
...erp5_corporate_identity/Base_getTemplateProxyParameter.py
+10
-2
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getThemeDict.py
...portal_skins/erp5_corporate_identity/Base_getThemeDict.py
+16
-12
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
...portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
+2
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
...portal_skins/erp5_corporate_identity/Base_viewAsReport.py
+8
-5
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
...ortal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
+4
-3
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLeaflet.py
...al_skins/erp5_corporate_identity/WebPage_viewAsLeaflet.py
+2
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsRelease.py
...al_skins/erp5_corporate_identity/WebPage_viewAsRelease.py
+2
-1
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
..._skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
+2
-1
bt5/erp5_corporate_identity/bt/template_action_path_list
bt5/erp5_corporate_identity/bt/template_action_path_list
+1
-0
No files found.
bt5/erp5_corporate_identity/ActionTemplateItem/portal_types/Preference/corporate_identity_style_preferences.xml
0 → 100644
View file @
c5da4558
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ActionInformation"
module=
"Products.CMFCore.ActionInformation"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/object_view
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
category
</string>
</key>
<value>
<string>
object_view
</string>
</value>
</item>
<item>
<key>
<string>
condition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Default parameters (theme, css-files, js-files) for template configuration.
</string>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
corporate_identity_style_preferences
</string>
</value>
</item>
<item>
<key>
<string>
permissions
</string>
</key>
<value>
<tuple>
<string>
View
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Action Information
</string>
</value>
</item>
<item>
<key>
<string>
priority
</string>
</key>
<value>
<float>
51.0
</float>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Template Defaults
</string>
</value>
</item>
<item>
<key>
<string>
visible
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Expression"
module=
"Products.CMFCore.Expression"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
text
</string>
</key>
<value>
<string>
string:${object_url}/Preference_viewCorporateIdentityStyle
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_css_color_swatch_property.xml
deleted
100644 → 0
View file @
0c223280
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/string
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
List of 3 color swatches to be used in (Gantt) report generation.
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_corporate_identity_template_css_color_swatch_property
</string>
</value>
</item>
<item>
<key>
<string>
multivalued
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
<item>
<key>
<string>
preference
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
property_default
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_report_css_property.xml
View file @
c5da4558
...
@@ -36,9 +36,7 @@
...
@@ -36,9 +36,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
property_default
</string>
</key>
<key>
<string>
property_default
</string>
</key>
<value>
<value>
<string>
python: []
</string>
</value>
<none/>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_report_js_property.xml
View file @
c5da4558
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<key>
<string>
categories
</string>
</key>
<key>
<string>
categories
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
elementary_type/
string
</string>
<string>
elementary_type/
lines
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
@@ -36,9 +36,7 @@
...
@@ -36,9 +36,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
property_default
</string>
</key>
<key>
<string>
property_default
</string>
</key>
<value>
<value>
<string>
python: []
</string>
</value>
<none/>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_
miibeian_
id_property.xml
→
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_id_property.xml
View file @
c5da4558
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_corporate_identity_template_site_registration_
miibeian_
id_property
</string>
</value>
<value>
<string>
preferred_corporate_identity_template_site_registration_id_property
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
portal_type
</string>
</key>
...
...
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_
miibeian_
url_property.xml
→
bt5/erp5_corporate_identity/PropertySheetTemplateItem/portal_property_sheets/CorporateIdentityTemplatePreference/preferred_corporate_identity_template_site_registration_url_property.xml
View file @
c5da4558
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
preferred_corporate_identity_template_site_registration_
miibeian_
url_property
</string>
</value>
<value>
<string>
preferred_corporate_identity_template_site_registration_url_property
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
portal_type
</string>
</key>
<key>
<string>
portal_type
</string>
</key>
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getSourceDict.py
View file @
c5da4558
...
@@ -16,11 +16,12 @@ from Products.PythonScripts.standard import html_quote
...
@@ -16,11 +16,12 @@ from Products.PythonScripts.standard import html_quote
# ------------------------------- Set Source ----------------------------------
# ------------------------------- Set Source ----------------------------------
source_logo_url
=
None
source_logo_url
=
None
default_bank_account_relative_url
=
context
.
Base_getTemplateParameter
(
"default_bank_account_relative_url"
)
source_organisation
=
None
source_organisation
=
None
pref
=
context
.
getPortalObject
().
portal_preferences
default_bank_account_relative_url
=
pref
.
getPreferredCorporateIdentityTemplateDefaultBankAccountRelativeUrl
()
if
source
is
None
:
if
source
is
None
:
default_company_relative_url
=
context
.
Base_getTemplateParameter
(
"default_company_relative_url"
)
default_company_relative_url
=
pref
.
getPreferredCorporateIdentityTemplateDefaultOrganisationRelativeUrl
(
)
contributor_title_string
=
blank
contributor_title_string
=
blank
source_person
=
None
source_person
=
None
source_person_list
=
[]
source_person_list
=
[]
...
@@ -80,21 +81,23 @@ if default_bank_account_relative_url is not None:
...
@@ -80,21 +81,23 @@ if default_bank_account_relative_url is not None:
source
[
"bic"
]
=
override_bank_account
.
get
(
"bic"
)
source
[
"bic"
]
=
override_bank_account
.
get
(
"bic"
)
source
[
"iban"
]
=
override_bank_account
.
get
(
"iban"
)
source
[
"iban"
]
=
override_bank_account
.
get
(
"iban"
)
# social media
# social media
, used for website (WIP)
if
source_organisation
is
not
None
:
if
source_organisation
is
not
None
:
source
[
"social_media_handle_facebook"
]
=
context
.
Base_getTemplateParameter
(
'social_media_handle_facebook'
)
source
[
"social_media_handle_facebook"
]
=
pref
.
getPreferredCorporateIdentityTemplateSocialMediaHandleFacebook
()
source
[
"social_media_handle_twitter"
]
=
context
.
Base_getTemplateParameter
(
'social_media_handle_twitter'
)
source
[
"social_media_handle_twitter"
]
=
pref
.
getPreferredCorporateIdentityTemplateSocialMediaHandleTwitter
()
source
[
"social_media_handle_google"
]
=
context
.
Base_getTemplateParameter
(
'social_media_handle_google'
)
source
[
"social_media_handle_google"
]
=
pref
.
getPreferredCorporateIdentityTemplateSocialMediaHandleGoogle
()
source
[
"site_registration_url"
]
=
pref
.
getPreferredCorporateIdentityTemplateSiteRegistrationUrl
()
source
[
"site_registration_id"
]
=
pref
.
getPreferredCorporateIdentityTemplateSiteRegistrationId
()
# social capital currency and registered court fallbacks
# social capital currency and registered court fallbacks
if
source
.
get
(
"social_capital_currency"
)
is
blank
:
if
source
.
get
(
"social_capital_currency"
)
is
blank
:
currency_short_title
=
None
currency_short_title
=
None
currency_relative_url
=
context
.
Base_getTemplateParameter
(
"default_source_company_capital_currency_relative_url"
)
currency_relative_url
=
pref
.
getPreferredCorporateIdentityTemplateDefaultCurrencyRelativeUrl
(
)
if
currency_relative_url
:
if
currency_relative_url
:
currency_short_title
=
context
.
restrictedTraverse
(
currency_relative_url
).
getShortTitle
()
currency_short_title
=
context
.
restrictedTraverse
(
currency_relative_url
).
getShortTitle
()
source
[
"social_capital_currency"
]
=
currency_short_title
or
""
source
[
"social_capital_currency"
]
=
currency_short_title
or
""
if
source
.
get
(
"corporate_registration_code"
)
is
blank
:
if
source
.
get
(
"corporate_registration_code"
)
is
blank
:
source
[
"corporate_registration_code"
]
=
context
.
Base_getTemplateParameter
(
"default_source_registered_court"
)
source
[
"corporate_registration_code"
]
=
pref
.
getPreferredCorporateIdentityTemplateDefaultOrganisationRegisteredCourt
(
)
# XXX images stored on organisation (as do images in skin folders)
# XXX images stored on organisation (as do images in skin folders)
if
override_logo_reference
:
if
override_logo_reference
:
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.py
deleted
100644 → 0
View file @
0c223280
"""
================================================================================
Return template parameters from portal-preferences (all calls go through here)
================================================================================
"""
# parameters:
# ------------------------------------------------------------------------------
# parameter Parameter to lookup
pref
=
context
.
getPortalObject
().
portal_preferences
if
parameter
==
"default_company_relative_url"
:
return
pref
.
getPreferredCorporateIdentityTemplateDefaultOrganisationRelativeUrl
()
if
parameter
==
"default_theme"
:
return
pref
.
getPreferredCorporateIdentityTemplateDefaultTheme
()
if
parameter
==
"default_theme_css_url"
:
return
pref
.
getPreferredCorporateIdentityTemplateThemeCssRelativeUrl
()
if
parameter
==
"fallback_image"
:
return
pref
.
getPreferredCorporateIdentityTemplateFallbackLogoRelativeUrl
()
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateParameter.xml
deleted
100644 → 0
View file @
0c223280
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
parameter=None, source_data=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_getTemplateParameter
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getTemplateProxyParameter.py
View file @
c5da4558
...
@@ -290,11 +290,19 @@ if pass_parameter is not None and pass_source_data is not None:
...
@@ -290,11 +290,19 @@ if pass_parameter is not None and pass_source_data is not None:
return
populateBankDict
([
context
.
restrictedTraverse
(
pass_source_data
)])
return
populateBankDict
([
context
.
restrictedTraverse
(
pass_source_data
)])
# ------------------ Theme Logo (Prefix + Theme) -----------------------------
# ------------------ Theme Logo (Prefix + Theme) -----------------------------
# returns [{logo_dict}] used in themes
# returns [{logo_dict}] used in themes, needs to be language-agnostic, but not
# all contexts (eg sale-order) have language
# XXX improve
if
pass_parameter
==
"logo"
:
if
pass_parameter
==
"logo"
:
try
:
use_language
=
context
.
getLanguage
()
or
"en"
except
AttributeError
:
use_language
=
"en"
return
populateImageDict
(
portal_object
.
portal_catalog
(
return
populateImageDict
(
portal_object
.
portal_catalog
(
portal_type
=
"Image"
,
portal_type
=
"Image"
,
language
=
context
.
getLanguage
()
or
'en'
,
language
=
use_language
,
validation_state
=
validation_state
,
validation_state
=
validation_state
,
reference
=
pass_source_data
reference
=
pass_source_data
))
))
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_getThemeDict.py
View file @
c5da4558
...
@@ -14,9 +14,7 @@ blank = ''
...
@@ -14,9 +14,7 @@ blank = ''
# XXX images in portal_skins folders don't convert with ?params. Only format
# XXX images in portal_skins folders don't convert with ?params. Only format
# is kept in Base_convertHtmlToSingleFile
# is kept in Base_convertHtmlToSingleFile
pdf
=
".pdf.css"
if
doc_format
==
"pdf"
else
".css"
pdf
=
".pdf.css"
if
doc_format
==
"pdf"
else
".css"
css
=
"default_theme_css_url"
pref
=
context
.
getPortalObject
().
portal_preferences
font
=
"default_theme_font_css_url_list"
param
=
"?format=png"
# theme content might not be visible on the default View
# theme content might not be visible on the default View
lookup_skin
=
blank
lookup_skin
=
blank
...
@@ -28,32 +26,38 @@ theme_logo_dict = {}
...
@@ -28,32 +26,38 @@ theme_logo_dict = {}
theme_reference
=
None
theme_reference
=
None
theme
=
(
theme
=
(
context
.
Base_getTemplateProxyParameter
(
parameter
=
"theme"
,
source_data
=
None
)
or
context
.
Base_getTemplateProxyParameter
(
parameter
=
"theme"
,
source_data
=
None
)
or
context
.
Base_getTemplateParameter
(
"default_theme"
)
pref
.
getPreferredCorporateIdentityTemplateDefaultTheme
(
)
)
)
if
theme
is
not
None
:
if
theme
is
not
None
:
theme
=
theme
.
lower
()
theme
=
theme
.
lower
()
theme_logo_prefix
=
context
.
Base_getTemplateParameter
(
"default_logo_prefix"
)
theme_logo_prefix
=
pref
.
getPreferredCorporateIdentityTemplateDefaultLogoPrefix
(
)
if
theme_logo_prefix
:
if
theme_logo_prefix
:
theme_reference
=
theme_logo_prefix
+
theme
.
capitalize
()
theme_reference
=
theme_logo_prefix
+
theme
.
capitalize
()
theme_logo_list
=
context
.
Base_getTemplateProxyParameter
(
parameter
=
"logo"
,
source_data
=
theme_reference
)
or
[]
theme_logo_list
=
context
.
Base_getTemplateProxyParameter
(
parameter
=
"logo"
,
source_data
=
theme_reference
)
or
[]
if
len
(
theme_logo_list
)
>
0
:
if
len
(
theme_logo_list
)
>
0
:
theme_logo_dict
=
theme_logo_list
[
0
]
theme_logo_dict
=
theme_logo_list
[
0
]
theme_dict
=
{}
theme_dict
=
{}
theme_logo_url
=
pref
.
getPreferredCorporateIdentityTemplateFallbackLogoRelativeUrl
()
theme_dict
[
"theme"
]
=
theme
theme_dict
[
"theme"
]
=
theme
theme_dict
[
"theme_logo_description"
]
=
theme_logo_dict
.
get
(
"description"
,
blank
)
theme_dict
[
"theme_logo_description"
]
=
theme_logo_dict
.
get
(
"description"
,
blank
)
theme_dict
[
"theme_logo_url"
]
=
context
.
Base_getTemplateParameter
(
"fallback_image"
)
theme_dict
[
"theme_logo_url"
]
=
theme_logo_url
# if a theme logo is available, use it instead and add format=png (note, image
# conversion doesn't seem to work with files loaded from skins folders)
if
theme_logo_dict
.
get
(
"relative_url"
,
None
)
is
not
None
:
if
theme_logo_dict
.
get
(
"relative_url"
,
None
)
is
not
None
:
theme_dict
[
"theme_logo_url"
]
=
theme_logo_dict
.
get
(
"relative_url"
)
+
param
theme_dict
[
"theme_logo_url"
]
=
theme_logo_dict
.
get
(
"relative_url"
)
+
"?format=png"
theme_dict
[
"template_css_url"
]
=
css_path
+
pdf
theme_dict
[
"template_css_url"
]
=
css_path
+
pdf
theme_dict
[
"fallback_img_url"
]
=
context
.
Base_getTemplateParameter
(
"fallback_image"
)
or
blank
theme_dict
[
"fallback_img_url"
]
=
theme_logo_url
or
blank
theme_dict
[
"theme_css_font_list"
]
=
[]
theme_dict
[
"theme_css_font_list"
]
=
[]
theme_font_list
=
context
.
Base_getTemplateParameter
(
font
)
or
[]
theme_font_list
=
pref
.
getPreferredCorporateIdentityTemplateDefaultThemeFontList
(
)
or
[]
for
font
in
theme_font_list
:
for
font
in
theme_font_list
:
theme_dict
[
"theme_css_font_list"
].
append
(
font
+
pdf
)
theme_dict
[
"theme_css_font_list"
].
append
(
font
+
pdf
)
theme_css_url
=
context
.
Base_getTemplateParameter
(
css
)
theme_css_url
=
pref
.
getPreferredCorporateIdentityTemplateThemeCssRelativeUrl
(
)
if
theme_css_url
:
if
theme_css_url
:
theme_dict
[
"theme_css_url"
]
=
context
.
Base_getTemplateParameter
(
css
)
+
lookup_skin
theme_dict
[
"theme_css_url"
]
=
theme_css_url
+
lookup_skin
else
:
else
:
theme_dict
[
"theme_css_url"
]
=
blank
theme_dict
[
"theme_css_url"
]
=
blank
return
theme_dict
return
theme_dict
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsLetter.py
View file @
c5da4558
...
@@ -30,6 +30,7 @@ import re
...
@@ -30,6 +30,7 @@ import re
from
base64
import
b64encode
from
base64
import
b64encode
blank
=
''
blank
=
''
pref
=
context
.
getPortalObject
().
portal_preferences
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
letter
=
context
letter
=
context
...
@@ -50,7 +51,7 @@ override_batch_mode = kw.get('batch_mode', None)
...
@@ -50,7 +51,7 @@ override_batch_mode = kw.get('batch_mode', None)
# -------------------------- Document Parameters ------------------------------
# -------------------------- Document Parameters ------------------------------
letter_portal_type
=
letter
.
getPortalType
()
letter_portal_type
=
letter
.
getPortalType
()
letter_relative_url
=
letter
.
getRelativeUrl
()
letter_relative_url
=
letter
.
getRelativeUrl
()
letter_prefix
=
"Letter."
letter_prefix
=
pref
.
getPreferredCorporateIdentityTemplateLetterDocumentPrefix
()
or
"Letter."
# letter can be Web Page or Event created in Ticket module
# letter can be Web Page or Event created in Ticket module
if
letter_portal_type
==
"Web Page"
:
if
letter_portal_type
==
"Web Page"
:
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/Base_viewAsReport.py
View file @
c5da4558
...
@@ -39,12 +39,15 @@ from Products.PythonScripts.standard import html_quote
...
@@ -39,12 +39,15 @@ from Products.PythonScripts.standard import html_quote
from
base64
import
b64encode
from
base64
import
b64encode
blank
=
''
blank
=
''
pref
=
context
.
getPortalObject
().
portal_preferences
# ------------------ HTML cleanup/converter methods ----------------------------
# ------------------ HTML cleanup/converter methods ----------------------------
def
translateText
(
snip
):
def
translateText
(
snip
):
return
doc_localiser
.
erp5_ui
.
gettext
(
snip
,
lang
=
doc_language
).
encode
(
'utf-8'
).
strip
()
return
doc_localiser
.
erp5_ui
.
gettext
(
snip
,
lang
=
doc_language
).
encode
(
'utf-8'
).
strip
()
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
doc
=
context
doc
=
context
doc_prefix
=
pref
.
getPreferredCorporateIdentityTemplateReportDocumentPrefix
()
or
"Report."
doc_download
=
None
#XXX not yet implemented
doc_download
=
None
#XXX not yet implemented
doc_save
=
int
(
kw
.
get
(
'document_save'
)
or
0
)
doc_save
=
int
(
kw
.
get
(
'document_save'
)
or
0
)
doc_display_header
=
int
(
kw
.
get
(
'display_header'
)
or
0
)
doc_display_header
=
int
(
kw
.
get
(
'display_header'
)
or
0
)
...
@@ -124,7 +127,7 @@ if doc_language is not None:
...
@@ -124,7 +127,7 @@ if doc_language is not None:
if
doc_language
is
None
:
if
doc_language
is
None
:
doc_language
=
blank
doc_language
=
blank
if
doc_reference
==
blank
:
if
doc_reference
==
blank
:
doc_reference
=
"Report."
+
doc_title
.
replace
(
" "
,
"."
)
doc_reference
=
doc_prefix
+
doc_title
.
replace
(
" "
,
"."
)
doc_full_reference
=
'-'
.
join
([
doc_reference
,
doc_version
,
doc_language
])
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'
)
...
@@ -154,8 +157,8 @@ if doc_format == "html":
...
@@ -154,8 +157,8 @@ if doc_format == "html":
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_logo_url
=
doc
.
Base_setUrl
(
path
=
doc_source
.
get
(
"enhanced_logo_url"
),
display
=
None
),
book_logo_url
=
doc
.
Base_setUrl
(
path
=
doc_source
.
get
(
"enhanced_logo_url"
),
display
=
None
),
book_logo_title
=
doc_source
.
get
(
"theme_logo_description"
),
book_logo_title
=
doc_source
.
get
(
"theme_logo_description"
),
book_report_css_list
=
doc
.
Base_getTemplateParameter
(
"report_css_list"
)
or
[],
book_report_css_list
=
pref
.
getPreferredCorporateIdentityTemplateReportCssList
(
)
or
[],
book_report_js_list
=
doc
.
Base_getTemplateParameter
(
"report_js_list"
)
or
[],
book_report_js_list
=
pref
.
getPreferredCorporateIdentityTemplateReportJsList
(
)
or
[],
book_short_title
=
doc_short_title
,
book_short_title
=
doc_short_title
,
book_reference
=
doc_reference
,
book_reference
=
doc_reference
,
book_revision
=
doc_revision
,
book_revision
=
doc_revision
,
...
@@ -190,8 +193,8 @@ if doc_format == "pdf":
...
@@ -190,8 +193,8 @@ if doc_format == "pdf":
book_theme_css_font_list
=
doc_theme
.
get
(
"theme_css_font_list"
),
book_theme_css_font_list
=
doc_theme
.
get
(
"theme_css_font_list"
),
book_theme_css_url
=
doc_theme
.
get
(
"theme_css_url"
),
book_theme_css_url
=
doc_theme
.
get
(
"theme_css_url"
),
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_template_css_url
=
doc_theme
.
get
(
"template_css_url"
),
book_report_css_list
=
doc
.
Base_getTemplateParameter
(
"report_css_list"
)
or
[],
book_report_css_list
=
pref
.
getPreferredCorporateIdentityTemplateReportCssList
(
)
or
[],
book_report_js_list
=
doc
.
Base_getTemplateParameter
(
"report_js_list"
)
or
[],
book_report_js_list
=
pref
.
getPreferredCorporateIdentityTemplateReportJsList
(
)
or
[],
book_content
=
doc_content
,
book_content
=
doc_content
,
)
)
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsBook.py
View file @
c5da4558
...
@@ -38,6 +38,7 @@ from Products.PythonScripts.standard import html_quote
...
@@ -38,6 +38,7 @@ from Products.PythonScripts.standard import html_quote
from
base64
import
b64encode
from
base64
import
b64encode
blank
=
''
blank
=
''
pref
=
context
.
getPortalObject
().
portal_preferences
# ------------------ HTML cleanup/converter methods ----------------------------
# ------------------ HTML cleanup/converter methods ----------------------------
def
translateText
(
snip
):
def
translateText
(
snip
):
...
@@ -69,7 +70,7 @@ override_batch_mode = kw.get('batch_mode')
...
@@ -69,7 +70,7 @@ override_batch_mode = kw.get('batch_mode')
# -------------------------- Document Parameters ------------------------------
# -------------------------- Document Parameters ------------------------------
book_localiser
=
book
.
getPortalObject
().
Localizer
book_localiser
=
book
.
getPortalObject
().
Localizer
book_relative_url
=
book
.
getRelativeUrl
()
book_relative_url
=
book
.
getRelativeUrl
()
book_prefix
=
"Book."
book_prefix
=
pref
.
getPreferredCorporateIdentityTemplateBookDocumentPrefix
()
or
"Book."
book_rendering_fix
=
book
.
WebPage_getPdfOutputRenderingFix
()
or
blank
book_rendering_fix
=
book
.
WebPage_getPdfOutputRenderingFix
()
or
blank
book_content
=
book
.
getTextContent
()
book_content
=
book
.
getTextContent
()
book_aggregate_list
=
[]
book_aggregate_list
=
[]
...
@@ -143,8 +144,8 @@ if book_include_linked_content:
...
@@ -143,8 +144,8 @@ if book_include_linked_content:
# embed reports
# embed reports
if
book_include_report_content
:
if
book_include_report_content
:
book_report_css_list
=
book
.
Base_getTemplateParameter
(
"report_css_list"
)
or
[]
book_report_css_list
=
pref
.
getPreferredCorporateIdentityTemplateReportCssList
(
)
or
[]
book_report_js_list
=
book
.
Base_getTemplateParameter
(
"report_js_list"
)
or
[]
book_report_js_list
=
pref
.
getPreferredCorporateIdentityTemplateReportJsList
(
)
or
[]
book_content
=
book
.
WebPage_embedReportDocumentList
(
doc_content
=
book_content
,
doc_language
=
book_language
,
doc_format
=
book_format
)
book_content
=
book
.
WebPage_embedReportDocumentList
(
doc_content
=
book_content
,
doc_language
=
book_language
,
doc_format
=
book_format
)
# table of links
# table of links
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsLeaflet.py
View file @
c5da4558
...
@@ -27,6 +27,7 @@ from Products.PythonScripts.standard import html_quote
...
@@ -27,6 +27,7 @@ from Products.PythonScripts.standard import html_quote
from
base64
import
b64encode
from
base64
import
b64encode
blank
=
''
blank
=
''
pref
=
context
.
getPortalObject
().
portal_preferences
# ------------------ HTML cleanup/converter methods ----------------------------
# ------------------ HTML cleanup/converter methods ----------------------------
def
removeLegalesePlaceholders
(
content
):
def
removeLegalesePlaceholders
(
content
):
...
@@ -36,7 +37,7 @@ def removeLegalesePlaceholders(content):
...
@@ -36,7 +37,7 @@ def removeLegalesePlaceholders(content):
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
leaflet
=
context
leaflet
=
context
leaflet_prefix
=
"Leaflet."
leaflet_prefix
=
pref
.
getPreferredCorporateIdentityTemplateLeafletDocumentPrefix
()
or
"Leaflet."
leaflet_format
=
kw
.
get
(
'format'
)
or
'html'
leaflet_format
=
kw
.
get
(
'format'
)
or
'html'
leaflet_display_svg
=
kw
.
get
(
'display_svg'
)
or
"png"
leaflet_display_svg
=
kw
.
get
(
'display_svg'
)
or
"png"
leaflet_download
=
int
(
kw
.
get
(
'document_download'
)
or
0
)
leaflet_download
=
int
(
kw
.
get
(
'document_download'
)
or
0
)
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsRelease.py
View file @
c5da4558
...
@@ -24,6 +24,7 @@ import re
...
@@ -24,6 +24,7 @@ import re
from
base64
import
b64encode
from
base64
import
b64encode
blank
=
''
blank
=
''
pref
=
context
.
getPortalObject
().
portal_preferences
re_tag
=
re
.
compile
(
r'<[^>]+>'
)
re_tag
=
re
.
compile
(
r'<[^>]+>'
)
# ------------------ HTML cleanup/converter methods ----------------------------
# ------------------ HTML cleanup/converter methods ----------------------------
...
@@ -38,7 +39,7 @@ def removeHardcodedAbout(my_content):
...
@@ -38,7 +39,7 @@ def removeHardcodedAbout(my_content):
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
release
=
context
release
=
context
release_prefix
=
"Release."
release_prefix
=
pref
.
getPreferredCorporateIdentityTemplateReleaseDocumentPrefix
()
or
"Release."
release_format
=
kw
.
get
(
'format'
)
or
'html'
release_format
=
kw
.
get
(
'format'
)
or
'html'
release_display_about
=
int
(
kw
.
get
(
'display_about'
)
or
0
)
release_display_about
=
int
(
kw
.
get
(
'display_about'
)
or
0
)
release_display_svg
=
kw
.
get
(
'display_svg'
)
or
"png"
release_display_svg
=
kw
.
get
(
'display_svg'
)
or
"png"
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity/WebPage_viewAsSlideshow.py
View file @
c5da4558
...
@@ -29,6 +29,7 @@ from base64 import b64encode
...
@@ -29,6 +29,7 @@ from base64 import b64encode
blank
=
''
blank
=
''
details_separator
=
'</section><section class="ci-notes-continue"><section><h1>cont.</h1></section>'
details_separator
=
'</section><section class="ci-notes-continue"><section><h1>cont.</h1></section>'
pref
=
context
.
getPortalObject
().
portal_preferences
# ------------------ HTML cleanup/converter methods ----------------------------
# ------------------ HTML cleanup/converter methods ----------------------------
def
getSlideList
(
my_content
):
def
getSlideList
(
my_content
):
...
@@ -148,7 +149,7 @@ def sortContent(my_page_list):
...
@@ -148,7 +149,7 @@ def sortContent(my_page_list):
# -------------------------- Setup ---------------------------------------------
# -------------------------- Setup ---------------------------------------------
doc
=
context
doc
=
context
doc_prefix
=
"Slideshow."
doc_prefix
=
pref
.
getPreferredCorporateIdentityTemplateSlideDocumentPrefix
()
or
"Slideshow."
doc_converted_content
=
None
doc_converted_content
=
None
doc_format
=
kw
.
get
(
'format'
)
or
'html'
doc_format
=
kw
.
get
(
'format'
)
or
'html'
doc_display_notes
=
int
(
kw
.
get
(
'display_note'
)
or
0
)
doc_display_notes
=
int
(
kw
.
get
(
'display_note'
)
or
0
)
...
...
bt5/erp5_corporate_identity/bt/template_action_path_list
View file @
c5da4558
Preference | corporate_identity_style_preferences
Web Page | export_book
Web Page | export_book
Web Page | export_leaflet
Web Page | export_leaflet
Web Page | export_letter
Web Page | export_letter
...
...
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