2016-07-21 19:11:15 +08:00
|
|
|
<% 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_module? %>
|
|
|
|
<span class="label label-info">
|
|
|
|
<span class="glyphicon glyphicon-credit-card"></span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<% if can_view_steps_in_protocol(protocol) %>
|
2016-10-11 22:16:48 +08:00
|
|
|
<%= route_to_other_org protocols_my_module_path(protocol.my_module),
|
|
|
|
protocol.organization,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% else %>
|
|
|
|
<% if protocol.in_repository_public? %>
|
|
|
|
<span class="label label-info">
|
|
|
|
<%=t "search.index.public" %>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<% elsif protocol.in_repository_private? %>
|
|
|
|
<span class="label label-info">
|
|
|
|
<%=t "search.index.private" %>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<% elsif protocol.in_repository_archived? %>
|
|
|
|
<span class="label label-warning">
|
|
|
|
<%=t "search.index.archived" %>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
<% if can_edit_protocol(protocol) %>
|
2016-10-11 22:16:48 +08:00
|
|
|
<%= route_to_other_org edit_protocol_path(protocol),
|
|
|
|
protocol.organization,
|
|
|
|
text %>
|
2016-07-21 19:11:15 +08:00
|
|
|
<% else %>
|
|
|
|
<%= text %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|