Sha256: 72de94c13f61fecc4c470eb4bc4a188d1493450e20b442a8c89b93672ed530ad

Contents?: true

Size: 806 Bytes

Versions: 29

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

module Hyrax::TitleHelper
  def application_name
    t('hyrax.product_name', default: super)
  end

  def construct_page_title(*elements)
    (elements.flatten.compact + [application_name]).join(' // ')
  end

  ##
  # @deprecated
  def curation_concern_page_title(curation_concern)
    Deprecation.warn 'The curation_concern_page_title helper will be removed in Hyrax 4.0.' \
                     "\n\tUse title_presenter(curation_concern).page_title instead."
    title_presenter(curation_concern).page_title
  end

  def default_page_title
    text = controller_name.singularize.titleize
    text = "#{action_name.titleize} " + text if action_name
    construct_page_title(text)
  end

  def title_presenter(resource)
    Hyrax::PageTitleDecorator.new(resource)
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hyrax-5.1.0.pre.beta1 app/helpers/hyrax/title_helper.rb
hyrax-5.0.4 app/helpers/hyrax/title_helper.rb
hyrax-5.0.3 app/helpers/hyrax/title_helper.rb
hyrax-5.0.2 app/helpers/hyrax/title_helper.rb
hyrax-5.0.1 app/helpers/hyrax/title_helper.rb
hyrax-5.0.0 app/helpers/hyrax/title_helper.rb
hyrax-5.0.0.rc3 app/helpers/hyrax/title_helper.rb
hyrax-5.0.0.rc2 app/helpers/hyrax/title_helper.rb
hyrax-5.0.0.rc1 app/helpers/hyrax/title_helper.rb
hyrax-3.6.0 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0.rc3 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0.rc2 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0.rc1 app/helpers/hyrax/title_helper.rb
hyrax-3.5.0 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0.beta2 app/helpers/hyrax/title_helper.rb
hyrax-3.4.2 app/helpers/hyrax/title_helper.rb
hyrax-4.0.0.beta1 app/helpers/hyrax/title_helper.rb
hyrax-3.4.1 app/helpers/hyrax/title_helper.rb
hyrax-3.4.0 app/helpers/hyrax/title_helper.rb