<% search_providers = search_inside # We don't show this block until ALL possible search inside tools # have been found. Too hard to deal with AJAX update of a DIV # that has a text input box in it otherwise. # TODO: Make this a helper function!? if (search_providers.length > 0 and (not service_type_in_progress?('search_inside'))) %>
<%= content_tag :h3, t('umlaut.display_sections.search_inside.search_inside_this_x', :x => @user_request.referent.container_type_of_thing.try(:downcase)) %>
<%= content_tag("form", :target => "_blank", :action => url_for(:controller=>'link_router', :action=>'index'), :class => "form-inline") do %>
<%=t 'umlaut.display_sections.search_inside.via' %> <% if search_providers.length > 1 %> <%= select_tag("id", options_for_select(search_providers.collect {|st| [st.view_data[:display_text], st.id]}), :class =>"form-control id") %> <% else %> <%= search_providers[0].view_data[:display_text] %> <% end %>
<% end %>
<% elsif (@user_request.referent.format == 'book' && service_type_in_progress?('search_inside')) %> <%# don't show the spinner unless it's identified as a book, otherwise too likely to be a false promise %> <%= render(:partial => "background_progress", :locals => {:svc_type => "search_inside", :progress_message => "#{t 'umlaut.display_sections.search_inside.progress_message'} #{@user_request.referent.container_type_of_thing}" }) %> <% end %>