Commit 11d8f83b authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: set skin priority and remove portal_skin on js/css files in pdf generation

parent 5301c820
......@@ -63,6 +63,97 @@
</tuple>
</value>
</item>
<item>
<key> <string>_content_information</string> </key>
<value>
<dictionary>
<item>
<key> <string>ArtBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>BleedBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>CreationDate</string> </key>
<value> <string>Wed Dec 13 14:53:20 2017</string> </value>
</item>
<item>
<key> <string>Creator</string> </key>
<value> <string>wkhtmltopdf 0.12.4</string> </value>
</item>
<item>
<key> <string>CropBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>Encrypted</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>File size</string> </key>
<value> <string>85424 bytes</string> </value>
</item>
<item>
<key> <string>Form</string> </key>
<value> <string>none</string> </value>
</item>
<item>
<key> <string>JavaScript</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>MediaBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>Optimized</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>PDF version</string> </key>
<value> <string>1.4</string> </value>
</item>
<item>
<key> <string>Page rot</string> </key>
<value> <string>0</string> </value>
</item>
<item>
<key> <string>Page size</string> </key>
<value> <string>595 x 842 pts (A4)</string> </value>
</item>
<item>
<key> <string>Pages</string> </key>
<value> <string>6</string> </value>
</item>
<item>
<key> <string>Producer</string> </key>
<value> <string>Qt 4.8.7</string> </value>
</item>
<item>
<key> <string>Suspects</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Tagged</string> </key>
<value> <string>no</string> </value>
</item>
<item>
<key> <string>Title</string> </key>
<value> <string>Template Test Book</string> </value>
</item>
<item>
<key> <string>TrimBox</string> </key>
<value> <string>0.00 0.00 595.00 842.00</string> </value>
</item>
<item>
<key> <string>UserProperties</string> </key>
<value> <string>no</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13175896.62</string> </value>
<value> <string>ts13243262.18</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>7d9213a49ad7d28c5b8857d1f9831988</string> </value>
<value> <string>905b494f98be2d5032f16855032c07e2</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5771.59231.61559</string> </value>
<value> <string>964.8171.22863.59084</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1513175896.63</float>
<float>1513243262.21</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13176006.36</string> </value>
<value> <string>ts13243298.8</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>be2ee9c4b42e2f881442fc91072de9ab</string> </value>
<value> <string>1b0979d80593089b136ff5aebf4d74c9</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>376644</int> </value>
<value> <int>377276</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.39055.40550</string> </value>
<value> <string>964.8173.7270.45260</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1513176006.38</float>
<float>1513243298.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13176037.79</string> </value>
<value> <string>ts13243317.63</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>6956a880932f729a2a600335190eeabf</string> </value>
<value> <string>48680c430299e5ecd5f71d214e7713ca</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>376644</int> </value>
<value> <int>377276</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.61914.36369</string> </value>
<value> <string>964.8069.23047.26214</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1513176037.8</float>
<float>1513243317.64</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13175935.7</string> </value>
<value> <string>ts13243283.82</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>6c0acf04d6267ddef8f7196d0b89c476</string> </value>
<value> <string>7cfd3e3488232f3fc05b4e0619149494</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.21662.20872</string> </value>
<value> <string>964.8171.65221.64290</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1513175935.7</float>
<float>1513243283.83</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts13176059.47</string> </value>
<value> <string>ts13243342.78</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>034930030b079355049d3e27e3f0b136</string> </value>
<value> <string>cc4206498f5a6ab7578794ca17340c19</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>389774</int> </value>
<value> <int>390386</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5773.50642.31232</string> </value>
<value> <string>964.8069.49956.34508</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1513176059.48</float>
<float>1513243342.79</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5771.61097.26692</string> </value>
<value> <string>964.8171.24634.238</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1513175898.12</float>
<float>1513243265.19</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>597359f1828d7d3435a7d9b3029d71bb</string> </value>
<value> <string>1a62f3dd540afc198f045b4a4b2df3d1</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.40895.870</string> </value>
<value> <string>964.8173.14533.65501</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1513176014.17</float>
<float>1513243300.43</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>597359f1828d7d3435a7d9b3029d71bb</string> </value>
<value> <string>1a62f3dd540afc198f045b4a4b2df3d1</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.63941.56627</string> </value>
<value> <string>964.8069.24986.7509</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1513176040.64</float>
<float>1513243319.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5772.23274.39765</string> </value>
<value> <string>964.8172.8214.30668</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1513175944.93</float>
<float>1513243285.41</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>c0092b40070729b70a5116798f997378</string> </value>
<value> <string>0f3978e8ed96411e315e4675ba7728c1</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5773.57837.16042</string> </value>
<value> <string>964.8069.52288.48981</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1513176060.93</float>
<float>1513243344.23</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5771.21247.20445</string> </value>
<value> <string>964.8170.3461.6212</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1513175842.96</float>
<float>1513243228.27</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5771.32458.28160</string> </value>
<value> <string>964.8170.58091.44100</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1513175868.36</float>
<float>1513243238.19</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>964.5771.40777.12629</string> </value>
<value> <string>964.8171.2067.22254</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1513175877.42</float>
<float>1513243246.59</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -6,12 +6,33 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_corporate_identity</string> </value>
......
......@@ -31,7 +31,7 @@
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>100.0</float> </value>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -31,7 +31,7 @@
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>100.0</float> </value>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -31,7 +31,7 @@
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>100.0</float> </value>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -31,7 +31,7 @@
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>100.0</float> </value>
<value> <float>50.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -23,12 +23,12 @@ Creates the Slideshow content section.
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css?portal_skin=Slide'" />
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" />
</tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css?portal_skin=Slide" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css?portal_skin=Slide" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, ''])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, ''])" />
</head>
<body class="ci-slideshow">
<tal:block metal:use-macro="context/WebPage_createSlideshowContent/macros/slide_content" />
......
......@@ -23,12 +23,12 @@ Creates the Slideshow cover section.
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css?portal_skin=Slide'" />
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" />
</tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css?portal_skin=Slide" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css?portal_skin=Slide" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, ''])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, ''])" />
<style type="text/css" tal:content="doc_css"></style>
</head>
<body class="ci-slideshow">
......
......@@ -27,12 +27,12 @@ Creates the Slideshow footer section.
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css?portal_skin=Slide'" />
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" />
</tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css?portal_skin=Slide" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css?portal_skin=Slide" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, ''])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, ''])" />
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......
......@@ -23,12 +23,12 @@ Creates the Slideshow note section.
<link rel="stylesheet" tal:attributes="href font_url" />
</tal:block>
<tal:block tal:condition="python: doc_format == 'html'">
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css?portal_skin=Slide'" />
<link rel="stylesheet" tal:attributes="href python: 'slide_css/reveal.custom.css'" />
</tal:block>
<link rel="stylesheet" href="slide_css/white_theme.custom.css?portal_skin=Slide" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css?portal_skin=Slide" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, '?portal_skin=Slide'])" />
<link rel="stylesheet" href="slide_css/white_theme.custom.css" id="theme" />
<link rel="stylesheet" href="slide_css/zenburn.css" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_theme_css_url, ''])" />
<link rel="stylesheet" tal:attributes="href python: ''.join([doc_template_css_url, ''])" />
</head>
<body class="ci-slideshow-handout">
<tal:block metal:use-macro="context/WebPage_createSlideshowNotes/macros/slide_notes" />
......
......@@ -40,26 +40,26 @@ import base64
host_url = r"https?://localhost(?::[0-9]+)?/[^/]+/"
test_url = "https://softinst73908.host.vifib.net/erp5/"
def setDomainDict(script_id, script_param, script_code):
def wrapper(func):
@functools.wraps(func)
def wrapped(self, *args, **kwargs):
if script_id in self.portal.portal_skins.custom.objectIds():
raise ValueError('Precondition failed: %s exists in custom' % script_id)
createZODBPythonScript(
self.portal.portal_skins.custom,
script_id,
script_param,
script_code,
)
try:
func(self, *args, **kwargs)
finally:
if script_id in self.portal.portal_skins.custom.objectIds():
self.portal.portal_skins.custom.manage_delObjects(script_id)
transaction.commit()
return wrapped
return wrapper
#def setDomainDict(script_id, script_param, script_code):
# def wrapper(func):
# @functools.wraps(func)
# def wrapped(self, *args, **kwargs):
# if script_id in self.portal.portal_skins.custom.objectIds():
# raise ValueError('Precondition failed: %s exists in custom' % script_id)
# createZODBPythonScript(
# self.portal.portal_skins.custom,
# script_id,
# script_param,
# script_code,
# )
# try:
# func(self, *args, **kwargs)
# finally:
# if script_id in self.portal.portal_skins.custom.objectIds():
# self.portal.portal_skins.custom.manage_delObjects(script_id)
# transaction.commit()
# return wrapped
# return wrapper
def changeSkin(skin_name):
"""
......@@ -149,9 +149,6 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
# - rms is ~1.0 if date is 2017-06-07 vs 2017-06-06 with bmp images
return rms
def isImageRenderingEqual(self, image_data_1, image_data_2, max_rms=10.0):
return self.computeImageRenderingRootMeanSquare(image_data_1, image_data_2) <= max_rms
def convertToPng(self, img_data):
bmp_file = Image.open(io.BytesIO(img_data))
img_buff = cStringIO.StringIO()
......@@ -163,7 +160,7 @@ class TestCorporateIdentityTemplates(ERP5TypeTestCase):
rms = self.computeImageRenderingRootMeanSquare(test_image_data, expected_image_data)
if rms <= max_rms:
return
raise AssertionError("%(message)s\nComparing image:\n%(base64_1)s\nWith image:\n%(base64_2)s\nRMS: %(rms)s > %(max_rms)s\nAssertionError: %(message)s" % {
raise AssertionError("%(message)s\nComparing rendered image:\n%(base64_1)s\nWith expected image:\n%(base64_2)s\nRMS: %(rms)s > %(max_rms)s\nAssertionError: %(message)s" % {
"message": message,
"base64_1": self.convertToPng(test_image_data),
"base64_2": self.convertToPng(expected_image_data),
......
......@@ -43,7 +43,11 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
<tuple>
<string>W: 30, 0: Unused createZODBPythonScript imported from Products.ERP5Type.tests.utils (unused-import)</string>
<string>W: 32, 0: Unused import transaction (unused-import)</string>
<string>W: 33, 0: Unused import functools (unused-import)</string>
</tuple>
</value>
</item>
<item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment