Class: GacoCms::Field
Constant Summary
collapse
GacoCms::Config.
- KINDS =
%i[text_field text_area editor file page].concat(EXTRA_KINDS.keys)
Class Method Summary
collapse
Instance Method Summary
collapse
#activestorage_url, #cache_key_locale, human_name
Instance Method Details
#allow_translation? ⇒ Boolean
61
62
63
64
65
66
|
# File 'app/models/gaco_cms/field.rb', line 61
def allow_translation?
return false if %w[page].include?(kind)
res = EXTRA_KINDS.dig(kind&.to_sym, :translatable)
res.nil? ? true : res
end
|
#default_value_tpl ⇒ Object
55
56
57
58
59
|
# File 'app/models/gaco_cms/field.rb', line 55
def default_value_tpl
return "/gaco_cms/admin/field_groups_renderer/default_value/#{kind}" if kind == 'page'
EXTRA_KINDS.dig(kind&.to_sym, :default_value_tpl)
end
|
#tpl ⇒ Object
68
69
70
|
# File 'app/models/gaco_cms/field.rb', line 68
def tpl
EXTRA_KINDS.dig(kind&.to_sym, :tpl) || "/gaco_cms/admin/field_groups_renderer/fields/#{kind}"
end
|