Sha256: b0419dcb3ce728b9dd60700c4664b55e22115bfe9a0f4187ed67f5a8c63e9907

Contents?: true

Size: 693 Bytes

Versions: 58

Compression:

Stored size: 693 Bytes

Contents

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

  def curation_concern_page_title(curation_concern)
    if curation_concern.persisted?
      construct_page_title(curation_concern.to_s, "#{curation_concern.human_readable_type} [#{curation_concern.to_param}]")
    else
      construct_page_title("New #{curation_concern.human_readable_type}")
    end
  end

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

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
hyrax-2.9.6 app/helpers/hyrax/title_helper.rb
hyrax-2.9.5 app/helpers/hyrax/title_helper.rb
hyrax-2.9.4 app/helpers/hyrax/title_helper.rb
hyrax-2.9.3 app/helpers/hyrax/title_helper.rb
hyrax-2.9.2 app/helpers/hyrax/title_helper.rb
hyrax-2.9.1 app/helpers/hyrax/title_helper.rb
hyrax-2.9.0 app/helpers/hyrax/title_helper.rb
hyrax-2.8.0 app/helpers/hyrax/title_helper.rb
hyrax-2.7.2 app/helpers/hyrax/title_helper.rb
hyrax-2.7.1 app/helpers/hyrax/title_helper.rb
hyrax-2.7.0 app/helpers/hyrax/title_helper.rb
hyrax-2.6.0 app/helpers/hyrax/title_helper.rb
hyrax-3.0.0.pre.rc1 app/helpers/hyrax/title_helper.rb
hyrax-3.0.0.pre.beta3 app/helpers/hyrax/title_helper.rb
hyrax-2.5.1 app/helpers/hyrax/title_helper.rb
hyrax-2.5.0 app/helpers/hyrax/title_helper.rb
hyrax-3.0.0.pre.beta2 app/helpers/hyrax/title_helper.rb
hyrax-2.4.1 app/helpers/hyrax/title_helper.rb
hyrax-3.0.0.pre.beta1 app/helpers/hyrax/title_helper.rb
hyrax-2.4.0 app/helpers/hyrax/title_helper.rb