% query ||= nil %>
<% text = query.present? ? highlight(protocol.name, query.strip.split(/\s+/)) : (protocol.name.empty? ? t("search.index.no_name") : protocol.name) %>
<% if protocol.in_repository_public? %>
<%=t "search.index.public" %>
<% elsif protocol.in_repository_private? %>
<%=t "search.index.private" %>
<% elsif protocol.in_repository_archived? %>
<%=t "search.index.archived" %>
<% end %>
<% if can_read_protocol_in_module?(protocol) || can_read_protocol_in_repository?(protocol) %>
<%= link_to text, '#', 'data-action': 'protocol-preview', 'data-url': preview_protocol_path(protocol) %>
<% else %>
<%= text %>
<% end %>