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

55 lines
1.8 KiB
Text

<% 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 } %>
</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 } %>
</span>
<br>
<span>
<%=t "search.index.project" %>
<%= render partial: "search/results/partials/project_text.html.erb", locals: { project: checklist.step.protocol.my_module.project } %>
</span>
<% else %>
<span>
<%=t "search.index.protocol" %>
<%= render partial: "search/results/partials/protocol_text.html.erb", locals: { protocol: checklist.step.protocol, query: search_query } %>
</span>
<% end %>
<br>
<span>
<%=t "search.index.organization" %>
<%= render partial: "search/results/partials/organization_text.html.erb", locals: { organization: checklist.step.protocol.organization } %>
</span>
</p>
<hr>
<% end %>