Commit 0c1cf470 authored by Sven Franck's avatar Sven Franck

erp5_corporate_identity: update slideshow and slideshow tests

parent 60591225
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310012.01</string> </value>
<value> <string>ts12554317.38</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>1989493e6839d5f557d8d74e307b7e0f</string> </value>
<value> <string>cf97caf7dce3dac69a926c601f1933d4</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>378385</int> </value>
<value> <int>375399</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.35036.11451</string> </value>
<value> <string>963.62225.40453.40038</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310241.56</float>
<float>1512554317.39</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310274.15</string> </value>
<value> <string>ts11431737.56</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>43db3b3b7b7d265d698eb117bd94657f</string> </value>
<value> <string>8e1ecefbc23d77cab30dcb62ac2c711a</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>380150</int> </value>
<value> <int>377551</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.4391.31095</string> </value>
<value> <string>963.42080.62928.8823</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310274.16</float>
<float>1512554370.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310313.51</string> </value>
<value> <string>ts11431795.07</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>9c03cf629dde17279851cff0a291f61e</string> </value>
<value> <string>f0f6c61a858f026327dadb9898b9fba0</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>382024</int> </value>
<value> <int>377551</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19595.20482.48810</string> </value>
<value> <string>963.42081.60204.26828</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310313.53</float>
<float>1512554384.37</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310027.33</string> </value>
<value> <string>ts11432920.01</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>2e6c4e1acf9ac40bc97788b14433df3a</string> </value>
<value> <string>3978a348b1101fe7e69cc9bddef6aebc</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +125,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>392070</int> </value>
<value> <int>389059</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +282,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.51795.59289</string> </value>
<value> <string>963.42100.43774.6092</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +300,7 @@
</tuple>
<state>
<tuple>
<float>1510310258.11</float>
<float>1512554357.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -39,7 +39,7 @@
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts10310331.56</string> </value>
<value> <string>ts11431833.72</string> </value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
......@@ -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 842.00 595.00</string> </value>
</item>
<item>
<key> <string>BleedBox</string> </key>
<value> <string>0.00 0.00 842.00 595.00</string> </value>
</item>
<item>
<key> <string>CreationDate</string> </key>
<value> <string>Thu Nov 23 11:10:17 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 842.00 595.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>390890 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 842.00 595.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>842 x 595 pts (A4)</string> </value>
</item>
<item>
<key> <string>Pages</string> </key>
<value> <string>14</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 Slideshow</string> </value>
</item>
<item>
<key> <string>TrimBox</string> </key>
<value> <string>0.00 0.00 842.00 595.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>
......@@ -83,7 +174,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>693677d5fab4c61d19689dd52ec4cc80</string> </value>
<value> <string>3f1545b0e18dd872d0d930a953862848</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -125,7 +216,7 @@
</item>
<item>
<key> <string>size</string> </key>
<value> <int>393912</int> </value>
<value> <int>390890</int> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -282,7 +373,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.44997.41745</string> </value>
<value> <string>963.42358.28102.28245</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -300,7 +391,7 @@
</tuple>
<state>
<tuple>
<float>1510310331.56</float>
<float>1512554397.63</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.37170.40925</string> </value>
<value> <string>963.62225.48075.33638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310243.64</float>
<float>1512554324.53</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>22fa93382042ec9a35fa45ecf9748770</string> </value>
<value> <string>51f2363a7945b9146b9a255bc77eba54</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.9418.9489</string> </value>
<value> <string>963.42100.62104.26897</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310279.27</float>
<float>1512554372.6</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -79,7 +79,7 @@
</item>
<item>
<key> <string>content_md5</string> </key>
<value> <string>8c6a2877327c58710f43b3a69860969a</string> </value>
<value> <string>51f2363a7945b9146b9a255bc77eba54</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.27813.44373</string> </value>
<value> <string>963.42101.19457.30378</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310316.58</float>
<float>1512554385.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23385.53316.14967</string> </value>
<value> <string>963.42100.46018.29252</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310259.72</float>
<float>1512554358.96</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -270,7 +270,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.23386.47125.20821</string> </value>
<value> <string>963.42101.40464.53077</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -288,7 +288,7 @@
</tuple>
<state>
<tuple>
<float>1510310333.2</float>
<float>1512554399.17</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -77,7 +77,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>NXD-Template.Slideshow.Nexedi</string> </value>
<value> <string>Template.Slideshow</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -159,7 +159,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Slideshow</string> </value>
<value> <string>Add Slideshow</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -294,7 +294,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.29188.19818.49834</string> </value>
<value> <string>963.29190.19224.30805</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -312,7 +312,7 @@
</tuple>
<state>
<tuple>
<float>1510658264.87</float>
<float>1511349015.17</float>
<string>UTC</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<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_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testAndUpdateTestFilesForSlideTemplate</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -85,9 +85,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
<value> <string>Some description</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......@@ -242,7 +240,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19340.52569.29576</string> </value>
<value> <string>963.20770.57899.51268</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>1510153132.9</float>
<float>1511279847.2</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,8 +37,9 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=xsmall" />
<img alt="Logo" src="common_images/fallback.png" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-right">
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19676.57436.19217</string> </value>
<value> <string>963.62213.44228.42205</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310199.1</float>
<float>1512554172.68</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_001_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,14 +37,16 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=xsmall" />
<img alt="Logo"
src="Template.Test.Image.Logo.Alternativ?format=png&amp;display=small" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-right">
&copy;
<span>2017</span>&nbsp;
<span>Foobarbazbam</span><br />
<span></span><br />
<span></span>&nbsp;
<span class="page"></span> | <span class="topage"></span>
</div>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19677.3600.59101</string> </value>
<value> <string>963.62222.14724.18073</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310212.82</float>
<float>1512554204.3</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -16,7 +16,7 @@
href="default_themes/themes.css?portal_skin=Slide" />
<link rel="stylesheet"
href="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/slide_css/slide.css?portal_skin=Slide" />
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/common_images/fallback.png?format=png&amp;display=small") center no-repeat;background-size: auto 120px;}</style>
<style type="text/css">.ci-slideshow-intro.present:not(.slide-background):before {content: "";background: #FFF url("common_images/fallback.png") center no-repeat;background-size: auto 120px;}</style>
<script type="text/javascript">
function setPlaceholdersWithUrlParameters() {
var vars={};
......@@ -37,14 +37,15 @@
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img alt="Logo"
src="https://softinst73908.host.vifib.net/erp5/web_page_module/template_test_slideshow_input_002_en_html/common_images/fallback.png?format=png&amp;display=xsmall" />
<img alt="Logo" src="common_images/fallback.png" />
</div>
<div class="ci-slideshow-container-center"></div>
<div class="ci-slideshow-container-center">Some description</div>
<div class="ci-slideshow-container-right">
&copy;
<span>2017</span>&nbsp;
<span>Test Organisation</span><br />
<span></span><br />
<span>Test Author, Test Recipient</span>&nbsp;
<span class="page"></span> | <span class="topage"></span>
</div>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.19677.15056.47342</string> </value>
<value> <string>963.62222.28215.59050</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1510310221.55</float>
<float>1512554256.59</float>
<string>UTC</string>
</tuple>
</state>
......
<registered_skin_selection>
<skin_folder_selection>
<skin_folder>erp5_corporate_identity_slide</skin_folder>
<skin_selection>CI,CI_Slideshow,CI_slideshow,Slide,SlideShow,WhiteSlideShow</skin_selection>
<skin_selection>Slide</skin_selection>
</skin_folder_selection>
</registered_skin_selection>
\ No newline at end of file
"""
================================================================================
Create a source dict for filling templates
================================================================================
"""
blank = ''
from Products.PythonScripts.standard import html_quote
# -------------------------- External parameters ------------------------------
# eg "Nexedi" specific parameters
customHandler = getattr(context, "WebPage_getCustomParameter", None)
# parameters common to all templates
commonHandler = getattr(context, "WebPage_getCommonParameter", None)
commonProxyHandler = getattr(context, "WebPage_getCommonProxyParameter", None)
def getCustomParameter(my_parameter, my_override_data):
if customHandler is not None:
source_data = my_override_data or context.getUid()
return customHandler(parameter=my_parameter, source_data=source_data)
def getCommonParameter(my_parameter, my_override_data):
if commonHandler is not None:
source_data = my_override_data or context.getUid()
return commonHandler(parameter=my_parameter, source_data=source_data)
def getCommonProxyParameter(my_parameter, my_override_data):
if commonProxyHandler is not None:
source_data = my_override_data or context.getUid()
return commonProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------------------- Set Source ----------------------------------
if source is None:
contributor_title_string = blank
source_logo_url = None
source_person = None
source_person_list = []
source_organisation = None
source_organisation_list = []
source_organisation_uid = None
# source person
if override_source_person_title is not None or override_source_person_title is blank:
source_person_list = getCommonProxyParameter("override_person", override_source_person_title)
if len(source_person_list) == 0:
source_person_list = getCommonProxyParameter("author", None)
if len(source_person_list) > 0:
source_person = source_person_list[0]
contributor_title_string = ', '.join(x.get("name", blank) for x in source_person_list)
# source organisation
if override_source_organisation_title is not None or override_source_organisation_title is blank:
source_organisation_list = getCommonProxyParameter("override_organisation", override_source_organisation_title)
if len(source_organisation_list) == 0:
source_organisation_uid = getCustomParameter("source_organisation_uid", None)
if source_organisation_uid:
source_organisation_list = getCommonProxyParameter("sender", source_organisation_uid)
if len(source_organisation_list) == 0 and default_company_title:
source_organisation_list = getCommonProxyParameter("override_organisation", html_quote(default_company_title))
if len(source_organisation_list) == 0 and source_person is not None:
source_organisation_list = getCommonProxyParameter("source", source_person.get("uid")) or []
if len(source_organisation_list) > 0:
source_organisation = source_organisation_list[0]
source = {}
source.update(source_person or {})
source.update(source_organisation or {})
source["contributor_title_string"] = contributor_title_string
# source => event
else:
source_uid =context.restrictedTraverse(source).getUid()
source = getCommonProxyParameter("source", source_uid)[0]
# override specific bank account (no default to pick correct one if multiple exist)
if default_bank_account_uid is not None:
override_bank_account_list = getCommonProxyParameter("bank", default_bank_account_uid)
if len(override_bank_account_list) > 0:
override_bank_account = override_bank_account_list[0]
source["bank"] = override_bank_account.get("bank")
source["bic"] = override_bank_account.get("bic")
source["iban"] = override_bank_account.get("iban")
# XXX: logos stored on organisation fail on base_convert or fallback images
# is not found in skin folder base_convert => drop conversion on fallback image
source_logo_url = override_logo_reference or source.get("logo_url", blank)
if source_logo_url != blank:
source_logo_url = html_quote(source_logo_url) + "?format=png&display=small"
if source_logo_url == blank and theme_logo_url is not None:
source_logo_url = theme_logo_url
source["enhanced_logo_url"] = source_logo_url
return source
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None,cancel_url=None, svg_display=None, portal_skin=None,note_display=None, override_publisher_title=None, override_logo_reference=None, *args,**kw</string> </value>
<value> <string>source=None, override_logo_reference=None, override_source_person_title=None, override_source_organisation_title=None, default_company_title=None, default_bank_account_uid=None, theme_logo_url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_updatePrintAsSlideshowDialog</string> </value>
<value> <string>Base_getSourceDict</string> </value>
</item>
</dictionary>
</pickle>
......
"""
================================================================================
Create a theme dict for filling templates
================================================================================
"""
blank = ''
# -------------------------- External parameters ------------------------------
# eg "Nexedi" specific parameters
customHandler = getattr(context, "WebPage_getCustomParameter", None)
# parameters common to all templates
commonHandler = getattr(context, "WebPage_getCommonParameter", None)
commonProxyHandler = getattr(context, "WebPage_getCommonProxyParameter", None)
def getCustomParameter(my_parameter, my_override_data):
if customHandler is not None:
source_data = my_override_data or context.getUid()
return customHandler(parameter=my_parameter, source_data=source_data)
def getCommonParameter(my_parameter, my_override_data):
if commonHandler is not None:
source_data = my_override_data or context.getUid()
return commonHandler(parameter=my_parameter, source_data=source_data)
def getCommonProxyParameter(my_parameter, my_override_data):
if commonProxyHandler is not None:
source_data = my_override_data or context.getUid()
return commonProxyHandler(parameter=my_parameter, source_data=source_data)
# ------------------------------- Set Theme -----------------------------------
# XXX images in portal_skins folders don't convert with ?params. Only format
# is kept in Base_convertHtmlToSingleFile
img = getCommonParameter("fallback_image", blank)
pdf = ".pdf" if format == "pdf" else blank
css = "default_theme_css_url"
font = "default_theme_font_css_url_list"
param = "?display=png"
theme_logo_alt = "Default Logo"
default_company_title = getCustomParameter("default_company_title", None)
theme_logo = None
theme_logo_url = None
theme_logo_description = blank
theme = (
getCommonProxyParameter("theme", None) or
custom_theme or
default_company_title
)
if theme and override_batch_mode:
theme = "default"
if theme is not None:
logo_prefix = getCustomParameter("default_logo_prefix", None)
theme = theme.lower()
if logo_prefix:
theme_logo_url = logo_prefix + theme.capitalize()
try:
theme_logo = context.restrictedTraverse(theme_logo_url)
except LookupError:
theme_logo = None
if theme_logo:
theme_logo_description = theme_logo.getDescription()
if theme is None:
theme = "default"
theme_dict = {}
theme_dict["theme"] = theme
theme_dict["theme_logo_description"] = theme_logo_description
theme_dict["theme_logo_url"] = (theme_logo_url + param) if theme_logo_url is not None else getCommonParameter("fallback_image", None) or blank
theme_dict["template_css_url"] = ''.join([url, css_path, pdf, ".css"])
theme_dict["fallback_img_url"] = ''.join([url, '/', img])
theme_dict["theme_css_font_list"] = getCustomParameter(font, None) or []
theme_dict["theme_css_url"] = getCustomParameter(css, None) or getCommonParameter(css, None) or blank
return theme_dict
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>custom_theme=None, override_batch_mode=None, format=None, css_path=None, url=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_getLocalParameter</string> </value>
<value> <string>Base_getThemeDict</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,6 +2,8 @@ if id is None:
return "Failed. Missing image id."
if context.getPortalType() != "PDF":
return "Failed. Not a pdf."
if context.getId().find("template_test") == -1:
return "Failed. Not a template test item."
pdf_page = context
portal = pdf_page.getPortalObject()
......@@ -14,7 +16,9 @@ preferred_document_conversion_server_url = (
)
try:
system_preference.edit(
preferred_document_conversion_server_url="https://cloudooo.erp5.net/",
preferred_document_conversion_server_url="https://softinst77579.host.vifib.net/",
#https://cloudooo.erp5.net/
#https://softinst77579.host.vifib.net/
)
content_type, bmp_data = pdf_page.convert("bmp", frame=frame)
image = portal.portal_catalog(
......
"""
================================================================================
Save, download or return generated PDF Document
================================================================================
"""
if doc_save == 1:
dms_module = getattr(context, 'document_module', None)
if dms_module is not None:
document = dms_module.newContent(
portal_type="PDF",
version=doc_version,
follow_up=doc_relative_url,
title=doc_title,
language=doc_language,
publication_date=doc_modification_date or None,
reference=doc_reference
)
document.edit(
source_reference=''.join([doc_reference, '.pdf']),
file=doc_pdf_file
)
#context.setAggregateList((doc_aggregate_list or []) + [doc_relative_url])
message = context.Base_translateString(
'%(portal_type)s created successfully as PDF Document.' % {
'portal_type': document.getTranslatedPortalType()
}
)
return document.Base_redirect(
keep_items=dict(portal_status_message=message)
)
#XXX else:
# download
elif doc_download == 1:
context.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'attachment; filename="' + doc_full_reference + '.pdf"')
# display in browser
else:
context.REQUEST.RESPONSE.setHeader("Content-Type", "application/pdf;")
context.REQUEST.RESPONSE.setHeader("Content-Disposition", 'filename="' + doc_full_reference + '.pdf"')
return doc_pdf_file
......@@ -50,11 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id=None, cancel_url=None, format=None, note_display=None, svg_display=None, override_publisher_title=None, override_logo_reference=None, portal_skin=None, *args,**kw</string> </value>
<value> <string>doc_download=None, doc_aggregate_list=None, doc_title=None, doc_save=None, doc_version=None, doc_relative_url=None, doc_language=None, doc_modification_date=None, doc_reference=None, doc_full_reference=None, doc_pdf_file=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_updateExportAsSlideshowDialog</string> </value>
<value> <string>WebPage_finishPdfCreation</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -4,8 +4,47 @@ Return common parameter across all templates
================================================================================
"""
# general parameters
if parameter == "fallback_image":
return "common_images/fallback.png"
if parameter == "default_theme_css_url":
return "default_themes/themes.css"
if parameter == "wkhtmltopdf_rendering_fix":
return
"""
<script>
(function () {
var table_list = document.body.querySelectorAll("table"),
sheet_width_in_px,
div;
if (table_list.length > 0) {
// measure what is the px equivalent for 210mm (A4 210x297mm)
div = document.createElement("div")
div.style.width = "200mm"; // XXX HARDCODED
document.body.appendChild(div);
sheet_width_in_px = div.clientWidth;
document.body.removeChild(div);
// Resize a table by reducing th and td font-size,
// to avoid the table to be larger than the sheet width,
// to avoid global fonts to be reduced.
[].forEach.call(table_list, function (table) {
if (sheet_width_in_px > table.clientWidth) return;
var ratio_percent = Math.floor((sheet_width_in_px / table.clientWidth) * 100);
table.style.width = "100%";
// Select th and td and affect the font-size in percent.
// The CSS should not set the font-size on the table instead of th and td
[].forEach.call(table.querySelectorAll("td"), function (e) {
e.setAttribute("style", "font-size: " + ratio_percent + "%");
});
[].forEach.call(table.querySelectorAll("th"), function (e) {
e.setAttribute("style", "font-size: " + ratio_percent + "%");
});
});
}
}());
</script>
"""
......@@ -50,7 +50,15 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>REQUEST=None, *args, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -14,7 +14,7 @@ img_type = img_obj.getContentType()
# ensure alt attributes are set
if img_string.find('alt=') == -1:
img_string.replace ("src=", 'alt="%s" src=' % img_obj.getTitle())
img_string.replace ("src=", 'alt="%s" src=' % img_caption or img_obj.getTitle())
# force svg display as svg or png
if img_type == "image/svg+xml":
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>img_string=None, img_wrap=None, img_svg_format=None</string> </value>
<value> <string>img_string=None, img_wrap=None, img_svg_format=None, image_caption=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -75,9 +75,10 @@
<value>
<list>
<string>format</string>
<string>note_display</string>
<string>svg_display</string>
<string>display_note</string>
<string>display_svg</string>
<string>portal_skin</string>
<string>document_save</string>
</list>
</value>
</item>
......@@ -86,7 +87,7 @@
<value>
<list>
<string>override_logo_reference</string>
<string>override_publisher_title</string>
<string>override_source_organisation_title</string>
</list>
</value>
</item>
......@@ -127,7 +128,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>WebPage_updateExportAsSlideshowDialog</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>note_display</string> </value>
<value> <string>display_note</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>svg_display</string> </value>
<value> <string>display_svg</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document_save</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_checkbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Save in Document Module</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>override_publisher_title</string> </value>
<value> <string>override_source_organisation_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -74,9 +74,9 @@
<key> <string>left</string> </key>
<value>
<list>
<string>note_display</string>
<string>display_note</string>
<string>portal_skin</string>
<string>svg_display</string>
<string>display_svg</string>
</list>
</value>
</item>
......@@ -85,7 +85,7 @@
<value>
<list>
<string>override_logo_reference</string>
<string>override_publisher_title</string>
<string>override_source_organisation_title</string>
</list>
</value>
</item>
......@@ -126,7 +126,7 @@
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string>WebPage_updatePrintAsSlideshowDialog</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
......
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>note_display</string> </value>
<value> <string>display_note</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -19,7 +19,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>svg_display</string> </value>
<value> <string>display_svg</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>override_publisher_title</string> </value>
<value> <string>override_source_organisation_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
/* ========================================================================== */
/* ===================== Font Declarations ================================= */
/* ========================================================================== */
/* fonts are declared in default theme, so any custom themes.css can override */
.ci-letter .ci-letter-header span,
.ci-letter .ci-letter-head-right .ci-letter-timestamp span,
.ci-letter .ci-letter-head-right .ci-letter-page span,
.ci-letter .ci-letter-head .ci-letter-destination span {
font-family: "Roboto", Arial, sans-serif;
font-weight: normal;
}
.ci-letter span,
/*.ci-letter .ci-letter-head table tr td:last-child span, */
/*.ci-letter .ci-letter-head .ci-letter-destination span, */
.ci-letter .ci-letter-body p b i,
.ci-letter .ci-letter-body p,
.ci-letter .ci-letter-body {
font-family: "Heuristica", Helvetica, serif;
font-weight: normal;
}
.ci-letter .ci-letter-head .ci-letter-source span,
.ci-letter .ci-letter-footer table td div span {
font-family: "Roboto Condensed", Arial, sans-serif;
font-weight: normal;
}
.ci-letter .ci-letter-header td span {
font-family: "Roboto Condensed", Arial, sans-serif !important;
font-weight: normal !important;
}
.ci-leaflet p,
.ci-leaflet li {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
.ci-leaflet h1,
.ci-leaflet h2,
.ci-leaflet .ci-leaflet-footer div,
.ci-leaflet-header p,
.ci-leaflet p.ci-leaflet-source-header,
.ci-leaflet p.ci-leaflet-sheet-header,
.ci-leaflet #left-summary p,
.ci-leaflet #left-summary li,
.ci-leaflet #main-content .left-icon .excerpt,
.ci-leaflet #legalese .bottom {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow .ci-slideshow-handout h1,
.ci-slideshow .ci-slideshow-handout h2,
.ci-slideshow .ci-slideshow-intro:before,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
html .ci-slideshow pre,
html .ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
.ci-book * {
font-family: "Heuristica", Helvetica, "Times", serif;
font-weight: normal;
font-style: normal;
}
.ci-book caption {
font-family: "Heuristica", Helvetica, "Times", serif;
font-weight: normal;
font-style: normal !important;
}
.ci-book pre,
.ci-book code {
/* does not load: font-family: "TexGyreCursor", Monospace, Arial; */
font-family: "Roboto", Arial, sans-serif;
font-weight: normal;
font-style: normal;
}
.ci-book strong {
font-weight: bold;
font-style: normal;
}
.ci-book table thead th b,
.ci-book table thead td strong,
.ci-book table tbody td b,
.ci-book table tbody td strong,
.ci-book table tbody td div,
.ci-book table tbody th div,
.ci-book table tbody td span,
.ci-book table tbody th span {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
font-style: normal;
}
/* XXX custom report css */
.ci-book div.ci-book-box-offer div,
.ci-book div.ci-book-box-offer-milestone div {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
}
.ci-book .ci-book-box-offer *,
.ci-book .ci-book-box-offer-milestone * {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif !important;
}
.ci-book .ci-book-footer .ci-book-footer-copy,
.ci-book table th,
.ci-book table th span,
.ci-book table td,
.ci-book table td li,
.ci-book table tbody td p,
.ci-book table tbody td p em,
.ci-book table th a,
.ci-book table td a,
.ci-book table td i {
font-family: "Roboto Condensed", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
}
.ci-book h1,
.ci-book h2,
.ci-book h3,
.ci-book h4,
.ci-book h5,
.ci-book h6,
.ci-book .ci-book-header td div,
.ci-book .ci-book-header .ci-book-header-key,
.ci-book .ci-book-header .ci-book-header-value,
.ci-book .ci-book-header td div span,
.ci-book .ci-book-footer td span,
.ci-book .ci-book-header td div,
.ci-book table td em {
font-family: "Roboto", Arial, 'Noto Sans Sc', SimHei, STXihei, sans-serif;
font-weight: normal;
}
/* ========================================================================== */
/* ======================= Default THEME =================================== */
/* ========================================================================== */
......@@ -69,8 +208,8 @@
transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
}
/* ------------------------- Two Pager ------------------------------------- */
.ci-default .ci-two-page .ci-two-page-header {
/* ------------------------- Leaflet --------------------------------------- */
.ci-default .ci-leaflet .ci-leaflet-header {
background-color: #C3C7C6;
color: #ffffff;
}
......
......@@ -12,7 +12,7 @@ Generates the complete slideshow
doc_template_css_url python: options.get('doc_template_css_url');
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_theme_footer_url python: options.get('doc_theme_footer_url');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
doc_copyright python: options.get('doc_copyright');
......
......@@ -12,7 +12,7 @@ Creates the Slideshow footer section.
doc_theme_css_font_list python: options.get('doc_theme_css_font_list');
doc_theme_css_url python: options.get('doc_theme_css_url');
doc_template_css_url python: options.get('doc_template_css_url');
doc_theme_footer_url python: options.get('doc_theme_footer_url');
doc_footer_url python: options.get('doc_footer_url');
doc_description python: options.get('doc_description');
doc_creation_year python: options.get('doc_creation_year');
doc_copyright python: options.get('doc_copyright');
......@@ -56,7 +56,9 @@ Creates the Slideshow footer section.
<tal:block metal:define-macro="slide_footer">
<div class="ci-slideshow-footer">
<div class="ci-slideshow-container-left">
<img tal:attributes="src python: ''.join([doc_theme_footer_url, '?format=png&amp;display=xsmall'])" alt="Logo" />
<tal:block tal:condition="python: doc_footer_url != ''">
<img alt="Logo" tal:attributes="src python: doc_footer_url" />
</tal:block>
</div>
<div class="ci-slideshow-container-center" tal:content="doc_description"></div>
<div class="ci-slideshow-container-right">
......
......@@ -5,10 +5,12 @@ Export slideshow in any of the supported formats
"""
return context.WebPage_viewAsSlideshow(
format=format,
note_display=note_display,
svg_display=svg_display,
override_publisher_title=override_publisher_title,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
batch_mode=batch_mode,
document_save=document_save,
document_download=document_download,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", note_display=0, svg_display=\'png\', override_publisher_title=None, override_logo_reference=None, batch_mode=False, **kw</string> </value>
<value> <string>format="html", document_download=None, document_save=None, display_note=0, display_svg=None, override_source_organisation_title=None, override_logo_reference=None, batch_mode=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
"""
================================================================================
Return local parameters
================================================================================
"""
return None
"""
================================================================================
Return local parameters that require proxy role to access
================================================================================
"""
portal_type_valid_list = ["Web Site", "Web Section", "Web Page"]
portal_type = context.getPortalType()
portal_object = context.getPortalObject()
if REQUEST is not None:
return None
if portal_type not in portal_type_valid_list:
return None
def err(my_value):
#return "XXX No " + my_value + " defined."
return ""
def populateProductDictFromCategoryList(my_category_list):
result_list = []
for category in my_cateogry_list:
if category.find("follow_up/") > -1:
output_dict = {}
stripped_category_url = category.replace("follow_up/", "")
stripped_category_url_title = portal_object.restrictedTraverse(
stripped_category_url
).getTitle()
output_dict["title"] = stripped_category_url_title or err("product software")
result_list.append(output_dict)
return result_list
def populateOrganisationDict(my_organisation_list):
result_list = []
for organisation in my_organisation_list:
output_dict = {}
output_dict["title"] = organisation.getTitle() or err("title")
output_dict["organisation"] = organisation.getCorporateName() or err("corporate_name")
result_list.append(output_dict)
return result_list
def populateProductDict(my_product_list):
result_list = []
for product in my_product_list:
output_dict = {}
output_dict["title"] = product.getTitle() or err("product software")
result_list.append(output_dict)
return result_list
def populatePersonDict(my_person_list):
result_list = []
for person in my_person_list:
output_dict = {}
person_default_telephone = person.getDefaultTelephoneValue()
person_default_mail = person.getDefaultEmail()
output_dict["name"] = person.getTitle() or err("title")
output_dict["title"] = person.getFunctionTitle() or err("function title")
output_dict["uid"] = person.getUid() or err("uid")
if person_default_telephone is not None:
output_dict["phone"] = person_default_telephone.getCoordinateText() or err("phone")
else:
output_dict["phone"] = err("phone")
if person_default_mail is not None:
output_dict["email"] = person_default_mail.getUrlString() or err("email")
else:
output_dict["email"] = err("email")
result_list.append(output_dict)
return result_list
# "ERP5 Software" => erp5
def getSubstringFromProduct(my_candidate, my_as_is):
software_match_string = " Software"
software_title = my_candidate.get("title") or ""
if software_title.find(software_match_string) > 1:
if my_as_is is True:
return software_title.split(software_match_string)[0]
return software_title.split(software_match_string)[0].lower()
def callSelf(my_parameter, my_source_id, my_flag_site):
return context.WebPage_getLocalProxyParameter(
parameter=my_parameter,
source_uid=my_source_id,
flag_site=my_flag_site
)
pass_parameter = kw.get("parameter", None)
pass_source_data = kw.get("source_data", None)
pass_flag_site = kw.get("flag_site", None)
if pass_parameter is not None and pass_source_data is not None:
# ---------------------- Author (Contributors) -------------------------------
if pass_parameter == "author":
return populatePersonDict(context.getContributorValueList(*args, **kw))
# ----------------- Publisher (Follow-Up Organisation) -----------------------
if pass_parameter == "publisher":
return populateOrganisationDict(context.getFollowUpValueList(
portal_type="Organisation",
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# ------------------------- Product (Website) --------------------------------
if pass_parameter == "product":
if pass_flag_site == True:
return populateProductDictFromCategoryList(
context.getWebSiteValue().getMembershipCriterionCategoryList() or []
)
elif pass_source_data is not None:
return populateProductDict(context.getFollowUpValueList(
portal_type=pass_parameter,
checked_permission='View',
follow_up_related_uid=pass_source_data
))
# --------------------------- Theme (Website) --------------------------------
if pass_parameter == "theme":
theme = None
product_candidate_list = callSelf("product", pass_source_data, pass_flag_site)
if product_candidate_list is not None:
if len(product_candidate_list) > 0:
theme = getSubstringFromProduct(product_candidate_list[0], None)
# XXX no more overrides here, use override parameters on slideshow
# OSOE Sonderlocke
#if theme is None:
# osoe_match_string = "osoe"
# category_candidate_list = context.getCategoryList() or []
# for category in category_candidate_list:
# if category.find(osoe_match_string) > 1:
# theme = osoe_match_string
# MyNij Sonderlocke
#if theme is None:
# organisation_candidate_list = callSelf("Organisation", source_uid, None)
# if len(organisation_candidate_list) > 0:
# theme = organisation_candidate_list[0].get('title').lower()
return theme
......@@ -3,4 +3,14 @@
Print and download slideshow in PDF format
================================================================================
"""
return context.WebPage_viewAsSlideshow(format=format,note_display=note_display,svg_display=svg_display,flag_download=True, **kw)
return context.WebPage_viewAsSlideshow(
format=format,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
batch_mode=batch_mode,
document_download=document_download,
document_save=document_save,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="pdf", note_display=0, svg_display=\'png\', **kw</string> </value>
<value> <string>format="pdf", display_note=0,override_source_organisation_title=None,override_logo_reference=None, batch_mode=False, document_download=None, display_svg=None, document_save=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
"""
================================================================================
Update the slide dialog with parameters manually entered
================================================================================
"""
from Products.ERP5Type.Message import translateString
if dialog_id is not None:
return context.Base_redirect(
dialog_id,
keep_items = dict(
portal_status_message=translateString('Preview updated.'),
cancel_url=cancel_url,
portal_skin=portal_skin,
override_logo_reference=override_logo_reference,
override_publisher_title=override_publisher_title,
note_display=note_display,
svg_display=svg_display,
format="pdf",
)
)
......@@ -12,9 +12,11 @@ if dialog_id is not None:
cancel_url=cancel_url,
portal_skin=portal_skin,
override_logo_reference=override_logo_reference,
override_publisher_title=override_publisher_title,
note_display=note_display,
svg_display=svg_display,
override_source_organisation_title=override_source_organisation_title,
display_note=display_note,
display_svg=display_svg,
document_save=document_save,
document_download=document_download,
format=format,
)
)
......@@ -50,19 +50,11 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, *args, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
<value> <string>dialog_id=None, cancel_url=None, document_download=None, document_save=None ,format=None, display_note=None, display_svg=None, override_source_organisation_title=None, override_logo_reference=None, portal_skin=None, *args,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_getLocalProxyParameter</string> </value>
<value> <string>WebPage_updateSlideshowDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -5,9 +5,12 @@ Display WebPage as slideshow if called with portal_skin=Slide parameter
"""
return context.WebPage_viewAsSlideshow(
format=format,
note_display=note_display,
svg_display=svg_display,
override_publisher_title=override_publisher_title,
display_note=display_note,
display_svg=display_svg,
override_source_organisation_title=override_source_organisation_title,
override_logo_reference=override_logo_reference,
document_save=document_save,
document_download=document_download,
batch_mode=batch_mode,
**kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>format="html", note_display=0, svg_display="png",override_logo_reference=None, override_publisher_title=None,**kw</string> </value>
<value> <string>format="html", batch_mode=False, document_download=None, document_save=None, display_note=0, display_svg=None, override_logo_reference=None, override_source_organisation_title=None,**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
/* === font family === */
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow .ci-slideshow-handout h1,
.ci-slideshow .ci-slideshow-handout h2,
.ci-slideshow .ci-slideshow-intro:before,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
html .ci-slideshow pre,
html .ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
/* === font size === */
.ci-slideshow .ci-slideshow-intro:before {
font-size: 28px;
......@@ -300,9 +280,13 @@ html .ci-slideshow .ci-slideshow-footer > div {
}
html .ci-slideshow .ci-slideshow-header > div img,
html .ci-slideshow .ci-slideshow-footer > div img {
/*
max-width: 8em;
min-width: initial;
height: 4em;
*/
max-height: 2.5em;
min-width: initial;
}
html .ci-slideshow .ci-slideshow-container-left {
text-align: left;
......
......@@ -9,27 +9,6 @@ html {
height: 100%;
}
/* === font family === */
.ci-slideshow h1,
.ci-slideshow h2,
.ci-slideshow-handout .ci-slideshow-handout-header,
.ci-slideshow-handout h1,
.ci-slideshow-handout h2,
.ci-slideshow h1 ~ *,
.ci-slideshow h2 ~ *,
.ci-slideshow-footer div,
.ci-slideshow .ci-slideshow-intro:before {
font-family: 'Roboto', Arial, sans-serif;
}
.ci-slideshow details,
.ci-slideshow-handout details {
font-family: 'Heuristica', 'Helvetica', Times, serif;
}
.ci-slideshow pre,
.ci-slideshow code {
font-family: "Courier New", Courier, monospace, sans-serif;
}
/* === font size === */
.ci-slideshow h1,
.ci-slideshow h2,
......
##############################################################################
#
# Copyright (c) 2002-2017 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import unittest
from Products.ERP5Type.tests.ERP5TypeFunctionalTestCase import ERP5TypeFunctionalTestCase
class TestCorportateIdentityTemplateUiElements(ERP5TypeFunctionalTestCase):
foreground = 0
run_only = "template_zuite"
def getBusinessTemplateList(self):
return (
'erp5_base',
'erp5_font',
'erp5_web',
'erp5_dms',
'erp5_corporate_identity',
'erp5_ui_test_core'
)
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestCorportateIdentityTemplateUiElements))
return suite
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testCorporateIdentityTemplateUiElements</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Tests verifying the various templates and exports work in the ERP5 UI.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testCorportateIdentityTemplateUiElements</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
......@@ -44,9 +44,7 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 30, 0: Unused customScript imported from Products.ERP5.tests.testERP5WebWithDms (unused-import)</string>
<string>W: 32, 0: Unused urlparse imported from urlparse (unused-import)</string>
<string>W: 34, 0: Unused import operator (unused-import)</string>
<string>W: 37, 0: Unused import base64 (unused-import)</string>
</tuple>
</value>
</item>
......
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
image_module/template_test_*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
image_module/template_test_*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
document_module/template_test_slideshow*
document_module/template_test_*
image_module/template_test_*
image_module/template_test_image*
image_module/template_test_slideshow*
person_module/template_test*
portal_preferences/default_site_preference/template_*
portal_tests/template_zuite/*
web_page_module/template_test_slideshow*
\ No newline at end of file
web_page_module/template_test_*
\ No newline at end of file
erp5_corporate_identity_slide | CI
erp5_corporate_identity_slide | CI_Slideshow
erp5_corporate_identity_slide | CI_slideshow
erp5_corporate_identity_slide | Slide
erp5_corporate_identity_slide | SlideShow
erp5_corporate_identity_slide | WhiteSlideShow
\ No newline at end of file
erp5_corporate_identity_slide | Slide
\ No newline at end of file
test.erp5.testCorportateIdentityTemplates
test.erp5.testCorportateIdentityTemplateUiElements
\ No newline at end of file
test.erp5.testCorportateIdentityTemplates
\ No newline at end of file
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