Commit 3b222b32 authored by Romain Courteaud's avatar Romain Courteaud

erp5_osoe_web_renderjs_ui: access tab front page

This front page gadget allows user to:
* create any kind of document
* launch any kind of report
* contribute a new documents
parent 2f0fd720
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyjio_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>list_all_portal_type_to_create</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>5.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>New Document</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TypesTool_viewAllPortalTypeDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_onlyjio_jump</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_onlyjio_jump</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>list_all_report</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Site Reports</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/TypesTool_viewAllReportDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Zuite" module="Products.Zelenium.zuite"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>osoe_rjs_zuite</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="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>testPageOsoeAccessPanel</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>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Page Front</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Page Front</td></tr>
</thead><tbody>
<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/web_site_module/renderjs_runner/#/?page=osoe_access</td>
<td></td>
</tr>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_app_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Site Reports' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='New' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Contribute File' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'New'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Site Reports' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='New' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Contribute File' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Contribute File'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Site Reports' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='New' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Contribute File' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tal:block tal:define="click_configuration python: {'text': 'Site Reports'}">
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link" />
</tal:block>
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>assertElementPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Site Reports' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='New' and contains(@class, 'active')]</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//div[@data-gadget-scope='panel']//a[text()='Contribute File' and contains(@class, 'active')]</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<!--
data-i18n=List All Report
data-i18n=Contribute File
data-i18n=New
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Osoe Access</title>
<link rel="http://www.renderjs.org/rel/interface" href="interface_page.html">
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_erp5_page_osoe_access.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_page_access.html"
data-gadget-scope="access" />
</body>
</html>
\ No newline at end of file
/*jslint indent: 2, maxerr: 3, maxlen: 80 */
/*global window, rJS, RSVP */
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
.declareAcquiredMethod("getTranslationDict", "getTranslationDict")
.declareMethod('render', function (options) {
return new RSVP.Queue(RSVP.hash({
access_gadget: this.getDeclaredGadget('access'),
translation_dict: this.getTranslationDict([
'Site Reports',
'Contribute File',
'New'
])
}))
.push(function (result_dict) {
return result_dict.access_gadget.render(options, [{
title: result_dict.translation_dict['Site Reports'],
jio_key: 'portal_types',
erp5_action: 'list_all_report'
}, {
title: result_dict.translation_dict.New,
jio_key: 'portal_types',
erp5_action: 'list_all_portal_type_to_create'
}, {
title: result_dict.translation_dict['Contribute File'],
jio_key: 'document_module',
erp5_action: 'contribute_file'
}]);
});
});
}(window, rJS, RSVP));
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Site Documents Creator</title>
<!--link rel="http://www.renderjs.org/rel/interface" href="interface_page.html"-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<script src="gadget_erp5_site_document_creator.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global domsugar, window, rJS */
(function (domsugar, window, rJS) {
"use strict";
rJS(window)
.declareAcquiredMethod("notifySubmit", "notifySubmit")
.declareMethod('render', function (options) {
return this.changeState({
key: options.key,
erp5_add_list: JSON.stringify(options.erp5_add_list)
});
})
.onStateChange(function () {
var gadget = this,
erp5_add_list = JSON.parse(gadget.state.erp5_add_list),
i,
j,
k,
business_application_element_list = [],
module_element_list;
for (i = 0; i < erp5_add_list.length; i += 1) {
module_element_list = [];
for (j = 0; j < erp5_add_list[i][1].length; j += 1) {
for (k = 0; k < erp5_add_list[i][1][j][2].length; k += 1) {
module_element_list.push(
domsugar('li', [domsugar('button', {
type: 'submit',
'data-value': erp5_add_list[i][1][j][1] + ' ' +
erp5_add_list[i][1][j][2][k][1],
text: erp5_add_list[i][1][j][2][k][0]
})])
);
}
}
business_application_element_list.push(domsugar('li', [
domsugar('h2', {
text: erp5_add_list[i][0]
}),
domsugar('ul', module_element_list)
]));
}
domsugar(gadget.element, [
domsugar('ul', {'class': 'ui-list-grid'},
business_application_element_list)
]);
})
.declareMethod('getContent', function () {
var result = {};
if (this.state.value !== undefined) {
result[this.state.key] = this.state.value;
}
return result;
}, {mutex: 'changestate'})
.declareMethod('checkValidity', function () {
return (this.state.value !== undefined);
}, {mutex: 'changestate'})
.onEvent('click', function (evt) {
if (evt.target.tagName === 'BUTTON') {
this.state.value = evt.target.getAttribute('data-value');
}
return this.notifySubmit();
}, false);
}(domsugar, window, rJS));
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Site Reports</title>
<!--link rel="http://www.renderjs.org/rel/interface" href="interface_page.html"-->
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="jiodev.js" type="text/javascript"></script>
<script src="gadget_global.js" type="text/javascript"></script>
<script src="domsugar.js" type="text/javascript"></script>
<script src="gadget_erp5_site_report_viewer.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*jslint nomen: true, indent: 2, maxerr: 3, maxlen: 80 */
/*global domsugar, window, rJS, RSVP */
(function (domsugar, window, rJS, RSVP) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getTranslationDict", "getTranslationDict")
.declareAcquiredMethod("getUrlForDict", "getUrlForDict")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareMethod('triggerSubmit', function () {
return;
})
.allowPublicAcquisition('updateHeader', function () {
return;
})
.allowPublicAcquisition('updatePanel', function () {
return;
})
////////////////////////////////////////////////////////////////////
// Go
////////////////////////////////////////////////////////////////////
.declareMethod('render', function (options) {
var gadget = this,
erp5_report_list = options.erp5_report_list,
i,
j,
k,
business_application_element_list = [],
module_element_list,
url_for_dict = {};
for (i = 0; i < erp5_report_list.length; i += 1) {
for (j = 0; j < erp5_report_list[i][1].length; j += 1) {
for (k = 0; k < erp5_report_list[i][1][j][2].length; k += 1) {
url_for_dict[erp5_report_list[i][1][j][1] +
erp5_report_list[i][1][j][2][k][1]] = {
command: 'display_erp5_dialog_with_history',
options: {
jio_key: erp5_report_list[i][1][j][1],
page: erp5_report_list[i][1][j][2][k][1]
}
};
}
}
}
return new RSVP.Queue(gadget.getUrlForDict(url_for_dict))
.push(function (url_dict) {
for (i = 0; i < erp5_report_list.length; i += 1) {
module_element_list = [];
for (j = 0; j < erp5_report_list[i][1].length; j += 1) {
module_element_list.push(
domsugar('li', [domsugar('h3', {
text: erp5_report_list[i][1][j][0]
})])
);
for (k = 0; k < erp5_report_list[i][1][j][2].length; k += 1) {
module_element_list.push(
domsugar('li', [domsugar('a', {
href: url_dict[erp5_report_list[i][1][j][1] +
erp5_report_list[i][1][j][2][k][1]],
text: erp5_report_list[i][1][j][2][k][0]
})])
);
}
}
business_application_element_list.push(domsugar('li', [
domsugar('h2', {
text: erp5_report_list[i][0]
}),
domsugar('ul', module_element_list)
]));
}
domsugar(gadget.element, [
domsugar('ul', {'class': 'ui-list-grid'},
business_application_element_list)
]);
});
});
}(domsugar, window, rJS, RSVP));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>