Commit e4bfb062 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Allow to configure ERP5 frontpage gadget, hateoas URL and application title.

The configuration is done on the Web Site level, to reduce the need to write custom JS code.
parent 688cc495
......@@ -64,11 +64,15 @@ be a problem).</string> </value>
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>permission</string> </key>
<value> <string></string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -78,6 +82,18 @@ be a problem).</string> </value>
<key> <string>type_class</string> </key>
<value> <string>Folder</string> </value>
</item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_mixin</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -78,7 +78,7 @@
<key> <string>searchable_text_method_id</string> </key>
<value>
<tuple>
<string>asRawText</string>
<string>getTextContent</string>
</tuple>
</value>
</item>
......
......@@ -71,6 +71,10 @@
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>WebSection</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -71,6 +71,10 @@
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>type_class</string> </key>
<value> <string>WebSite</string> </value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......
......@@ -6,6 +6,20 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_cache</string> </key>
<value>
<object>
<klass>
<global name="CPMCache" module="Products.CMFCore.CachingPolicyManager"/>
</klass>
<tuple/>
<state>
<dictionary/>
</state>
</object>
</value>
</item>
<item>
<key> <string>_policies</string> </key>
<value>
......@@ -18,6 +32,7 @@
<tuple>
<string>unauthenticated web pages</string>
<string>unauthenticated</string>
<string>authenticated_hateoas</string>
<string>authenticated</string>
</tuple>
</value>
......@@ -135,7 +150,7 @@
</value>
</item>
<item>
<key> <string>unauthenticated</string> </key>
<key> <string>authenticated_hateoas</string> </key>
<value>
<object>
<klass> <reference id="2.1"/> </klass>
......@@ -184,7 +199,7 @@
</item>
<item>
<key> <string>_policy_id</string> </key>
<value> <string>unauthenticated</string> </value>
<value> <string>authenticated_hateoas</string> </value>
</item>
<item>
<key> <string>_post_check</string> </key>
......@@ -204,6 +219,111 @@
<persistent> <string encoding="base64">AAAAAAAAAAg=</string> </persistent>
</value>
</item>
<item>
<key> <string>_private</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_proxy_revalidate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_public</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_s_max_age_secs</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_stale_if_error_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_stale_while_revalidate_secs</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_vary</string> </key>
<value> <string>Cookie</string> </value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>unauthenticated</string> </key>
<value>
<object>
<klass> <reference id="2.1"/> </klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_enable_304s</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_etag_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent>
</value>
</item>
<item>
<key> <string>_last_modified</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>_max_age_secs</string> </key>
<value> <int>3600</int> </value>
</item>
<item>
<key> <string>_mtime_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAo=</string> </persistent>
</value>
</item>
<item>
<key> <string>_must_revalidate</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_no_cache</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_no_store</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_no_transform</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>_policy_id</string> </key>
<value> <string>unauthenticated</string> </value>
</item>
<item>
<key> <string>_post_check</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_pre_check</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_predicate</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAs=</string> </persistent>
</value>
</item>
<item>
<key> <string>_private</string> </key>
<value> <int>0</int> </value>
......@@ -246,7 +366,7 @@
<item>
<key> <string>_etag_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAk=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAw=</string> </persistent>
</value>
</item>
<item>
......@@ -260,7 +380,7 @@
<item>
<key> <string>_mtime_func</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAo=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAA0=</string> </persistent>
</value>
</item>
<item>
......@@ -298,7 +418,7 @@
<item>
<key> <string>_predicate</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAs=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAA4=</string> </persistent>
</value>
</item>
<item>
......@@ -394,7 +514,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value>
<value> <string>time</string> </value>
</item>
</dictionary>
</pickle>
......@@ -407,7 +527,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: member is None</string> </value>
<value> <string>python: (member is not None) and (request.get("X-HATEOAS-CACHE", 0))</string> </value>
</item>
</dictionary>
</pickle>
......@@ -439,6 +559,45 @@
</pickle>
</record>
<record id="11" aka="AAAAAAAAAAs=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: member is None</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="12" aka="AAAAAAAAAAw=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="13" aka="AAAAAAAAAA0=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python: getattr(object, \'getModificationDate\', object.modified)()</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="14" aka="AAAAAAAAAA4=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
......
......@@ -8,4 +8,4 @@ Web Page | publication_workflow
Web Section | category_publication_workflow
Web Section | edit_workflow
Web Site | category_publication_workflow
Web Site | edit_workflow
Web Site | edit_workflow
\ No newline at end of file
def TextDocument_substituteTextContent(self, text, **kw):
""" XXXX"""
return self._substituteTextContent(text, **kw)
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Extension 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>WebRenderJSUI</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>extension.erp5.WebRenderJSUI</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Extension 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>
......@@ -270,7 +270,7 @@
right_button,\n
default_right_text,\n
default_right_icon = "",\n
title_link = {title: "ERP5"},\n
title_link = {},\n
sub_header_list = [],\n
alphabet = "abcdefghijklmnopqrstuvwxyz",\n
promise_list = [];\n
......@@ -279,9 +279,9 @@
// Handle main title\n
if (options.hasOwnProperty("page_title")) {\n
title_link.title = options.page_title;\n
// Updating globally the page title. Does not follow RenderJS philosophy, but, it is enough for now\n
document.title = title_link.title;\n
}\n
// Updating globally the page title. Does not follow RenderJS philosophy, but, it is enough for now\n
document.title = title_link.title;\n
if (options.hasOwnProperty("breadcrumb_url")) {\n
title_link.url = options.breadcrumb_url;\n
promise_list.push(gadget.translateHtml(header_title_link_template(title_link)));\n
......@@ -580,7 +580,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.17574.28685.15906</string> </value>
<value> <string>941.35154.28208.61184</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -598,7 +598,7 @@
</tuple>
<state>
<tuple>
<float>1421681794.02</float>
<float>1425891407.82</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -108,12 +108,20 @@
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>ERP5</title>\n
<title>${application_title}</title>\n
<link rel="shortcut icon" href="favicon.ico">\n
\n
<link href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />\n
<link rel="stylesheet" href="jquerymobile.css">\n
<link rel="stylesheet" href="gadget_erp5.css">\n
\n
<script data-renderjs-configuration="application_title" type="text/x-renderjs-configuration">${application_title}</script>\n
<script data-renderjs-configuration="frontpage_gadget" type="text/x-renderjs-configuration">${frontpage_gadget}</script>\n
<script data-renderjs-configuration="action_view" type="text/x-renderjs-configuration">${action_view}</script>\n
<script data-renderjs-configuration="default_view_reference" type="text/x-renderjs-configuration">${default_view_reference}</script>\n
<script data-renderjs-configuration="hateoas_url" type="text/x-renderjs-configuration">${hateoas_url}</script>\n
\n
\n
<script src="rsvp.js" type="text/javascript"></script>\n
<script src="renderjs.js" type="text/javascript"></script>\n
<script src="URI.js" type="text/javascript"></script>\n
......@@ -121,16 +129,6 @@
<script src="jquerymobile.js" type="text/javascript"></script>\n
<script src="gadget_global.js" type="text/javascript"></script>\n
<script src="gadget_erp5.js" type="text/javascript"></script>\n
\n
<script id="panel-template" type="text/x-handlebars-template">\n
<ul data-role="listview">\n
<li><a class="home_link ui-btn ui-icon-home ui-btn-icon-left" data-icon="home">Documents</a></li>\n
<li><a class="fast_input_link ui-btn ui-icon-plus ui-btn-icon-left" data-icon="plus">New Document</a></li>\n
{{#navigationlist}}\n
<li><a href="{{link}}">{{title}}</a></li>\n
{{/navigationlist}}\n
</ul>\n
</script>\n
\n
</head>\n
<body>\n
......@@ -153,6 +151,10 @@
]]></string> </value>
</item>
<item>
<key> <string>text_content_substitution_mapping_method_id</string> </key>
<value> <string>WebPage_getRenderJSSubstitutionMappingDict</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>RenderJS Gadget ERP5</string> </value>
......@@ -272,7 +274,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>romain</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -286,7 +288,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.17484.1932.27136</string> </value>
<value> <string>941.31252.46674.14728</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -304,7 +306,7 @@
</tuple>
<state>
<tuple>
<float>1421158072.44</float>
<float>1425659919.68</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -124,7 +124,7 @@
.push(function (jio_gadget) {\n
return jio_gadget.createJio({\n
type: "erp5",\n
url: (new URI("hateoas/")).absoluteTo(location.href).toString()\n
url: (new URI(gadget.props.hateoas_url)).absoluteTo(location.href).toString()\n
});\n
/*\n
return jio_gadget.createJio({\n
......@@ -139,7 +139,7 @@
}\n
\n
function renderPage(gadget, page_name, options) {\n
return gadget.declareGadget("gadget_erp5_page_" + page_name + ".html", {\n
return gadget.declareGadget(page_name, {\n
scope: "pg"\n
})\n
.push(function (page_gadget) {\n
......@@ -220,8 +220,7 @@
// Init local properties\n
.ready(function (g) {\n
g.props = {\n
translation_lookup: "",\n
hateoas_url: "hateoas/"\n
translation_lookup: ""\n
};\n
// return g.getDeclaredGadget("breadcrumb")\n
// .push(function (sub_gadget) {\n
......@@ -229,18 +228,32 @@
// });\n
})\n
\n
// Configure jIO to use localstorage\n
// And load configuration from server\n
.ready(function (g) {\n
return createJio(g);\n
})\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
g.props.article = element.querySelector("article");\n
\n
// XXX Will work only if top gadget...\n
var element_list = document.querySelectorAll("[data-renderjs-configuration]"),\n
len = element_list.length,\n
key,\n
value,\n
i;\n
for (i = 0; i < len; i += 1) {\n
key = element_list[i].getAttribute(\'data-renderjs-configuration\');\n
value = element_list[i].textContent;\n
if (value !== "") {\n
g.props[key] = value;\n
}\n
}\n
});\n
})\n
// Configure jIO to use localstorage\n
// And load configuration from server\n
.ready(function (g) {\n
return createJio(g);\n
})\n
.ready(function (g) {\n
return g.getDeclaredGadget("header")\n
.push(function (header_gadget) {\n
......@@ -257,7 +270,7 @@
\n
// bridge translation gadget\n
.allowPublicAcquisition("getTranslationMethod", function () {\n
var root = (new URI("hateoas/")).absoluteTo(location.href).toString();\n
var root = (new URI(this.props.hateoas_url)).absoluteTo(location.href).toString();\n
return root + this.props.translation_lookup;\n
})\n
.allowPublicAcquisition("changeLanguage", function (param_list) {\n
......@@ -315,7 +328,7 @@
.allowPublicAcquisition("jio_get", function (param_list) {\n
return this.getDeclaredGadget("jio_gadget")\n
.push(function (jio_gadget) {\n
return jio_gadget.get.apply(jio_gadget, param_list)\n
return jio_gadget.get.apply(jio_gadget, param_list);\n
})\n
.push(function (result) {\n
return {data: result};\n
......@@ -331,7 +344,7 @@
})\n
.push(function (event) {\n
return {data: JSON.parse(event.target.result)};\n
})\n
});\n
})\n
.allowPublicAcquisition("whoWantToDisplayThis", function (param_list) {\n
// Hey, I want to display some URL\n
......@@ -445,7 +458,7 @@
// XXX translate: called before ready(), so props is not available.\n
// Needed to lookup to retrieve HAL to fetch site module/runner languages \n
.declareMethod(\'getSiteRoot\', function () {\n
return (new URI("hateoas/")).absoluteTo(location.href).toString();\n
return (new URI(this.props.hateoas_url)).absoluteTo(location.href).toString();\n
})\n
\n
// Render the page\n
......@@ -511,7 +524,8 @@
.push(function () {\n
// By default, init the header options to be empty (ERP5 title by default + sidebar)\n
gadget.props.header_argument_list = [{\n
panel_action: true\n
panel_action: true,\n
page_title: gadget.props.application_title || "ERP5"\n
}];\n
\n
gadget.state_parameter_dict = {\n
......@@ -526,11 +540,15 @@
if (options.page === undefined) {\n
// Not rendering a jio document and not page requested.\n
// URL is probably empty: redirect to the frontpage\n
return gadget.aq_pleasePublishMyState({page: \'front\'})\n
.push(gadget.pleaseRedirectMyHash.bind(gadget));\n
// Check if a custom frontpage is defined\n
if (!gadget.props.frontpage_gadget) {\n
return gadget.aq_pleasePublishMyState({page: \'front\'})\n
.push(gadget.pleaseRedirectMyHash.bind(gadget));\n
}\n
return renderPage(gadget, gadget.props.frontpage_gadget, options);\n
}\n
\n
return renderPage(gadget, options.page, options);\n
return renderPage(gadget, "gadget_erp5_page_" + options.page + ".html", options);\n
})\n
\n
.push(function (result) {\n
......@@ -726,7 +744,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>941.25428.15657.11059</string> </value>
<value> <string>941.35159.4940.27904</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -744,7 +762,7 @@
</tuple>
<state>
<tuple>
<float>1425307985.31</float>
<float>1425893558.44</float>
<string>GMT</string>
</tuple>
</state>
......
......@@ -155,6 +155,53 @@
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_hateoas_url</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_application_title</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_view_action_category</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_default_view_action_reference</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
......@@ -189,6 +236,22 @@
</tuple>
</value>
</item>
<item>
<key> <string>configuration_application_title</string> </key>
<value> <string>ERP5</string> </value>
</item>
<item>
<key> <string>configuration_default_view_action_reference</string> </key>
<value> <string>view</string> </value>
</item>
<item>
<key> <string>configuration_hateoas_url</string> </key>
<value> <string>hateoas/</string> </value>
</item>
<item>
<key> <string>configuration_view_action_category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>container_layout</string> </key>
<value> <string>WebSection_renderDefaultPageAsGadget</string> </value>
......@@ -213,9 +276,7 @@
</item>
<item>
<key> <string>layout_configuration_form_id</string> </key>
<value>
<none/>
</value>
<value> <string>WebSection_viewHateoasPreference</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -422,7 +483,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>936.22999.3755.45004</string> </value>
<value> <string>941.35235.58430.32802</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -440,7 +501,7 @@
</tuple>
<state>
<tuple>
<float>1405933462.45</float>
<float>1425895920.4</float>
<string>GMT</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>TextDocument_substituteTextContent</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>WebRenderJSUI</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TextDocument_substituteTextContent</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>_body</string> </key>
<value> <string>return mapping_dict\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>mapping_dict=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebPage_getRenderJSSubstitutionMappingDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -75,6 +75,8 @@ elif (portal_type == "Web Manifest"):\n
response.setHeader(\'Content-Type\', \'text/cache-manifest\')\n
\n
else:\n
if (mapping_dict is not None):\n
web_content = web_page.TextDocument_substituteTextContent(web_page, web_content, mapping_dict=mapping_dict)\n
# Do not allow to put inside an iframe\n
response.setHeader("X-Frame-Options", "SAMEORIGIN")\n
response.setHeader("X-Content-Type-Options", "nosniff")\n
......@@ -89,7 +91,7 @@ return web_content\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None</string> </value>
<value> <string>REQUEST=None, response=None, mapping_dict=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -58,7 +58,13 @@ if response is None:\n
web_section = context\n
default_web_page = web_section.getDefaultDocumentValue()\n
\n
return default_web_page.WebPage_viewAsWeb()\n
return default_web_page.WebPage_viewAsWeb(mapping_dict={\n
"frontpage_gadget": web_section.getLayoutProperty("configuration_frontpage_gadget_url", default=""),\n
"application_title": web_section.getLayoutProperty("configuration_application_title", default="ERP5"),\n
"action_view": web_section.getLayoutProperty("configuration_action_view", default="object_view"),\n
"default_view_reference": web_section.getLayoutProperty("configuration_default_view_reference", default="view"),\n
"hateoas_url": web_section.getLayoutProperty("configuration_hateoas_url", default="hateoas/")\n
})\n
</string> </value>
</item>
<item>
......
......@@ -72,8 +72,11 @@
<key> <string>left</string> </key>
<value>
<list>
<string>my_default_view_action_reference</string>
<string>my_view_action_category</string>
<string>my_configuration_default_view_action_reference</string>
<string>my_configuration_view_action_category</string>
<string>my_configuration_frontpage_gadget_url</string>
<string>my_configuration_application_title</string>
<string>my_configuration_hateoas_url</string>
</list>
</value>
</item>
......
<?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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_configuration_application_title</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Application Title</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_default_view_action_reference</string> </value>
<value> <string>my_configuration_default_view_action_reference</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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_configuration_frontpage_gadget_url</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Front Page Gadget</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_configuration_hateoas_url</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</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>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Hateoas URL</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_view_action_category</string> </value>
<value> <string>my_configuration_view_action_category</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
extension.erp5.WebRenderJSUI
\ 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