Module: Cms::ApplicationHelper

Defined in:
app/helpers/cms/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#cms_attachment_path(attachment) ⇒ Object



5
6
7
8
9
# File 'app/helpers/cms/application_helper.rb', line 5

def cms_attachment_path(attachment)
  return unless attachment.attached?

  main_app.rails_blob_path(attachment, only_path: true)
end

#cms_date(value) ⇒ Object



15
16
17
# File 'app/helpers/cms/application_helper.rb', line 15

def cms_date(value)
  l(value.to_date, format: :cms_date)
end

#cms_datetime(value) ⇒ Object



19
20
21
# File 'app/helpers/cms/application_helper.rb', line 19

def cms_datetime(value)
  l(value, format: :cms_datetime)
end

#cms_form_field_kind_label(key) ⇒ Object



31
32
33
# File 'app/helpers/cms/application_helper.rb', line 31

def cms_form_field_kind_label(key)
  t("cms.form_field_kinds.#{key}")
end

#cms_page_status_label(key) ⇒ Object



27
28
29
# File 'app/helpers/cms/application_helper.rb', line 27

def cms_page_status_label(key)
  t("cms.page_statuses.#{key}")
end

#cms_page_template_label(key) ⇒ Object



23
24
25
# File 'app/helpers/cms/application_helper.rb', line 23

def cms_page_template_label(key)
  t("cms.page_templates.#{key}")
end

#cms_section_kind_label(key) ⇒ Object



35
36
37
# File 'app/helpers/cms/application_helper.rb', line 35

def cms_section_kind_label(key)
  t("cms.section_kinds.#{key}")
end

#cms_section_setting_label(name) ⇒ Object



43
44
45
# File 'app/helpers/cms/application_helper.rb', line 43

def cms_section_setting_label(name)
  t("cms.section_settings.labels.#{name}")
end

#cms_section_setting_option_label(name, option) ⇒ Object



47
48
49
# File 'app/helpers/cms/application_helper.rb', line 47

def cms_section_setting_option_label(name, option)
  t("cms.section_settings.options.#{name}.#{option}")
end

#cms_webhook_event_label(key) ⇒ Object



39
40
41
# File 'app/helpers/cms/application_helper.rb', line 39

def cms_webhook_event_label(key)
  t("cms.webhook_events.#{key.tr('.', '_')}")
end

#cms_yes_no(value) ⇒ Object



11
12
13
# File 'app/helpers/cms/application_helper.rb', line 11

def cms_yes_no(value)
  t(value ? "cms.shared.yes" : "cms.shared.no")
end