Commit b86ea801 authored by Roque's avatar Roque

erp5_officejs: panel update to handle about page

parent a802f521
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.63498.47896.7901</string> </value>
<value> <string>1001.7199.47519.37307</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1574423725.43</float>
<float>1658943004.35</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -86,6 +86,7 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlForList", "getUrlForList")
.declareAcquiredMethod("getSetting", "getSetting")
/////////////////////////////////////////////////////////////////
// declared methods
......@@ -127,7 +128,10 @@
view_list: view_list,
global: true,
view_action_dict: options.view_action_dict || false,
editable: options.editable || editable || false
editable: options.editable || editable || false,
// force render to refresh the menus
render_timestamp: new Date().getTime(),
first_render: true
});
});
})
......@@ -136,7 +140,8 @@
var context = this,
gadget = this,
queue = new RSVP.Queue(),
tmp_element;
tmp_element,
about_page;
if (modification_dict.hasOwnProperty("visible")) {
if (this.state.visible) {
......@@ -150,6 +155,14 @@
}
}
queue
.push(function () {
return gadget.getSetting('about_page');
})
.push(function (setting) {
about_page = setting;
});
if (modification_dict.hasOwnProperty("global")) {
queue
.push(function () {
......@@ -182,30 +195,39 @@
});
}
if (modification_dict.hasOwnProperty("editable")) {
queue
// Update the global links
.push(function () {
return RSVP.all([
context.getUrlFor({command: 'display'}),
context.getUrlFor({command: 'display', options: {page: "ojs_configurator"}}),
context.getUrlFor({command: 'display', options: {page: "ojs_sync", 'auto_repair': true}})
]);
})
.push(function (result_list) {
return context.translateHtml(
panel_template_body_list({
"document_list_href": result_list[0],
"storage_href": result_list[1],
"sync_href": result_list[2]
})
);
})
queue
// Update the global links
.push(function () {
return RSVP.all([
context.getUrlFor({command: 'display'}),
context.getUrlFor({command: 'display', options: {page: "ojs_configurator"}}),
context.getUrlFor({command: 'display', options: {page: about_page}}),
context.getUrlFor({command: 'display', options: {page: "ojs_sync", 'auto_repair': true}})
]);
})
.push(function (result_list) {
return context.translateHtml(
panel_template_body_list({
"document_list_href": result_list[0],
"storage_href": result_list[1],
"about_href": result_list[2],
"sync_href": result_list[3]
})
);
})
.push(function (result) {
context.element.querySelector("ul").innerHTML = result;
});
}
.push(function (result) {
context.element.querySelector("ul").innerHTML = result;
})
.push(function () {
if (!about_page) {
context.element.querySelector("#about_page_li")
.style.display = 'none';
} else {
context.element.querySelector("#about_page_li")
.style.display = 'block';
}
});
if ((this.state.global === true) &&
(modification_dict.hasOwnProperty("desktop") ||
......@@ -285,9 +307,8 @@
]);
})
.push(function (view_action_list) {
var dl_element,
var dl_element = gadget.element.querySelector("dl"),
dl_fragment = document.createDocumentFragment();
dl_element = gadget.element.querySelector("dl");
while (dl_element.firstChild) {
dl_element.removeChild(dl_element.firstChild);
}
......
......@@ -231,7 +231,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>989.27524.31537.13687</string> </value>
<value> <string>1001.57742.17876.27579</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -249,7 +249,7 @@
</tuple>
<state>
<tuple>
<float>1613148260.92</float>
<float>1658943108.94</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -43,6 +43,7 @@
<script id="panel-template-body-list" type="text/x-handlebars-template">
<li class="ui-first-child"><a href="{{document_list_href}}" class="ui-btn ui-btn-icon-left ui-icon-search" data-i18n="Document" accesskey="s">Document</a></li>
<li><a href="{{sync_href}}" class="ui-btn ui-btn-icon-left ui-icon-refresh" data-i18n="Synchronize">Synchronize</a></li>
<li id="about_page_li"><a href="{{about_href}}" class="ui-btn ui-btn-icon-left ui-icon-question-circle" data-i18n="About">About</a></li>
<li class="ui-last-child"><a href="{{storage_href}}" class="ui-btn ui-btn-icon-left ui-icon-gear" data-i18n="Storages">Storages</a></li>
</script>
......
......@@ -235,7 +235,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.53350.54566.5802</string> </value>
<value> <string>1001.4391.61246.43042</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1573813812.11</float>
<float>1655913247.73</float>
<string>UTC</string>
</tuple>
</state>
......
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