Sha256: 160dbc397bc4abd99b10a92817b9aec5d3a2e903d972eb593571b68c881dc3a9

Contents?: true

Size: 1013 Bytes

Versions: 7

Compression:

Stored size: 1013 Bytes

Contents

<%# 
  # Prepare a title in an H4, with formats in parens in a <small> (for
  # bootstrap), linked, etc.
  #
  # Pass in local `item` with BentoSearch::ResultItem (can use :as arg to
  # Rails render). 
  #
  # Optionally pass in a local "index" with result set index to display
  # in front of title. 1. 2. etc. 
  #  
  # %>
  <h4 class="bento_item_title">
    <% if local_assigns[:index] %>
      <span class="bento_index"><%= index%>.</span>
    <% end %>
  
    <%= link_to_unless(item.link.blank?, item.complete_title, item.link) %>
    
    <% if item.display_format.present? || item.display_language.present? %>
    
      <small class="bento_item_about">
        <%# sorry, no whitespace so parens are flush %>
        (<%- if item.display_format.present? -%><span class="bento_format"><%= item.display_format -%></span><%- end -%><%- if item.display_language.present? -%><span class="bento_language"> in <%= item.display_language -%></span><%- end -%>)
      </small>
      
    <% end %>  
  </h4>
  

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bento_search-1.0.3 app/views/bento_search/_item_title.html.erb
bento_search-1.0.2 app/views/bento_search/_item_title.html.erb
bento_search-1.0.1 app/views/bento_search/_item_title.html.erb
bento_search-1.0.0 app/views/bento_search/_item_title.html.erb
bento_search-0.9.0 app/views/bento_search/_item_title.html.erb
bento_search-0.8.0 app/views/bento_search/_item_title.html.erb
bento_search-0.7.0 app/views/bento_search/_item_title.html.erb