scinote-web/app/views/search/results/partials/_protocol_text.html.erb

29 lines
1 KiB
Text

<% query ||= nil %>
<% text = query.present? ? highlight(escape_input(protocol.name), query.strip.split(/\s+/)) : (protocol.name.blank? ? t('search.index.no_name') : escape_input(protocol.name)) %>
<% if protocol.in_repository? %>
<span class="label label-info">
<%= t('search.index.in_repository') %>
</span>
&nbsp;
<% end %>
<% if protocol.archived? %>
<span class="label label-warning">
<%= t('search.index.archived') %>
</span>
&nbsp;
<% end %>
<% if protocol.in_module? && can_read_protocol_in_module?(protocol) || protocol.in_repository? && can_read_protocol_in_repository?(protocol) %>
<%= link_to text, '#', 'data-action': 'protocol-preview', 'data-url': preview_protocol_path(protocol) %>
<%= javascript_include_tag "handsontable.full" %>
<!-- Libraries for formulas -->
<%= render partial: "shared/formulas_libraries.html.erb" %>
<%= stylesheet_link_tag 'datatables' %>
<%= javascript_include_tag "protocols/index" %>
<%= javascript_include_tag "protocols/steps" %>
<% else %>
<%= text %>
<% end %>