2016-07-21 19:11:15 +08:00
|
|
|
<% query ||= nil %>
|
2023-03-17 17:43:50 +08:00
|
|
|
<% text = query.present? ? highlight(escape_input(protocol.name), query.strip.split(/\s+/)) : (protocol.name.blank? ? t('search.index.no_name') : escape_input(protocol.name)) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
|
2023-03-17 17:43:50 +08:00
|
|
|
<% if protocol.in_repository? %>
|
2017-01-06 01:08:59 +08:00
|
|
|
<span class="label label-info">
|
2023-03-17 17:43:50 +08:00
|
|
|
<%= t('search.index.in_repository') %>
|
2017-01-06 01:08:59 +08:00
|
|
|
</span>
|
|
|
|
|
2023-03-17 17:43:50 +08:00
|
|
|
<% end %>
|
|
|
|
<% if protocol.archived? %>
|
2017-01-06 01:08:59 +08:00
|
|
|
<span class="label label-warning">
|
2023-03-17 17:43:50 +08:00
|
|
|
<%= t('search.index.archived') %>
|
2017-01-06 01:08:59 +08:00
|
|
|
</span>
|
|
|
|
|
|
|
|
<% end %>
|
2023-03-27 16:50:09 +08:00
|
|
|
<% 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) %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
2017-01-06 01:08:59 +08:00
|
|
|
<%= text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% end %>
|