mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
changed import label [fixes SCI-317]
This commit is contained in:
parent
852fe499fb
commit
5e647f62d5
2 changed files with 20 additions and 3 deletions
|
@ -331,12 +331,23 @@ function importProtocolFromFile(
|
||||||
|
|
||||||
function importCurrentProtocol() {
|
function importCurrentProtocol() {
|
||||||
// Check for confirmation first
|
// Check for confirmation first
|
||||||
if (importIntoProtocol && !confirm(I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm"))) {
|
var path = new RegExp("modules");
|
||||||
|
var check_linked = $("[data-role='protocol-status-bar']")
|
||||||
|
.text();
|
||||||
|
if( path.test( window.location.href ) && check_linked === '(unlinked)' ){
|
||||||
|
console.log("linked");
|
||||||
|
confirm_message = I18n.t("protocols.import_export.import_modal.import_to_linked_task");
|
||||||
|
} else {
|
||||||
|
console.log("unlinked");
|
||||||
|
confirm_message = I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (importIntoProtocol && !confirm(confirm_message)) {
|
||||||
importModal.modal("hide");
|
importModal.modal("hide");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var path = new RegExp("modules");
|
|
||||||
if( path.test( window.location.href ) ){
|
if( path.test( window.location.href ) ){
|
||||||
|
animateSpinner();
|
||||||
importSingleProtocol(currentProtocol, false, function(data) {
|
importSingleProtocol(currentProtocol, false, function(data) {
|
||||||
importModal.find("[data-role='preview-container']").html("");
|
importModal.find("[data-role='preview-container']").html("");
|
||||||
afterImportCallback([data]);
|
afterImportCallback([data]);
|
||||||
|
@ -504,6 +515,11 @@ function importProtocolFromFile(
|
||||||
},
|
},
|
||||||
error: function(ev) {
|
error: function(ev) {
|
||||||
resultCallback(ev.responseJSON);
|
resultCallback(ev.responseJSON);
|
||||||
|
|
||||||
|
var path = new RegExp("modules");
|
||||||
|
if( path.test( window.location.href ) ){
|
||||||
|
animateSpinner(null, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1135,7 +1135,8 @@ en:
|
||||||
title_import: "Import protocol/s"
|
title_import: "Import protocol/s"
|
||||||
title_import_into_protocol: "Load protocol from file"
|
title_import_into_protocol: "Load protocol from file"
|
||||||
import_into_protocol_message: "This will overwrite the current protocol!"
|
import_into_protocol_message: "This will overwrite the current protocol!"
|
||||||
import_into_protocol_confirm: "Are you sure you wish to load protocol from repository? This action will overwrite the current protocol."
|
import_into_protocol_confirm: "Are you sure you wish to load protocol? This action will overwrite the current protocol."
|
||||||
|
import_to_linked_task: "Are you sure you wish to load protocol from repository? This action will overwrite the current protocol in the task and un-link it from repository. The current protocol will remain unchanged in repository."
|
||||||
name_label: "Protocol name"
|
name_label: "Protocol name"
|
||||||
authors_label: "Authors"
|
authors_label: "Authors"
|
||||||
description_label: "Description"
|
description_label: "Description"
|
||||||
|
|
Loading…
Add table
Reference in a new issue