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.


16
17
18
19
# File 'app/helpers/umlaut/html_head_helper.rb', line 16

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

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


7
8
9
10
11
# 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


24
25
26
# File 'app/helpers/umlaut/html_head_helper.rb', line 24

def render_umlaut_head_content
  render_opensearch_link + render_meta_refresh
end

#umlaut_title_textObject

String meant for use in <title>


29
30
31
# File 'app/helpers/umlaut/html_head_helper.rb', line 29

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