Module: MailManager::LayoutHelper

Defined in:
app/helpers/mail_manager/layout_helper.rb

Instance Method Summary collapse

Instance Method Details

#show_title?Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
27
# File 'app/helpers/mail_manager/layout_helper.rb', line 20

def show_title?
  return @show_title if defined? @show_title
  true
rescue 
  # :nocov: shouldn't happen
  false
  # :nocov:
end

#site_urlObject



29
30
31
32
33
34
35
# File 'app/helpers/mail_manager/layout_helper.rb', line 29

def site_url
  ::MailManager.site_url
rescue
  # :nocov: shouldn't happen
  "#{default_url_options[:protocol]||'http'}://#{default_url_options[:domain]}"
  # :nocov:
end

#title(value = nil, locals = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'app/helpers/mail_manager/layout_helper.rb', line 3

def title(value=nil, locals={})
  if value.nil?
    @page_title
  else
    @page_title = translate( value, locals)
    "<h1>#{@page_title}</h1>".html_safe
  end
end

#translate(key, options = {}) ⇒ Object



37
38
39
40
41
# File 'app/helpers/mail_manager/layout_helper.rb', line 37

def translate(key, options={})
  super(key, options.merge(raise: true))
rescue I18n::MissingTranslationData
  key
end

#use_show_for_resources?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
17
18
# File 'app/helpers/mail_manager/layout_helper.rb', line 12

def use_show_for_resources?
  ::MailManager.use_show_for_resources
rescue 
  # :nocov: shouldn't happen
  false
  # :nocov:
end