mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 15:13:21 +08:00
22 lines
773 B
Text
22 lines
773 B
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>
|
|
|
|
<% end %>
|
|
<% if protocol.archived? %>
|
|
<span class="label label-warning">
|
|
<%= t('search.index.archived') %>
|
|
</span>
|
|
|
|
<% end %>
|
|
<% if protocol.in_module? && can_read_protocol_in_module?(protocol) %>
|
|
<%= link_to text, protocols_my_module_path(protocol.my_module) %>
|
|
<% elsif protocol.in_repository? && can_read_protocol_in_repository?(protocol) %>
|
|
<%= link_to text, protocol_path(protocol) %>
|
|
<% else %>
|
|
<%= text %>
|
|
<% end %>
|