scinote-web/app/views/search/results/partials/_step_text.html.erb
2016-07-21 13:11:15 +02:00

25 lines
701 B
Plaintext

<% query ||= nil %>
<% text = query.present? ? highlight(step.name, query.strip.split(/\s+/)) : step.name %>
<% if can_view_steps_in_protocol(step.protocol) %>
<% if step.protocol.in_module? %>
<% if target == :comment %>
<%= link_to protocols_my_module_path(step.protocol.my_module, ctarget: "step-panel-#{step.id}") do %>
<%= text %>
<% end %>
<% else %>
<a href="<%= protocols_my_module_path(step.protocol.my_module) %>">
<%= text %>
</a>
<% end %>
<% elsif can_edit_protocol(step.protocol) %>
<a href="<%= edit_protocol_path(step.protocol) %>">
<%= text %>
</a>
<% else %>
<%= text %>
<% end %>
<% else %>
<%= text %>
<% end %>