Module: Pageflow::Admin::EntriesHelper

Defined in:
app/helpers/pageflow/admin/entries_helper.rb

Overview

Since:

  • 12.2

Instance Method Summary collapse

Instance Method Details

#admin_entry_title(entry) ⇒ Object

Since:

  • 12.2



4
5
6
7
8
9
10
# File 'app/helpers/pageflow/admin/entries_helper.rb', line 4

def admin_entry_title(entry)
  if entry.title.blank?
    I18n.t('pageflow.admin.entries.default_title', id: entry.id)
  else
    entry.title
  end
end

#collection_for_entry_publication_statesObject

Since:

  • 12.2



12
13
14
15
16
17
18
19
20
# File 'app/helpers/pageflow/admin/entries_helper.rb', line 12

def collection_for_entry_publication_states
  [
    'published_without_password_protection',
    'published_with_password_protection',
    'not_published'
  ].index_by do |state|
    I18n.t(state, scope: 'activerecord.values.pageflow/entry.publication_states')
  end
end

#entry_type_collection(entry_types = Pageflow.config.entry_types) ⇒ Object

Since:

  • 12.2



22
23
24
25
26
# File 'app/helpers/pageflow/admin/entries_helper.rb', line 22

def entry_type_collection(entry_types = Pageflow.config.entry_types)
  entry_types.map(&:name).index_by do |type|
    I18n.t(type, scope: 'activerecord.values.pageflow/entry.type_names')
  end
end