<% solr_documents_carousel_block.each_document.each_with_index do |(block_options, document), index| %>
<% doc_presenter = document_presenter(document) %>
<% if block_options[:full_image_url].present? %>
<%= link_to_document(document, image_tag(block_options[:full_image_url], alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
<% elsif block_options[:iiif_tilesource_base].present? %>
<%= link_to_document(document, image_tag(block_options[:iiif_tilesource_base] + '/full/!800,800/0/default.jpg', alt: doc_presenter.heading, skip_pipeline: true), counter: -1) %>
<% elsif doc_presenter.thumbnail.exists? %>
<%= doc_presenter.thumbnail.thumbnail_tag({ alt: doc_presenter.heading }, document_counter: -1) %>
<% end %>
<% if solr_documents_carousel_block.primary_caption? %>
<%= solr_documents_carousel_block.document_caption(doc_presenter, solr_documents_carousel_block.primary_caption_field) %>
<% end %>
<% if solr_documents_carousel_block.secondary_caption? %>
<%= solr_documents_carousel_block.document_caption(doc_presenter, solr_documents_carousel_block.secondary_caption_field) %>
<% end %>
<% indicators << capture do %>
<% end %>
<% end %>