Sha256: da639946686c8f890f4ae2ef5b711efec280581737711a5c678ba375f7ccc5a6

Contents?: true

Size: 1.22 KB

Versions: 3

Compression:

Stored size: 1.22 KB

Contents

# Rails view helpers for outputting standard Umlaut content included
# in html <head>. Generally a layout will call #render_umlaut_head_content
# to render all standard Umlaut <head> content in a future-compatible way. 
module Umlaut::HtmlHeadHelper
  
  # usually called in layout, render a link tag with opensearch auto-discovery
  def render_opensearch_link
    tag("link", 
        :rel => "search", 
        :type => "application/opensearchdescription+xml", 
        :title =>  umlaut_config.opensearch_short_name,
        :href => url_for(:controller=>'open_search', :only_path=>false)
        )
  end
  
  # used on non-js progress page, we need to refresh the page
  # if requested by presence of @meta_refresh_self ivar. 
  # this method usually called in a layout. 
  def render_meta_refresh
     if @meta_refresh_self    
      tag( "meta",
        "http-equiv" => "refresh",
        "content" => @meta_refresh_self
        )
      else
        ""
      end
  end
  
  # standard umlaut head content, may later include more
  # stuff, local/custom layouts should call this in HEAD
  # to get forwards-compatible umlaut standard head content
  def render_umlaut_head_content
    render_opensearch_link + render_meta_refresh
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
umlaut-3.0.0alpha3 app/helpers/umlaut/html_head_helper.rb
umlaut-3.0.0alpha2 app/helpers/umlaut/html_head_helper.rb
umlaut-3.0.0alpha1 app/helpers/umlaut/html_head_helper.rb