2018-02-07 18:17:53 +08:00
|
|
|
$('#modal-import-json-protocol').on('hidden.bs.modal', function () {
|
|
|
|
$('#pio_no_file_error_span').empty();
|
|
|
|
})
|
2017-09-22 17:56:50 +08:00
|
|
|
<% if @protocolsio_too_big %>
|
2017-10-27 06:17:42 +08:00
|
|
|
$('#modal-import-json-protocol').modal('hide');
|
2018-07-05 21:23:26 +08:00
|
|
|
HelperModule.flashAlertMsg(I18n.t('my_modules.protocols.load_from_file_size_error',
|
2019-08-06 21:06:19 +08:00
|
|
|
{ size: GLOBAL_CONSTANTS.FILE_MAX_SIZE_MB ) }, 'danger');
|
2018-11-24 03:47:48 +08:00
|
|
|
<% elsif @protocolsio_general_error %>
|
|
|
|
$('#pio_no_file_error_span').addClass('has-error').html('<span class="help-block"> <%= t('protocols.import_export.load_file_error') %></span>');
|
2017-11-14 19:02:17 +08:00
|
|
|
<% elsif @protocolsio_invalid_file %>
|
|
|
|
$('#modal-import-json-protocol').modal('hide');
|
|
|
|
HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_invalid_error') %>','danger');
|
2018-02-07 18:17:53 +08:00
|
|
|
<% elsif @protocolsio_no_file %>
|
|
|
|
$('#pio_no_file_error_span').addClass('has-error').html('<span class="help-block"> <%= t('teams.parse_sheet.errors.no_file_selected') %></span>');
|
|
|
|
<% @protocolsio_no_file = false %>
|
2017-09-19 22:07:54 +08:00
|
|
|
<% else %>
|
2017-09-22 17:56:50 +08:00
|
|
|
$('#modal-import-json-protocol').modal('hide');
|
2018-04-03 01:56:25 +08:00
|
|
|
$('#protocolsio-preview-modal-target').html(
|
|
|
|
"<%= j render(:partial => 'protocols/import_export/import_json_protocol_preview_modal') %>"
|
|
|
|
);
|
|
|
|
$('#modal-import-json-protocol-preview').modal('show');
|
|
|
|
$('.modal').on('hidden.bs.modal', function (e) {
|
|
|
|
if($('.modal').hasClass('in')) {
|
|
|
|
$('body').addClass('modal-open');
|
|
|
|
}
|
|
|
|
});
|
2017-09-22 17:56:50 +08:00
|
|
|
<% end %>
|
2018-04-03 01:56:25 +08:00
|
|
|
$("#protocols_io_form")[0].reset();
|
|
|
|
$('#protocols_io_form').trigger("reset");
|