Add command/subprotocol/safety for PIO

This commit is contained in:
Jure Grabnar 2018-11-23 20:13:34 +01:00
parent c00b08b101
commit 2834edb286
3 changed files with 30 additions and 28 deletions

View file

@ -467,21 +467,21 @@ module ProtocolsIoHelper
pe_array = %w( pe_array = %w(
name description os_name os_version name description os_name os_version
) )
key['source_data']['name'] = key['source']['name'] =
'<pre><code>' + '<pre><code>' +
not_null(key['source_data']['name'].gsub(/\n/, '<br>')) + not_null(key['source']['name'].gsub(/\n/, '<br>')) +
'</code></pre>' '</code></pre>'
trans_text = 'protocols.protocols_io_import.comp_append.command.' trans_text = 'protocols.protocols_io_import.comp_append.command.'
newj[i.to_s]['description'] += pio_stp( newj[i.to_s]['description'] += pio_stp(
key['source_data'], pe_array, trans_text key['source'], pe_array, trans_text
) )
when 18 when 18
pe_array = %w( pe_array = %w(
protocol_name full_name link title title_html uri
) )
trans_text = 'protocols.protocols_io_import.comp_append.sub_protocol.' trans_text = 'protocols.protocols_io_import.comp_append.sub_protocol.'
newj[i.to_s]['description'] += pio_stp( newj[i.to_s]['description'] += pio_stp(
key['source_data'], pe_array, trans_text key['source'], pe_array, trans_text
) )
when 19 when 19
pe_array = %w( pe_array = %w(
@ -489,7 +489,7 @@ module ProtocolsIoHelper
) )
trans_text = 'protocols.protocols_io_import.comp_append.safety_infor.' trans_text = 'protocols.protocols_io_import.comp_append.safety_infor.'
newj[i.to_s]['description'] += pio_stp( newj[i.to_s]['description'] += pio_stp(
key['source_data'], pe_array, trans_text key['source'], pe_array, trans_text
) )
end # case end end # case end
end # finished looping over step components end # finished looping over step components

View file

@ -85,43 +85,43 @@
<% when 9 %> <% when 9 %>
<% step_info_string += not_null(key['source']['name']).html_safe %> <% step_info_string += not_null(key['source']['name']).html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.dataset_name') %> <%= t('protocols.protocols_io_import.preview.dataset_name').html_safe %>
<%= prepare_for_view(key['source']['name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.s_link') %> <%= t('protocols.protocols_io_import.preview.s_link') %>
<%= prepare_for_view(key['source']['link'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['link'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<% when 15 %> <% when 15 %>
<% step_info_string += not_null(key['source_data']['description']) %> <% step_info_string += not_null(key['source']['description']) %>
<br> <br>
<strong><%= key['name']+': ' %></strong> <%= t('protocols.protocols_io_import.preview.command_name').html_safe %>
<%= prepare_for_view('<pre><code>'+key['source_data']['name'].gsub(/\n/, '<br>')+'</code></pre>',ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view('<pre><code>'+key['source']['name'].gsub(/\n/, '<br>')+'</code></pre>',ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.s_desc') %> <%= t('protocols.protocols_io_import.preview.s_desc') %>
<%= prepare_for_view(key['source_data']['description'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['description'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.os') %> <%= t('protocols.protocols_io_import.preview.os') %>
<%= prepare_for_view(key['source_data']['os_name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe + ' , ' + <%= prepare_for_view(key['source']['os_name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe + ' , ' +
prepare_for_view(key['source_data']['os_version'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> prepare_for_view(key['source']['os_version'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<% when 18 %> <% when 18 %>
<br> <br>
<strong><%= t('protocols.protocols_io_import.preview.sub_prot') %></strong> <%= t('protocols.protocols_io_import.preview.sub_prot').html_safe %>
<%= pio_eval_title_len(sanitize_input(key['source_data']['protocol_name'])).html_safe %> <%= pio_eval_title_len(sanitize_input(key['source']['title'])).html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.auth') %> <%= t('protocols.protocols_io_import.preview.auth') %>
<%= prepare_for_view(key['source_data']['full_name'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['title_html'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<br> <br>
<% if key['source_data']['link'].present? %> <% if key['source']['uri'].present? %>
<%= t('protocols.protocols_io_import.preview.s_nobr_link') %> <%= t('protocols.protocols_io_import.preview.s_nobr_link') %>
<%= prepare_for_view(key['source_data']['link'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['uri'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<% end %> <% end %>
<% when 19 %> <% when 19 %>
<% step_info_string += not_null(key['source_data']['body']) %> <% step_info_string += not_null(key['source']['body']) %>
<br> <br>
<strong><%= not_null(key['name'])+': ' %></strong> <%= t('protocols.protocols_io_import.preview.safety_info').html_safe %>
<%= prepare_for_view(key['source_data']['body'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['body'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<br> <br>
<%= t('protocols.protocols_io_import.preview.s_link') %> <%= t('protocols.protocols_io_import.preview.s_link') %>
<%= prepare_for_view(key['source_data']['link'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %> <%= prepare_for_view(key['source']['link'],ProtocolsIoHelper::PIO_ELEMENT_RESERVED_LENGTH_SMALL,'table').html_safe %>
<% else %> <% else %>
<% end #case if%> <% end #case if%>
<% end #inner if%> <% end #inner if%>

View file

@ -1547,14 +1547,16 @@ en:
s_desc: "Description:" s_desc: "Description:"
strng_s_desc: "Description:" strng_s_desc: "Description:"
s_exp_res: "Expected result:" s_exp_res: "Expected result:"
sw_name: "Software package:" sw_name: "<strong>Software package:</strong>"
dev: "Developer:" dev: "Developer:"
vers: "Version:" vers: "Version:"
repo: "Repository:" repo: "Repository:"
os: "OS name , OS version:" os: "OS name , OS version:"
sub_prot: "This protocol also contains an attached sub-protocol:" command_name: "<strong>Command:</strong>"
sub_prot: "<strong>This protocol also contains an attached sub-protocol:</strong>"
safety_info: "<strong>Safety information:</strong>"
auth: "Author:" auth: "Author:"
dataset_name: "Dataset:" dataset_name: "<strong>Dataset:</strong>"
manuscript_citation: "Manuscript citation:" manuscript_citation: "Manuscript citation:"
published_on: "Publish date:" published_on: "Publish date:"
vendor_name: "Vendor name:" vendor_name: "Vendor name:"
@ -1582,9 +1584,9 @@ en:
description: "<br>Description: " description: "<br>Description: "
os: "<br>OS name , OS version: " os: "<br>OS name , OS version: "
sub_protocol: sub_protocol:
protocol_name: "<br><strong>This step also contains an attached sub-protocol: </strong>" title: "<br><strong>This step also contains an attached sub-protocol: </strong>"
full_name: "<br>Author: " title_html: "<br>Author: "
link: "<br>Link: " uri: "<br>Link: "
safety_infor: safety_infor:
body: "<br><strong>Safety information: </strong>" body: "<br><strong>Safety information: </strong>"
link: "<br>Link: " link: "<br>Link: "