Module: Koi::Form::Content

Extended by:
ActiveSupport::Concern
Defined in:
lib/koi/form/content.rb

Instance Method Summary collapse

Instance Method Details

#content_heading_field(args = {}) ⇒ Object



15
16
17
18
# File 'lib/koi/form/content.rb', line 15

def content_heading_field(args = {})
  govuk_text_field(:heading,
                   **{ label: { text: "Heading", size: "s" } }.deep_merge(args))
end

#content_heading_fieldsetObject



8
9
10
11
12
13
# File 'lib/koi/form/content.rb', line 8

def content_heading_fieldset
  govuk_fieldset(legend: { text: "Heading", size: "m" }) do
    concat(content_heading_field(label: nil))
    concat(content_heading_style_field)
  end
end

#content_heading_style_field(args = {}) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/koi/form/content.rb', line 20

def content_heading_style_field(args = {})
  govuk_collection_radio_buttons(:heading_style,
                                 Katalyst::Content.config.heading_styles,
                                 :itself,
                                 :itself,
                                 **{ small: true, legend: { text: "Style", size: "s" } }.deep_merge(args))
end

#content_http_method_field(methods, args = {}) ⇒ Object



33
34
35
36
# File 'lib/koi/form/content.rb', line 33

def content_http_method_field(methods, args = {})
  govuk_select(:http_method, methods,
               **{ label: { text: "HTTP method", size: "s" } }.deep_merge(args))
end

#content_target_field(targets, args = {}) ⇒ Object



38
39
40
41
# File 'lib/koi/form/content.rb', line 38

def content_target_field(targets, args = {})
  govuk_select(:target, targets,
               **{ label: { text: "HTTP target", size: "s" } }.deep_merge(args))
end

#content_theme_field(args = {}) ⇒ Object Also known as: content_background_field



43
44
45
46
# File 'lib/koi/form/content.rb', line 43

def content_theme_field(args = {})
  govuk_select(:theme, Katalyst::Content.config.themes,
               **{ label: { size: "s" }, options: { include_blank: true } }.deep_merge(args))
end

#content_url_field(args = {}) ⇒ Object



28
29
30
31
# File 'lib/koi/form/content.rb', line 28

def content_url_field(args = {})
  govuk_text_field(:url,
                   **{ label: { text: "URL", size: "s" } }.deep_merge(args))
end

#content_visible_field(args = {}) ⇒ Object



49
50
51
52
# File 'lib/koi/form/content.rb', line 49

def content_visible_field(args = {})
  govuk_check_box_field(:visible,
                        **{ label: { text: "Visible? ", size: "s" }, small: true }.deep_merge(args))
end