Sha256: 70709293afdd07b861a94c54216aac001d885d7858d5e9666fda7f3d6943ceae

Contents?: true

Size: 716 Bytes

Versions: 54

Compression:

Stored size: 716 Bytes

Contents

module CurationConcerns::TitleHelper
  def application_name
    t('curation_concerns.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

54 entries across 54 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.7 app/helpers/curation_concerns/title_helper.rb
curation_concerns-2.0.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-2.0.0.rc2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.6 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.5 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.4 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.3 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-2.0.0.rc1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.7.0.beta1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.6.3 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.6.2 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.6.1 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.6.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.5.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.4.0 app/helpers/curation_concerns/title_helper.rb
curation_concerns-1.3.3 app/helpers/curation_concerns/title_helper.rb