Now protocols name from attached protocol is shortened based on title limit length (255 characters),also has same limitations as scinote title

This commit is contained in:
Zanz2 2018-01-26 10:49:38 +01:00
parent e484f0569b
commit 6f56f829da
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 %>