Sha256: 26edfa65400db47da46c80112d4b5e20efa112abe1a354643a7a79ebfa6c299e

Contents?: true

Size: 1.16 KB

Versions: 8

Compression:

Stored size: 1.16 KB

Contents

module Spotlight
  ##
  # Page title helpers
  module TitleHelper
    def curation_page_title(title = nil)
      page_title t(:'spotlight.curation.header'), title
    end

    def administration_page_title(title = nil)
      page_title t(:'spotlight.administration.header'), title
    end

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

    # rubocop:disable Style/AccessorMethodName
    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))
    end
    # rubocop:enable Style/AccessorMethodName

    def header_with_count(*args)
      title, count = if args.length == 2
                       args
                     else
                       [t(:'.header'), args.first]
                     end

      safe_join([title, content_tag(:span, count, class: 'label label-default')], ' ')
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
blacklight-spotlight-0.8.2 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.8.1 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.8.0 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.7.2 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.7.1 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.7.0 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.6.0 app/helpers/spotlight/title_helper.rb
blacklight-spotlight-0.5.0 app/helpers/spotlight/title_helper.rb