2016-07-21 19:11:15 +08:00
|
|
|
<% results.each do |checklist| %>
|
|
|
|
<h5>
|
|
|
|
<span class="glyphicon glyphicon-check"></span>
|
|
|
|
<%= highlight checklist.name, search_query.strip.split(/\s+/) %>
|
|
|
|
</h5>
|
|
|
|
|
|
|
|
<% if checklist.checklist_items.count > 0 %>
|
|
|
|
<div class="well well-sm well-search-checklist">
|
|
|
|
<ul class="list-unstyled">
|
|
|
|
<% checklist.checklist_items.each do |item| %>
|
|
|
|
<li>
|
|
|
|
<input type="checkbox" disabled="disabled">
|
|
|
|
<%= highlight item.text, search_query.strip.split(/\s+/) %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.created_at" %>
|
|
|
|
<%=l checklist.created_at, format: :full %>
|
|
|
|
</span>
|
|
|
|
<br>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.step" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/step_text.html.erb",
|
|
|
|
locals: { step: checklist.step, target: nil } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
</span>
|
|
|
|
<br>
|
|
|
|
<% if checklist.step.protocol.in_module? %>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.module" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/my_module_text.html.erb",
|
|
|
|
locals: { my_module: checklist.step.protocol.my_module } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
</span>
|
|
|
|
<br>
|
2016-07-26 18:12:43 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.experiment" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/experiment_text.html.erb",
|
|
|
|
locals: { experiment: checklist.step.protocol.my_module.experiment } %>
|
2016-07-26 18:12:43 +08:00
|
|
|
</span>
|
|
|
|
<br>
|
2016-07-21 19:11:15 +08:00
|
|
|
<span>
|
|
|
|
<%=t "search.index.project" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/project_text.html.erb",
|
2016-09-05 17:40:49 +08:00
|
|
|
locals: { project: checklist.step.protocol.my_module.experiment.project, link_to_page: :show } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
</span>
|
|
|
|
<% else %>
|
|
|
|
<span>
|
|
|
|
<%=t "search.index.protocol" %>
|
2016-07-26 18:59:37 +08:00
|
|
|
<%= render partial: "search/results/partials/protocol_text.html.erb",
|
|
|
|
locals: { protocol: checklist.step.protocol, query: search_query } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<br>
|
|
|
|
<span>
|
2017-01-25 19:01:23 +08:00
|
|
|
<%=t "search.index.team" %>
|
|
|
|
<%= render partial: "search/results/partials/team_text.html.erb",
|
|
|
|
locals: { team: checklist.step.protocol.team } %>
|
2016-07-21 19:11:15 +08:00
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
<% end %>
|