% solr_documents_features_block.with_solr_helper(self) %>
<% indicators = [] %>
<% html_id = "carousel-#{solr_documents_features_block.object_id}" %>
<% if solr_documents_features_block.documents? %>
<% solr_documents_features_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 %>
<% indicators << capture do %>
<% caption_text = solr_documents_features_block.document_caption(doc_presenter, solr_documents_features_block.primary_caption_field, default: Spotlight::PageConfigurations::DOCUMENT_TITLE_KEY) %>
<%= truncate(caption_text, length: 95) %>
<% if solr_documents_features_block.secondary_caption? %>
<%= solr_documents_features_block.document_caption(doc_presenter, solr_documents_features_block.secondary_caption_field) %>
<% end %>
<% end %>
<% end %>
<%= safe_join(indicators, "\n") %>
<% end %>