Commit dd6bdaad authored by Romain Courteaud's avatar Romain Courteaud

XXX Frontpage

parent db817eac
......@@ -105,10 +105,8 @@
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Fri, 11 May 2018 16:00:00 GMT+0200\n
<value> <string>CACHE MANIFEST\n
# generated on Fri, 29 Jun 2018 10:00:00 GMT+0100\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
......@@ -205,6 +203,14 @@ gadget_erp5_page_tab.html\n
gadget_erp5_page_tab.js\n
gadget_erp5_page_worklist.html\n
gadget_erp5_page_worklist.js\n
gadget_erp5_page_home.html\n
gadget_erp5_page_home.js\n
gadget_erp5_page_language.html\n
gadget_erp5_page_language.js\n
gadget_erp5_page_rss_reader.html\n
gadget_erp5_page_rss_reader.js\n
gadget_erp5_page_links.html\n
gadget_erp5_page_links.js\n
gadget_erp5_panel.html\n
gadget_erp5_panel.js\n
gadget_erp5_panel.png?format=png\n
......@@ -254,9 +260,7 @@ jiodev.js\n
renderjs.js\n
rsvp.js\n
NETWORK:\n
*
]]></string> </value>
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......@@ -385,7 +389,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.19284.27735.63931</string> </value>
<value> <string>968.35643.41354.35157</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -403,7 +407,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1517844236.51</float>
<float>1530274338.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -60,7 +60,9 @@
['previous_url', 'Previous', 'carat-l'],
['next_url', 'Next', 'carat-r'],
['edit_content', 'Content', 'file-text'],
['edit_properties', 'Properties', 'info']
['edit_properties', 'Properties', 'info'],
['rss_reader_url', 'RSS', 'rss'],
['links_url', 'Links', 'link']
];
gadget_klass
......@@ -218,9 +220,14 @@
// Sub header
for (i = 0; i < possible_sub_header_list.length; i += 1) {
if (options.hasOwnProperty(possible_sub_header_list[i][0])) {
klass = "";
if (options.extra_class &&
options.extra_class.hasOwnProperty(possible_sub_header_list[i][0])) {
klass = options.extra_class[possible_sub_header_list[i][0]];
} else {
klass = "";
}
if (!options[possible_sub_header_list[i][0]]) {
klass = "ui-disabled";
klass += " ui-disabled";
}
sub_header_list.push({
title: possible_sub_header_list[i][1],
......
......@@ -751,6 +751,9 @@ div[data-gadget-scope='header'] .ui-header button:active,
div[data-gadget-scope='header'] .ui-header a:active {
background-color: #0e90d8;
}
div[data-gadget-scope='header'] .ui-header .ui-active-tab {
background-color: #0e90d8;
}
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a {
display: block;
......@@ -776,7 +779,9 @@ div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a {
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button:hover,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a:hover,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button:active,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a:active {
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a:active,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls button.ui-active-tab,
div[data-gadget-scope='header'] .ui-header .ui-controlgroup-controls a.ui-active-tab {
background-color: #0e90d8;
}
@media only screen and (min-width: 45em) and (max-width: 85em) {
......@@ -3189,4 +3194,4 @@ hmtl .ui-icon-carat-u::before {
}
.ui-icon-clone::before {
content: "\f24d";
}
}
\ No newline at end of file
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1523030992.07</float>
<float>1523002193.07</float>
<string>GMT+2</string>
</tuple>
</state>
......
<!DOCTYPE html>
<html>
<!--
data-i18n=Worklist
data-i18n=All work caught up!
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Home Page</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_home.js" type="text/javascript"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.setState({
active_tab: '',
options_json: ''
})
.declareMethod('triggerSubmit', function (param_list) {
return this.state.active_tab_gadget.triggerSubmit(param_list);
})
.allowPublicAcquisition("updateHeader", function () {
return;
})
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getUrlFor({command: 'display', options: {page: 'home', tab: 'rss_reader'}}),
gadget.getUrlFor({command: 'display', options: {page: 'home', tab: 'links'}}),
gadget.getUrlFor({command: 'display', options: {page: 'home', tab: 'language'}})
]);
})
.push(function (result_list) {
var active_tab = options.tab || 'rss_reader',
header_dict = {
language_url : result_list[2],
page_title : 'Home',
page_icon : 'home',
rss_reader_url: result_list[0],
links_url: result_list[1],
extra_class: {}
};
header_dict.extra_class[active_tab + '_url'] = 'ui-active-tab';
return RSVP.all([
gadget.updateHeader(header_dict),
gadget.changeState({
active_tab: active_tab,
options_json: JSON.stringify(options)
})
]);
});
})
.onStateChange(function (modification_dict) {
var gadget = this;
if (modification_dict.hasOwnProperty('active_tab')) {
while (gadget.element.firstChild) {
gadget.element.removeChild(gadget.element.firstChild);
}
return gadget.declareGadget("gadget_erp5_page_" + modification_dict.active_tab + ".html",
{element: gadget.element})
.push(function (active_tab_gadget) {
gadget.state.active_tab_gadget = active_tab_gadget;
return active_tab_gadget.render(JSON.parse(modification_dict.options_json));
});
}
if (modification_dict.hasOwnProperty('options_json')) {
return gadget.state.active_tab_gadget.render(JSON.parse(modification_dict.options_json));
}
});
}(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, user-scalable=no" />
<title>ERP5 Page Links</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_erp5_page_links.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li>
<a href="https://jabberclient.app.officejs.com" target=_blank>Jabber</a>
</li>
<li>
<a href="https://lab.nexedi.com/nexedi/erp5" target=_blank>Gitlab ERP5</a>
</li>
</ul>
</body>
</html>
\ No newline at end of file
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
.declareMethod("render", function () {
});
}(window, rJS));
<!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 RSS Reader Page</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="gadget_erp5_page_rss_reader.js" type="text/javascript"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_view.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public"></div>
<!-- jio -->
<div data-gadget-url="gadget_jio.html"
data-gadget-scope="gitlab_erp5_jio"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_jio.html"
data-gadget-scope="gitlab_slapos_jio"
data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_jio.html"
data-gadget-scope="nexedi_blog_jio"
data-gadget-sandbox="public"></div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, URL*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, URL) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.allowPublicAcquisition('getUrlFor', function (argument_list) {
var i;
if (argument_list[0].command === "index") {
for (i = 0; i < this.props[argument_list[0].options.list_method_template].data.total_rows; i += 1) {
if (argument_list[0].options.jio_key === this.props[argument_list[0].options.list_method_template].data.rows[i].id) {
return this.props[argument_list[0].options.list_method_template].data.rows[i].value.link;
}
}
}
return this.getUrlFor(argument_list[0]);
})
.allowPublicAcquisition('jio_allDocs', function (argument_list) {
var tmp = argument_list[0].list_method_template,
i,
base_url,
link,
gadget = this;
return this.getDeclaredGadget(tmp)
.push(function (jio_gadget) {
if (tmp === 'nexedi_blog_jio') {
link = 'link';
} else {
link = 'link_alternate_href';
}
argument_list[0].select_list.push(link);
return jio_gadget.allDocs(argument_list[0]);
})
.push(function (result) {
gadget.props[tmp] = result;
for (i = 0; i < gadget.props.rss_list.length; i += 1) {
if (tmp === gadget.props.rss_list[i].scope) {
base_url = gadget.props.rss_list[i].url;
}
}
for (i = 0; i < result.data.total_rows; i += 1) {
if (!/^https?:\/\//i.test(result.data.rows[i].value[link])) {
result.data.rows[i].value[link] = new URL(result.data.rows[i].value[link], base_url).href;
}
if (!result.data.rows[i].value.link) {
result.data.rows[i].value.link = result.data.rows[i].value[link];
}
}
return result;
})
.push(undefined, function (error) {
//Anonymous User
if ((error.target !== undefined) && (error.target.status === 403)) {
//redirect to login page
//any jio call is fine
return gadget.jio_getAttachment(
'portal_workflow',
'links'
);
}
throw error;
});
})
.allowPublicAcquisition('getUrlParameter', function (argument_list) {
return this.getUrlParameter(argument_list)
.push(function (result) {
if (result === undefined) {
if (argument_list[0].indexOf('listbox_rss_nexedi_blog_sort_list') !== -1) {
return [['pubDate', 'descending']];
}
return [['updated', 'descending']];
}
return result;
});
})
.declareMethod("render", function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {
"_view": {
"listbox_rss_gitlab_erp5": {
"column_list": [
['title', 'Title']
],
"list_method_template": 'gitlab_erp5_jio',
"show_anchor": 0,
"default_params": {},
"editable": 0,
"css_class": 'invisible',
"editable_column_list": [],
"key": "field_listbox_rss_gitlab_erp5",
"lines": 5,
"query": 'urn:jio:allDocs?query=__id%3A%20!%3D%20"%2F0"',
"portal_type": [],
"search_column_list": [],
"sort_column_list": [],
"title": "Gitlab ERP5",
"type": "ListBox"
},
"listbox_rss_gitlab_slapos": {
"column_list": [
['title', 'Title']
],
"list_method_template": 'gitlab_slapos_jio',
"show_anchor": 0,
"default_params": {},
"editable": 0,
"css_class": 'invisible',
"editable_column_list": [],
"key": "field_listbox_rss_gitlab_slapos",
"lines": 5,
"query": 'urn:jio:allDocs?query=__id%3A%20!%3D%20"%2F0"',
"portal_type": [],
"search_column_list": [],
"sort_column_list": [],
"title": "Gitlab Slapos",
"type": "ListBox"
},
"listbox_rss_nexedi_blog": {
"column_list": [
['title', 'Title']
],
"list_method_template": 'nexedi_blog_jio',
"show_anchor": 0,
"default_params": {},
"editable": 0,
"css_class": 'invisible',
"editable_column_list": [],
"key": "field_listbox_rss_nexedi_blog",
"lines": 5,
"query": 'urn:jio:allDocs?query=__id%3A%20!%3D%20"%2F0"',
"portal_type": [],
"search_column_list": [],
"sort_column_list": [],
"title": "Nexedi Blog",
"type": "ListBox"
}
}
},
"_links": {
"type": {
name: ""
}
}
},
form_definition: {
group_list: [
[
"left",
[["listbox_rss_gitlab_erp5"], ["listbox_rss_nexedi_blog"]]
],
[
"right",
[["listbox_rss_gitlab_slapos"]]
]
]
}
});
});
})
.ready(function () {
var gadget = this,
i,
list = [];
gadget.props = {
'rss_list': [
{
'url': 'https://lab.nexedi.com/nexedi/erp5.atom',
'parser': 'atom',
'scope': 'gitlab_erp5_jio'
},
{
'url': 'https://lab.nexedi.com/nexedi/slapos.atom',
'parser': 'atom',
'scope': 'gitlab_slapos_jio'
},
{
'url': 'https://www.erp5.com/blog/WebSection_viewContentListAsRSS',
'parser': 'rss',
'scope': 'nexedi_blog_jio'
}
]
};
for (i = 0; i < gadget.props.rss_list.length; i += 1) {
list.push(gadget.getDeclaredGadget(gadget.props.rss_list[i].scope));
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(list);
})
.push(function (result_list) {
list = [];
for (i = 0; i < gadget.props.rss_list.length; i += 1) {
list.push(
result_list[i].createJio({
type: "query",
sub_storage: {
type: "parser",
parser: gadget.props.rss_list[i].parser,
sub_storage: {
type: "http"
},
document_id: 'ERP5Site_getHTTPResource?url=' + gadget.props.rss_list[i].url,
attachment_id: 'enclosure'
}
})
);
}
return RSVP.all(list);
});
});
}(window, rJS, RSVP, URL));
\ No newline at end of file
......@@ -335,7 +335,7 @@
</item>
<item>
<key> <string>configuration_frontpage_gadget_url</string> </key>
<value> <string>worklist</string> </value>
<value> <string>home</string> </value>
</item>
<item>
<key> <string>configuration_hateoas_url</string> </key>
......@@ -600,7 +600,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.19244.13768.6758</string> </value>
<value> <string>966.44125.1058.13038</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -618,8 +618,8 @@
</tuple>
<state>
<tuple>
<float>1517843997.55</float>
<string>UTC</string>
<float>1523018790.06</float>
<string>GMT+2</string>
</tuple>
</state>
</object>
......
......@@ -941,7 +941,9 @@ div[data-gadget-scope='header'] .ui-header {
background-color: lighten(@colorheaderbackground, 20%);
}
}
.ui-active-tab {
background-color: lighten(@colorheaderbackground, 20%);
}
.ui-controlgroup-controls {
// Left, right button next to the page title
......@@ -957,7 +959,7 @@ div[data-gadget-scope='header'] .ui-header {
}
transition: background-color @transition-timing;
&:hover, &:active {
&:hover, &:active, &.ui-active-tab {
background-color: lighten(@colorheaderbackground, 20%);
}
......@@ -3419,4 +3421,4 @@ hmtl .ui-icon-carat-u::before{
}
.ui-icon-clone::before {
content: "\f24d";
}
}
\ No newline at end of file
erp5_hal_json_style
erp5_dms
erp5_font
\ No newline at end of file
erp5_font
erp5_http_proxy
\ No newline at end of file
......@@ -42,7 +42,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -42,7 +42,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -37,7 +37,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -42,7 +42,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -37,7 +37,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -92,15 +92,11 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Worklist</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ No newline at end of file
......@@ -38,7 +38,7 @@
<tal:block metal:use-macro="here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded" />
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
......
......@@ -235,7 +235,7 @@
</tr>
<tr>
<td>waitForElementPresent</td>
<td>//h1//a[@data-i18n='Worklist']</td>
<td>//a[@data-i18n='RSS']</td>
<td></td>
</tr>
......
......@@ -20,12 +20,12 @@
<!-- Module are displayed with form_list by default -->
<tr>
<td>waitForElementPresent</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_worklist.html']</td>
<td>//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_rss_reader.html']</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
<td>Worklist</td>
<td>RSS</td>
<td></td>
</tr>
......
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