Module: Spotlight::TitleHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/spotlight/title_helper.rb

Overview

Page title helpers

Instance Method Summary collapse

Instance Method Details

#configuration_page_title(title = nil) ⇒ Object



9
10
11
# File 'app/helpers/spotlight/title_helper.rb', line 9

def configuration_page_title(title = nil)
  page_title t(:'spotlight.configuration.header'), title
end

#curation_page_title(title = nil) ⇒ Object



5
6
7
# File 'app/helpers/spotlight/title_helper.rb', line 5

def curation_page_title(title = nil)
  page_title t(:'spotlight.curation.header'), title
end

#page_title(section, title = nil) ⇒ Object



13
14
15
16
# File 'app/helpers/spotlight/title_helper.rb', line 13

def page_title(section, title = nil)
  set_html_page_title(t(:'spotlight.html_admin_title', section: section, title: title || t(:'.title', default: :'.header')))
  (:h1, safe_join([section, (:small, title || t(:'.header'))], "\n"), class: 'page-header')
end

#set_html_page_title(title = nil) ⇒ Object

rubocop:disable Naming/AccessorMethodName



19
20
21
# File 'app/helpers/spotlight/title_helper.rb', line 19

def set_html_page_title(title = nil)
  @page_title = strip_tags(t(:'spotlight.html_title', title: title || t(:'.title', default: :'.header'), application_name: application_name)).html_safe
end