% holdings = holding.find_all{|response| response.service_type_value_name.eql? "holding" } %>
<% unless holdings.empty? %>
<%
# Process each holding.
holdings.each do |p|
target = p.view_data %>
<%= target[:collection_str] %>
<% # Set status class based on configured available statuses
status_class = umlaut_config.holdings.available_statuses.include?(target[:status]) ? 'umlaut-available' : '' %>
<%= target[:status] %>
<%= target[:call_number]%>
<%= link_to(t('umlaut.holding.more_info'), {:controller=>"link_router", :id=>p.id}, :target => "_blank", :class=>"more-info btn btn-xs btn-default") %>
<% if target[:request_url] %>
<%= link_to(t('umlaut.holding.request'), target[:request_url], :target => "_blank", :class=>"request btn btn-xs btn-primary") %>
<% end %>
<% if target[:match_reliability].present? && target[:match_reliability] != ServiceResponse::MatchExact %>
<% unless target[:edition_str].blank? %>
<%=t('umlaut.resolve.edition_info')%> <%= target[:edition_str] %>
<% else %>
<%t('umlaut.resolve.maybe_alt_edition')%>
<% end %>
<% end %>
<% if target[:notes].present? %>
<%= target[:notes] %>
<% end %>
<% if target[:coverage_str_array].present? %>
<%= list_with_limit("copies_#{p.id}", target[:coverage_str_array], :limit => 4) do |item, index| %>
<%= item %>
<% end %>
<% end %>
<% end %>
<% end %>
<% if holdings.empty? %>
<% # Get and display holding searches
searches = holding.find_all{|response| response.service_type_value_name.eql? "holding_search"}
searches.each do | result_st |
response = result_st.view_data %>
<%= link_to response[:display_text], {:controller=>'link_router', :id=>result_st.id}, 'target'=>"_blank" %>
<% end %>
<%
# Display "Not Available" if we've completed our service run and both holdings and holding searches are empty
if (holdings.blank? and searches.blank? and (not service_types_in_progress?(['holding', 'holding_search']))) %>
<%=t('umlaut.resolve.not_available')%>
<% end %>
<% end %>