Class: Pageflow::EntryTemplate

Inherits:
ApplicationRecord show all
Includes:
SerializedConfiguration, ThemeReferencer
Defined in:
app/models/pageflow/entry_template.rb

Instance Method Summary collapse

Methods included from SerializedConfiguration

#configuration

Methods included from ThemeReferencer

#theme

Instance Method Details

#copy_defaults_to(revision) ⇒ Object



32
33
34
35
# File 'app/models/pageflow/entry_template.rb', line 32

def copy_defaults_to(revision)
  widgets.copy_all_to(revision)
  copy_attributes_to(revision)
end

#default_share_providersObject



45
46
47
48
# File 'app/models/pageflow/entry_template.rb', line 45

def default_share_providers
  self[:default_share_providers].presence ||
    hashify_provider_array(Pageflow.config.default_share_providers)
end

#entry_typeObject



20
21
22
# File 'app/models/pageflow/entry_template.rb', line 20

def entry_type
  Pageflow.config.entry_types.find_by_name!(entry_type_name)
end

#resolve_widgets(options = {}) ⇒ Object



28
29
30
# File 'app/models/pageflow/entry_template.rb', line 28

def resolve_widgets(options = {})
  widgets.resolve(Pageflow.config_for(self), options)
end

#share_providersObject



41
42
43
# File 'app/models/pageflow/entry_template.rb', line 41

def share_providers
  default_share_providers
end

#share_providers=(share_providers) ⇒ Object



37
38
39
# File 'app/models/pageflow/entry_template.rb', line 37

def share_providers=(share_providers)
  self.default_share_providers = share_providers
end

#translated_entry_type_nameObject



24
25
26
# File 'app/models/pageflow/entry_template.rb', line 24

def translated_entry_type_name
  I18n.t("activerecord.values.pageflow/entry.type_names.#{entry_type_name}")
end