Merge pull request #965 from Zanz2/sub_prot_2short_SCI1995

Changed sub protocol name length limit to limit of protocol titles on scinote [SCI-1995]
This commit is contained in:
Zanz2 2018-01-26 15:08:03 +01:00 committed by GitHub
commit a15e624b06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -175,9 +175,13 @@ module ProtocolsIoHelper
else
' , '
end
output_string += prepare_for_view(
attribute_text, ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL
)
if attribute_name == 'protocol_name'
output_string += pio_eval_title_len(attribute_text)
else
output_string += prepare_for_view(
attribute_text, ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL
)
end
output_string
end

View file

@ -98,7 +98,7 @@
<% when '18'%>
<br>
<strong><%= t('protocols.protocols_io_import.preview.sub_prot') %></strong>
<%= prepare_for_view(key['source_data']['protocol_name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<%= pio_eval_title_len(sanitize_input(key['source_data']['protocol_name'])).html_safe %>
<br>
<%= t('protocols.protocols_io_import.preview.auth') %>
<%= prepare_for_view(key['source_data']['full_name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>