Commit ef83c38b authored by Vincent Bechu's avatar Vincent Bechu

erp5_officejs: add empty panel to contributor

parent 63e2db68
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Panel</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_no_panel.js" type="text/javascript"></script>
</head>
<body>
<div class="jqm-navmenu-panel"></div>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_no_panel.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_erp5_no_panel.html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 No Panel</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*global window, rJS */
(function (window, rJS) {
"use strict";
/////////////////////////////////////////////////////////////////
// temlates
/////////////////////////////////////////////////////////////////
// Precompile templates while loading the first gadget instance
rJS(window)
/////////////////////////////////////////////////////////////////
// ready
/////////////////////////////////////////////////////////////////
// Init local properties
.ready(function (g) {
g.props = {};
})
//////////////////////////////////////////////
// acquired method
//////////////////////////////////////////////
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
// Assign the element to a variable
.ready(function (g) {
return g.getElement()
.push(function (element) {
g.props.element = element;
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod('toggle', function () {
return;
})
.declareMethod('close', function () {
return;
})
.declareMethod('render', function () {
return;
});
/////////////////////////////////////////////////////////////////
// declared services
/////////////////////////////////////////////////////////////////
}(window, rJS));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_no_panel.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_erp5_no_panel.js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget ERP5 No Panel JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -15,7 +15,7 @@
url_list = param.url_list.split('\n');
for (i = 0; i < url_list.length; i += 1) {
if (i > 0) {
query += " AND ";
query += " OR ";
}
query += 'id: "' + url_list[i] + '"';
}
......@@ -25,17 +25,30 @@
return gadget.notifySubmitting();
})
.push(function () {
var query_b = {
query:'portal_type: ("Web Illustration",'
+ '"Web Manifest","Web Script","Web Style","Web Page")',
limit: [0, 2713]};
if (param.version_a !== "") {
query_b.query += ' AND version: "' + param.version_a + '"';
}
return gadget.props.storage.createJio({
type: "replicate",
conflict_handling: param.reverse ? 1 : 2,
query: {query: query, limit: [0,2713]},
signature_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "contributor-hash"
}
},
remote_sub_storage: {
type: "mapping",
map_all_property: true,
query: query_b,
mapping_dict: {
"id": {"equal": "reference"},
"text_content": {"equal": "text_content"},
"parent_relative_url": {"equal": "parent_relative_url"},
"portal_type": {"equal": "portal_type"},
"title": {"equal": "title"},
"description": {"equal": "description"}
},
sub_storage: {
type: "erp5",
......@@ -45,17 +58,13 @@
},
local_sub_storage: {
type: "mapping",
map_all_property: true,
query: {
"query": 'validation_state: "Draft" AND version:"'
+ param.version_b + '"'
"query": 'validation_state: "Draft" ',
"limit": [0, 2713]
},
mapping_dict: {
"id": {"equal": "reference"},
"parent_relative_url": {"equal": "parent_relative_url"},
"portal_type": {"equal": "portal_type"},
"text_content": {"equal": "text_content"},
"title": {"equal": "title"},
"description": {"equal": "description"},
"version": {"default_value": param.version_b}
},
sub_storage: {
......@@ -63,27 +72,18 @@
url: param.url_b + "/erp5/web_site_module/hateoas",
default_view_reference: "jio_view"
}
},
conflict_handling: param.reverse ? 1 : 2,
query: {query: query},
signature_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "contributor-hash"
}
}
});
})
.push(function () {
return RSVP.all([
gadget.props.storage.repair(),
gadget.props.storage.allDocs()
]);
return gadget.props.storage.repair();
})
.push(function () {
return gadget.props.storage.allDocs({query: query, limit: [0, 2713]});
})
.push(function (result) {
gadget.props.element.querySelector(".result").innerHTML =
result[1].data.total_rows + " documents loaded";
result.data.total_rows + " documents loaded";
return gadget.notifySubmitted();
});
}
......@@ -134,6 +134,7 @@
g.props.param.url_a = option.url_a || "";
g.props.param.url_b = option.url_b || "";
g.props.param.version_b = option.version_b || "";
g.props.param.version_a = option.version_a || "";
return g.declareGadget("gadget_jio.html", {scope: "storage_local"})
.push(function (storage_gadget) {
g.props.storage = storage_gadget;
......@@ -174,6 +175,17 @@
"hidden": 0,
"type": "StringField"
},
"version_a": {
"description": "",
"title": "Version",
"default": g.props.param.version_a,
"css_class": "",
"required": 0,
"editable": 1,
"key": "version_a",
"hidden": 0,
"type": "StringField"
},
"url_list": {
"description": "",
"title": "References",
......@@ -231,7 +243,7 @@
"group_list": [
[
"left",
[["erp_a"], ["url_a"]]
[["erp_a"], ["url_a"], ["version_a"]]
],
[
"right",
......
......@@ -377,7 +377,7 @@
</item>
<item>
<key> <string>configuration_panel_gadget_url</string> </key>
<value> <string>gadget_erp5_panel.html</string> </value>
<value> <string>gadget_erp5_no_panel.html</string> </value>
</item>
<item>
<key> <string>configuration_router_gadget_url</string> </key>
......
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