scinote-web/app/views/search/results/_checklists.html.erb

67 lines
2.1 KiB
Text
Raw Normal View History

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" %>
<%= 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" %>
<%= 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>
<span>
<%=t "search.index.experiment" %>
<%= render partial: "search/results/partials/experiment_text.html.erb",
locals: { experiment: checklist.step.protocol.my_module.experiment } %>
</span>
<br>
2016-07-21 19:11:15 +08:00
<span>
<%=t "search.index.project" %>
<%= render partial: "search/results/partials/project_text.html.erb",
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" %>
<%= 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 %>