Module: Katalyst::Content::Form::Builder

Included in:
EditorHelper::FormBuilder
Defined in:
app/helpers/katalyst/content/form/builder.rb

Instance Method Summary collapse

Instance Method Details

#content_heading_fieldObject



17
18
19
# File 'app/helpers/katalyst/content/form/builder.rb', line 17

def content_heading_field(**)
  govuk_text_field(:heading, **)
end

#content_heading_fieldset(legend: { text: I18n.t("activerecord.attributes.katalyst/content/item.heading"), }) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/helpers/katalyst/content/form/builder.rb', line 7

def content_heading_fieldset(legend: {
  text: I18n.t("activerecord.attributes.katalyst/content/item.heading"),
})
  govuk_fieldset(legend:) do
    heading = content_heading_field(label: { class: "govuk-visually-hidden" })
    style   = content_heading_style_field
    safe_join([heading, style])
  end
end

#content_heading_style_fieldObject



21
22
23
# File 'app/helpers/katalyst/content/form/builder.rb', line 21

def content_heading_style_field(**)
  govuk_enum_select(:heading_style, **)
end

#content_http_method_fieldObject



29
30
31
# File 'app/helpers/katalyst/content/form/builder.rb', line 29

def content_http_method_field(**)
  govuk_enum_select(:http_method, **)
end

#content_target_fieldObject



33
34
35
# File 'app/helpers/katalyst/content/form/builder.rb', line 33

def content_target_field(**)
  govuk_enum_select(:target, **)
end

#content_theme_field(options: { include_blank: true }) ⇒ Object



37
38
39
# File 'app/helpers/katalyst/content/form/builder.rb', line 37

def content_theme_field(options: { include_blank: true }, **)
  govuk_enum_select(:theme, options:, **)
end

#content_url_fieldObject



25
26
27
# File 'app/helpers/katalyst/content/form/builder.rb', line 25

def content_url_field(**)
  govuk_text_field(:url, **)
end

#content_visible_fieldObject



41
42
43
# File 'app/helpers/katalyst/content/form/builder.rb', line 41

def content_visible_field(**)
  govuk_check_box_field(:visible, **)
end