Commit 5221300c authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_officejs: Display selected storage in jIO configurator

parent 76c44a5f
...@@ -67,6 +67,9 @@ ...@@ -67,6 +67,9 @@
} }
}; };
return gadget.setSetting('jio_storage_description', configuration) return gadget.setSetting('jio_storage_description', configuration)
.push(function () {
return gadget.setSetting('jio_storage_name', "LOCAL");
})
.push(function () { .push(function () {
return gadget.reload(); return gadget.reload();
}); });
...@@ -98,12 +101,23 @@ ...@@ -98,12 +101,23 @@
return gadget.updateHeader({ return gadget.updateHeader({
title: "Storage Configuration" title: "Storage Configuration"
}).push(function () { }).push(function () {
return gadget.getSetting('jio_storage_description'); return gadget.getSetting('jio_storage_name');
}).push(function (jio_storage_description) { }).push(function (jio_storage_name) {
if (jio_storage_description === undefined) { switch (jio_storage_name) {
case "ERP5":
gadget.props.element.querySelector("form.select-erp5-form button").classList.add("ui-btn-active");
break;
case "DAV":
gadget.props.element.querySelector("form.select-dav-form button").classList.add("ui-btn-active");
break;
case "LOCAL":
gadget.props.element.querySelector("form.select-local-form button").classList.add("ui-btn-active");
break;
default:
gadget.props.element.querySelector(".message h3").appendChild(document.createTextNode("Welcome! Please start by choosing a storage:")); gadget.props.element.querySelector(".message h3").appendChild(document.createTextNode("Welcome! Please start by choosing a storage:"));
gadget.props.element.querySelector(".message").setAttribute("style", ""); gadget.props.element.querySelector(".message").setAttribute("style", "");
gadget.props.element.querySelector(".document-access").setAttribute("style", "display: none;"); gadget.props.element.querySelector(".document-access").setAttribute("style", "display: none;");
break;
} }
return; return;
}).push(function () { }).push(function () {
......
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