Merge pull request #859 from Zanz2/p_succ_msg_SCI-1694

Protocols.io import success flash messagge [SCI-1694]
This commit is contained in:
Zanz2 2017-11-09 15:23:47 +01:00 committed by GitHub
commit 60da9d136c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View file

@ -28,10 +28,6 @@
<strong><%= t('protocols.protocols_io_import.preview.guideln') %></strong>
<%= sanitize_input(json_object['guidelines'].html_safe) %><br>
<% end %>
<% if json_object['link'].present? %>
<strong><%= t('protocols.protocols_io_import.preview.p_link') %></strong>
<%= sanitize_input(json_object['link'].html_safe) %><br>
<% end %>
<% if json_object['manuscript_citation'].present? %>
<strong><%= t('protocols.protocols_io_import.preview.manu_cit') %></strong>
<%= sanitize_input(json_object['manuscript_citation'].html_safe) %><br>
@ -58,6 +54,10 @@
<%= sanitize_input(tag['tag_name'])+' , ' %><br>
<% end %>
<% end %>
<% if json_object['link'].present? %>
<strong><%= t('protocols.protocols_io_import.preview.p_link') %></strong>
<%= sanitize_input(json_object['link'].html_safe) %><br>
<% end %>
</div>
</div>
</div>

View file

@ -1,7 +1,8 @@
<% if @protocolsio_too_big %>
alert('<%= I18n.t('my_modules.protocols.load_from_file_size_error',
size: Constants::FILE_MAX_SIZE_MB ) %>');
$('#modal-import-json-protocol').modal('hide');
HelperModule.flashAlertMsg(' <%= t('my_modules.protocols.load_from_file_size_error',
size: Constants::FILE_MAX_SIZE_MB ) %>','danger');
<% else %>
$('#modal-import-json-protocol').modal('hide');
<% if remotipart_submitted? %> <%# a workaround to a bug with remotipart, that caused alot of headache, courtesy of github.com/dhampik %>

View file

@ -1,8 +1,10 @@
<% if @protocolsio_general_error %>
alert('<%= I18n.t('my_modules.protocols.load_from_file_protocol_general_error',
$('#modal-import-json-protocol-preview').modal('hide');
alert(' <%= t('my_modules.protocols.load_from_file_protocol_general_error',
max: Constants::NAME_MAX_LENGTH, min: Constants::NAME_MIN_LENGTH) %>');
<% else %>
$('#modal-import-json-protocol-preview').modal('hide');
$('#protocols_io_form').trigger("reset");
protocolsDatatable.ajax.reload();
HelperModule.flashAlertMsg(' <%= t('protocols.index.import_results.message_ok_pio')%>', 'success');
<% end %>

View file

@ -1385,7 +1385,7 @@ en:
b_s_p: "Before starting protocol information:"
warn: "Protocol warning:"
guideln: "Guidelines:"
p_link: "Supplied link:"
p_link: "Link:"
s_nobr_link: "Link:"
s_link: "Link:"
s_desc: "Description:"
@ -1555,6 +1555,7 @@ en:
title: "Import results"
message_failed: "Failed to import %{nr} protocol/s."
message_ok: "Successfully imported %{nr} protocol/s."
message_ok_pio: "Successfully imported protocol from protocols.io file."
row_success: "Imported"
row_renamed: "Imported & renamed"
row_failed: "Failed"