<% # Displays a typical Umlaut response element in typical markup. # Pass in a ServiceType object for the response using Rails partial # :object or :collection convention #optional argument, :locals => # :show_source => default false, if true display the source of the link show_source ||= false service_response = standard_response_item # passed in via :object or :collection # passed in in :object or :collection view_data = service_response.view_data %>
  • <% if view_data[:link_supports_ajax_call] # Generate a hyperlink that will call our standard service action # due to special class for unobtrusive JS. %> <%= link_to(view_data[:display_text], {:controller=>'link_router', :id=>service_response.id}, {:id => "svctype_link_#{service_response.id}", :target => "_blank", :class => "ajax_window"}) %> <% elsif (content = response_content(view_data )) #collapsible content on page %> <%= expand_contract_section(view_data[:display_text], "svc_id_#{service_response.id}") do %>
    <%= content %>
    <% end %> <% else # Ordinary href link. %> <%= link_to view_data[:display_text], {:controller=>'link_router', :id=>service_response.id}, 'target'=>"_blank", 'id' => "svctype_link_#{service_response.id}" %> <% end %> <% if show_source %> <% end %> <% unless view_data[:coverage].blank? %>
    <%= view_data[:coverage] %>
    <% end %> <% unless view_data[:notes].blank? %> <%- # legacy, the 'notes' field can take raw html, we need to leave it that way for #now, but it's not great. -%>
    <%= view_data[:notes].html_safe %>
    <% end %> <% unless view_data[:authentication].blank? %>
    Authentication: <%= view_data[:authentication] %>
    <% end %> <% if (!view_data[:match_reliability].blank?) && view_data[:match_reliability] != ServiceResponse::MatchExact %>
    <% unless view_data[:edition_str].blank? %> Edition information <%= view_data[:edition_str] %> <% else %> May be alternate edition. <% end %>
    <% end %>