% solr_documents_carousel_block.with_solr_helper(self) %>
<% indicators = [] %>
<% html_id = "carousel-#{solr_documents_carousel_block.object_id}" %>
<% if solr_documents_carousel_block.documents? %>
<% solr_documents_carousel_block.each_document.each_with_index do |(block_options, document), index| %>
<% if block_thumb = block_options[:full_image_url] %>
<%= link_to_document(document, image_tag(block_thumb), counter: -1) %>
<% elsif has_thumbnail? document %>
<%= render_thumbnail_tag(document, {}, document_counter: -1) %>
<% end %>
<% if solr_documents_carousel_block.primary_caption? %>
<%= render_index_field_value document, solr_documents_carousel_block.primary_caption_field %>
<% end %>
<% if solr_documents_carousel_block.secondary_caption? %>
<%= render_index_field_value document, solr_documents_carousel_block.secondary_caption_field %>
<% end %>
<% indicators << capture do %>
<% end %>
<% end %>
<%= safe_join(indicators, "\n") %>
<% end %>