<% results.each do |sample| %>
<%=t "search.index.samples.sample" %> <%= highlight sample.name, search_query.strip.split(/\s+/) %>

<%=t "search.index.samples.sample_type" %> <% if sample.sample_type.present? %> <%= highlight sample.sample_type.name, search_query.strip.split(/\s+/) %> <% else %> <%=t "search.index.samples.no_sample_type" %> <% end %>
<%=t "search.index.samples.sample_group" %> "> <% if sample.sample_group.present? %> <%= highlight sample.sample_group.name, search_query.strip.split(/\s+/) %> <% else %> <%=t "search.index.samples.no_sample_group" %> <% end %>
<%=t "search.index.samples.added_on" %> <%=l sample.created_at, format: :full %>
<%=t "search.index.samples.added_by" %> <%= highlight sample.user.full_name, search_query.strip.split(/\s+/) %> <% sample.sample_custom_fields.each do |sample_custom_field| %>
<%=t "search.index.samples.custom_field", cf: sample_custom_field.custom_field.name %> <%= highlight sample_custom_field.value, search_query.strip.split(/\s+/) %> <% end %>

<%=t "search.index.modules" %> <% if sample.my_modules.count > 0 %> <% sample.my_modules.each_with_index do |mod, i| %> <%= render partial: "search/results/partials/my_module_text.html.erb", locals: { my_module: mod, link_to_page: :samples } %> <% if i != sample.my_modules.count - 1 %> ,  <% end %> <% end %> <% else %> <%=t "search.index.sample_no_modules" %> <% end %>
<%=t "search.index.organization" %> <%= render partial: "search/results/partials/organization_text.html.erb", locals: { organization: sample.organization } %>


<% end %>