Class: Pageflow::Admin::EntryTemplatesTab

Inherits:
ViewComponent
  • Object
show all
Defined in:
app/views/components/pageflow/admin/entry_templates_tab.rb

Overview

Since:

  • 12.2

Instance Method Summary collapse

Instance Method Details

#build(theming) ⇒ Object

Since:

  • 12.2



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/views/components/pageflow/admin/entry_templates_tab.rb', line 4

def build(theming)
   = theming.
  table_subjects = .existing_and_potential_entry_templates

  table_for(table_subjects, i18n: Pageflow::EntryTemplate) do
    column do |entry_template|
      if entry_template.id
        render 'admin/accounts/entry_template_details', entry_template: entry_template
      else
        h5(entry_template.translated_entry_type_name)
      end
    end
    column do |entry_template|
      if entry_template.id
        edit_link(entry_template, )
      else
        new_link(entry_template, )
      end
    end
  end
end

Since:

  • 12.2



37
38
39
40
41
42
43
44
45
# File 'app/views/components/pageflow/admin/entry_templates_tab.rb', line 37

def edit_link(entry_template, )
  link_to(
    I18n.t('active_admin.edit'),
    (
      ,
      entry_template
    )
  )
end

Since:

  • 12.2



26
27
28
29
30
31
32
33
34
35
# File 'app/views/components/pageflow/admin/entry_templates_tab.rb', line 26

def new_link(entry_template, )
  link_to(
    I18n.t('active_admin.new'),
    (
      ,
      entry_template,
      entry_type_name: entry_template.entry_type_name
    )
  )
end