Commit 4296e4af by Roque

erp5_web_project_ui: project web page as non editable gadget editor

1 parent b32b8844
......@@ -75,7 +75,7 @@ input[type="submit"] {
padding: 6pt;
margin-top: 30pt;
margin-right: 6pt;
background-color: #00a616;
background-color: #aaabbb;
color: #FFFFFF;
border-radius: 0.325em;
border-width: 1px;
......@@ -83,6 +83,18 @@ input[type="submit"] {
min-width: 8em;
}
.gadget-content span.pass {
background-color: #00a616;
}
.gadget-content span.fail {
background-color: #ff0400;
}
.gadget-content span.test-result a {
color: #FFFFFF;
}
.worklist-title {
color: #777777;
margin-top: 10px;
......
......@@ -40,7 +40,8 @@
</div>
<div class="ui-field-contain" style="top:150px;">
<p>
<a id="task_link" class="first-line-buttons ui-disabled" data-i18n="[value]Tasks" disabled >Tasks</a>
<a id="task_link" class="first-line-buttons ui-disabled" data-i18n="[value]Confirmed Tasks" disabled >Confirmed Tasks</a>
<a id="not_confirmed_task_link" class="first-line-buttons ui-disabled" data-i18n="[value]Not Confirmed Tasks" disabled >Not Confirmed Tasks</a>
</p>
</div>
<div class="ui-field-contain" style="top:200px;">
......@@ -57,13 +58,14 @@
</div>
<div class="ui-field-contain" style="top:300px;">
<p>
<a id="test_result_link" class="first-line-buttons ui-disabled" data-i18n="[value]Last test result" disabled >Last test result:</a>
<span id="last_test_result" class="test-result" style="margin-right:10px;">...</span>
<span id="test_result_span" class="test-result" style="margin-right:10px;">
<a id="test_result_link" data-i18n="[value]Last test result" disabled >Last test result</a>
</span>
<a id="test_suite_link" class="first-line-buttons ui-disabled" data-i18n="[value]Test suite" disabled >Test suite</a>
</p>
</div>
<div class="ui-field-contain" style="top:350px;">
<div id="home_page_content"></div>
<div data-gadget-url="gadget_editor.html" data-gadget-scope="editor"></div>
</div>
</body>
......
......@@ -37,7 +37,11 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
return promise;
})
.push(function (result) {
span_element.innerHTML = result;
if (result[0] === "1") {
span_element.classList.add("pass");
} else {
span_element.classList.add("fail");
}
});
}
......@@ -81,46 +85,40 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
project_url = base_site + modification_dict.jio_key,
// REPLACE THIS AJAX REQUEST WITH JIO
last_test_result_promise = generateAjaxPromise(project_url + "/Project_lastTestResult");
setHTMLWithPromiseResult(document.getElementById("last_test_result"), last_test_result_promise);
document.getElementById("home_page_content").innerHTML = modification_dict.home_page_content;
setHTMLWithPromiseResult(document.getElementById("test_result_span"), last_test_result_promise);
return gadget.jio_getAttachment(modification_dict.jio_key, "links")
.push(function (erp5_document) {
var milestone_view = getActionListByName(ensureArray(erp5_document._links.view), "milestone");
return gadget.getUrlForList([getUrlParameters('milestone_module', milestone_view, [["stop_date", "ascending"]]),
getUrlParameters('task_module', "view", [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "delivery.stop_date", "destination_decision_title",
"source_title", "destination_title", "total_quantity", "task_line_quantity_unit_title"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_task_domain: "confirmed"')),
getUrlParameters('support_request_module', "view", [["delivery.start_date", "descending"]],
null, ('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_support_domain: "validated"')),
getUrlParameters('bug_module', "view", [["delivery.start_date", "descending"]],
["title", "description", "delivery.start_date"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_bug_domain: "started"')),
getUrlParameters('bug_module', "view", [["delivery.start_date", "descending"]],
["title", "description", "delivery.start_date"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_bug_domain: "closed"')),
getUrlParameters('task_report_module', 'view', [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "delivery.stop_date", "destination_decision_title",
"source_title", "destination_title", "total_quantity", "task_line_quantity_unit_title"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_task_report_domain: "started"')),
getUrlParameters('task_report_module', 'view', [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "delivery.stop_date", "destination_decision_title",
"source_title", "destination_title", "total_quantity", "task_line_quantity_unit_title"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_task_report_domain: "closed"')),
getUrlParameters('test_result_module', 'view', [["delivery.start_date", "descending"]],
null, ('source_project_title: "' + modification_dict.project_title + '"')),
getUrlParameters('test_suite_module', 'view', [["creation_date", "descending"]],
null, ('source_project_title: "' + modification_dict.project_title + '"')) ]);
null, ('source_project_title: "' + modification_dict.project_title + '"')),
getUrlParameters('task_module', "view", [["delivery.start_date", "descending"]],
["title", "delivery.start_date", "delivery.stop_date", "destination_decision_title",
"source_title", "destination_title", "total_quantity", "task_line_quantity_unit_title"],
('source_project_title: "' + modification_dict.project_title + '" AND selection_domain_state_task_domain: "not_confirmed"')) ]);
})
.push(function (url_list) {
enableLink(document.getElementById("milestone_link"), url_list[0]);
......@@ -132,6 +130,12 @@ lockGadgetInQueue, unlockGadgetInQueue, Handlebars*/
enableLink(document.getElementById("closed_report_link"), url_list[6]);
enableLink(document.getElementById("test_result_link"), url_list[7]);
enableLink(document.getElementById("test_suite_link"), url_list[8]);
enableLink(document.getElementById("not_confirmed_task_link"), url_list[9]);
return gadget.getDeclaredGadget("editor");
})
.push(function (editor) {
editor.render({"editor": "fck_editor", "editable": false, "value": modification_dict.home_page_content});
});
})
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!