mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-04 12:14:37 +08:00
clean up linked protocol
This commit is contained in:
parent
6b17385f3a
commit
852fe499fb
5 changed files with 26 additions and 15 deletions
|
@ -334,15 +334,24 @@ function importProtocolFromFile(
|
|||
if (importIntoProtocol && !confirm(I18n.t("protocols.import_export.import_modal.import_into_protocol_confirm"))) {
|
||||
importModal.modal("hide");
|
||||
} else {
|
||||
// Show spinner
|
||||
animateSpinner(importModal);
|
||||
|
||||
importSingleProtocol(currentProtocol, false, function(data) {
|
||||
animateSpinner(importModal, false);
|
||||
importModal.find("[data-role='preview-container']").html("");
|
||||
importModal.modal("hide");
|
||||
afterImportCallback([data]);
|
||||
});
|
||||
var path = new RegExp("modules");
|
||||
if( path.test( window.location.href ) ){
|
||||
importSingleProtocol(currentProtocol, false, function(data) {
|
||||
importModal.find("[data-role='preview-container']").html("");
|
||||
afterImportCallback([data]);
|
||||
});
|
||||
|
||||
} else {
|
||||
// Show spinner
|
||||
animateSpinner(importModal);
|
||||
importSingleProtocol(currentProtocol, false, function(data) {
|
||||
animateSpinner(importModal, false);
|
||||
importModal.find("[data-role='preview-container']").html("");
|
||||
importModal.modal("hide");
|
||||
afterImportCallback([data]);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -525,4 +534,4 @@ function importProtocolFromFile(
|
|||
}
|
||||
};
|
||||
fileReader.readAsArrayBuffer(fileHandle);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -934,4 +934,4 @@ class ProtocolsController < ApplicationController
|
|||
params.require(:protocol).permit(:name, :authors, :description)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,7 +36,9 @@ module ProtocolsImporter
|
|||
populate_protocol(protocol, protocol_json, user)
|
||||
protocol.reload
|
||||
|
||||
return protocol
|
||||
# Unlink the protocol
|
||||
protocol.unlink
|
||||
protocol
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -136,4 +138,4 @@ module ProtocolsImporter
|
|||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="panel panel-default panel-protocol-status">
|
||||
<div class="panel-body">
|
||||
<div class="panel-body">
|
||||
<% if @protocol.linked? %>
|
||||
<%= protocol_status_href(@protocol) %>
|
||||
<% else %>
|
||||
|
@ -9,4 +9,4 @@
|
|||
<%= render partial: "my_modules/protocols/protocol_status_bar_buttons.html.erb" %>
|
||||
</div>
|
||||
</div>
|
||||
<%= javascript_include_tag("my_modules/protocols/protocol_status_bar") %>
|
||||
<%= javascript_include_tag("my_modules/protocols/protocol_status_bar") %>
|
||||
|
|
|
@ -578,7 +578,7 @@ en:
|
|||
load_protocol_from_repository: "from repository"
|
||||
load_protocol_from_file: "from file"
|
||||
export: "Export protocol"
|
||||
copy_to_repository: "Copy protocol to repository"
|
||||
copy_to_repository: "Save to protocol repository"
|
||||
confirm_link_update_modal:
|
||||
unlink_title: "Unlink protocol"
|
||||
unlink_message: "Are you sure you want to unlink the task protocol from the repository version? This will stop any tracking of changes."
|
||||
|
|
Loading…
Add table
Reference in a new issue