Module: Umlaut::HtmlHeadHelper

Included in:
Helper
Defined in:
app/helpers/umlaut/html_head_helper.rb

Overview

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.

Instance Method Summary collapse

Instance Method Details

#render_meta_refreshObject

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.



19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/umlaut/html_head_helper.rb', line 19

def render_meta_refresh
   if @meta_refresh_self    
    tag( "meta",
      "http-equiv" => "refresh",
      "content" => @meta_refresh_self
      )
    else
      ""
    end
end

usually called in layout, render a link tag with opensearch auto-discovery



7
8
9
10
11
12
13
14
# File 'app/helpers/umlaut/html_head_helper.rb', line 7

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

#render_umlaut_head_contentObject

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



33
34
35
# File 'app/helpers/umlaut/html_head_helper.rb', line 33

def render_umlaut_head_content
  render_opensearch_link + render_meta_refresh
end

#umlaut_title_textObject

String meant for use in <title>



38
39
40
# File 'app/helpers/umlaut/html_head_helper.rb', line 38

def umlaut_title_text
  umlaut_config.app_name + (@page_title ? " | #{@page_title}" : "")
end