crown_marketplace_utils 0.1.0.beta.6 → 0.1.0.beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/accordion.rb +91 -89
  4. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/back_link.rb +24 -22
  5. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/breadcrumbs.rb +56 -54
  6. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/button.rb +109 -107
  7. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/details.rb +33 -31
  8. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/error_message.rb +49 -47
  9. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/character_count.rb +144 -142
  10. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/checkboxes.rb +176 -174
  11. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/date_input.rb +126 -124
  12. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/file_upload.rb +75 -73
  13. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/input.rb +137 -135
  14. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/radios.rb +176 -174
  15. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/select.rb +111 -109
  16. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field/textarea.rb +86 -84
  17. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/field.rb +181 -179
  18. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/fieldset.rb +56 -54
  19. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/form_group.rb +37 -35
  20. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/header.rb +142 -140
  21. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/hint.rb +25 -23
  22. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/label.rb +69 -67
  23. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/notification_banner.rb +121 -119
  24. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/pagination.rb +290 -288
  25. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/step_by_step_navigation.rb +187 -185
  26. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/tag.rb +29 -27
  27. data/lib/crown_marketplace_utils/helpers/gov_uk_helper/warning_text.rb +39 -37
  28. data/lib/crown_marketplace_utils/helpers/gov_uk_helper.rb +31 -29
  29. data/lib/crown_marketplace_utils/version.rb +1 -1
  30. metadata +1 -1
@@ -3,149 +3,151 @@
3
3
  require_relative '../field'
4
4
  require_relative 'input'
5
5
 
6
- module CrownMarketplaceUtils::Helpers
7
- module GovUkHelper
8
- module Field
9
- # = GOV.UK Date Input
10
- #
11
- # This helper is used for generating the date input component from the
12
- # {https://design-system.service.gov.uk/components/date-input GDS - Components - Date Input}
13
- #
14
- # This is considered a Field module and so makes use of the methods in {CrownMarketplaceUtils::GovUkHelper::Field}
15
-
16
- module DateInput
17
- include Field
18
- include Input
19
-
20
- # Generates the HTML for the GOV.UK date input component
6
+ module CrownMarketplaceUtils
7
+ module Helpers
8
+ module GovUkHelper
9
+ module Field
10
+ # = GOV.UK Date Input
21
11
  #
22
- # @param attribute [String, Symbol] the attribute of the date input
23
- # @param govuk_date_input_options [Hash] options that will be used for the parts of the fieldset, form group, hint and date input
12
+ # This helper is used for generating the date input component from the
13
+ # {https://design-system.service.gov.uk/components/date-input GDS - Components - Date Input}
24
14
  #
25
- # @option govuk_date_input_options [String] :error_message (nil) the error message to be displayed
26
- # @option govuk_date_input_options [ActiveModel] :model (nil) optional model that can be used to find an error message
27
- # @option govuk_date_input_options [ActionView::Helpers::FormBuilder] :form (nil) optional form builder used to create
28
- # the date tag and find the error message
29
- # @option govuk_date_input_options [Hash] :form_group see {govuk_fields}
30
- # @option govuk_date_input_options [Hash] :fieldset see {govuk_fields}
31
- # @option govuk_date_input_options [Hash] :hint see {govuk_field}
32
- # @option govuk_date_input_options [Hash] :date_input_options ({}) the options that will be used when rendering the date input.
33
- # See {_govuk_date_input_fields} for more details.
34
- #
35
- # @return [ActiveSupport::SafeBuffer] the HTML for the GOV.UK Date Input
36
- # which can then be rendered on the page
37
-
38
- def govuk_date_input(attribute, **govuk_date_input_options)
39
- set_govuk_date_input_fieldset_options(**govuk_date_input_options)
40
-
41
- govuk_fields(:date_input, attribute, **govuk_date_input_options) do |govuk_field_options, error_message|
42
- concat(_govuk_date_input_fields(attribute, error_message, **govuk_field_options) do |date_item_attribute, date_item_input_options|
43
- govuk_input(
44
- date_item_attribute,
45
- model: govuk_date_input_options[:model],
46
- form: govuk_date_input_options[:form],
47
- **date_item_input_options
48
- )
49
- end)
15
+ # This is considered a Field module and so makes use of the methods in {CrownMarketplaceUtils::GovUkHelper::Field}
16
+
17
+ module DateInput
18
+ include Field
19
+ include Input
20
+
21
+ # Generates the HTML for the GOV.UK date input component
22
+ #
23
+ # @param attribute [String, Symbol] the attribute of the date input
24
+ # @param govuk_date_input_options [Hash] options that will be used for the parts of the fieldset, form group, hint and date input
25
+ #
26
+ # @option govuk_date_input_options [String] :error_message (nil) the error message to be displayed
27
+ # @option govuk_date_input_options [ActiveModel] :model (nil) optional model that can be used to find an error message
28
+ # @option govuk_date_input_options [ActionView::Helpers::FormBuilder] :form (nil) optional form builder used to create
29
+ # the date tag and find the error message
30
+ # @option govuk_date_input_options [Hash] :form_group see {govuk_fields}
31
+ # @option govuk_date_input_options [Hash] :fieldset see {govuk_fields}
32
+ # @option govuk_date_input_options [Hash] :hint see {govuk_field}
33
+ # @option govuk_date_input_options [Hash] :date_input_options ({}) the options that will be used when rendering the date input.
34
+ # See {_govuk_date_input_fields} for more details.
35
+ #
36
+ # @return [ActiveSupport::SafeBuffer] the HTML for the GOV.UK Date Input
37
+ # which can then be rendered on the page
38
+
39
+ def govuk_date_input(attribute, **govuk_date_input_options)
40
+ set_govuk_date_input_fieldset_options(**govuk_date_input_options)
41
+
42
+ govuk_fields(:date_input, attribute, **govuk_date_input_options) do |govuk_field_options, error_message|
43
+ concat(_govuk_date_input_fields(attribute, error_message, **govuk_field_options) do |date_item_attribute, date_item_input_options|
44
+ govuk_input(
45
+ date_item_attribute,
46
+ model: govuk_date_input_options[:model],
47
+ form: govuk_date_input_options[:form],
48
+ **date_item_input_options
49
+ )
50
+ end)
51
+ end
50
52
  end
51
- end
52
53
 
53
- private
54
+ private
54
55
 
55
- # Sets the role for the fieldset to group
56
- #
57
- # @param govuk_date_input_options [Hash] options that will be used for the parts of the fieldset, form group, hint and date input
56
+ # Sets the role for the fieldset to group
57
+ #
58
+ # @param govuk_date_input_options [Hash] options that will be used for the parts of the fieldset, form group, hint and date input
58
59
 
59
- def set_govuk_date_input_fieldset_options(**govuk_date_input_options)
60
- (govuk_date_input_options[:fieldset][:attributes] ||= {})[:role] = 'group'
61
- end
60
+ def set_govuk_date_input_fieldset_options(**govuk_date_input_options)
61
+ (govuk_date_input_options[:fieldset][:attributes] ||= {})[:role] = 'group'
62
+ end
62
63
 
63
- # Wrapper method used by {govuk_date_input} to generate the date inputs HTML
64
- #
65
- # @param attribute [String, Symbol] the attribute of the date input
66
- # @param any_errors [Boolean] flag to indicate if the inputs need the error class
67
- # @param govuk_date_input_options [Hash] options that will be used in customising the HTML
68
- #
69
- # @option govuk_date_input_options [String] :classes additional CSS classes for the date inputs HTML
70
- # @option govuk_date_input_options[Array] :date_items an array of the date items that will be rendered.
71
- # Each date item hash must contain the +:name+ to add as suffix to attribute.
72
- # Anything else in the hash will be used as options in a {govuk_input}.
73
- # @option govuk_date_input_options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
74
- #
75
- # @yield the date input item HTML generated by the parent method
76
- #
77
- # @yieldparam date_item_attribute [String] the attribute for individual date input
78
- # @yieldparam date_item_input_options [Hash] the HTML options used for the date input item
79
- #
80
- # @return [ActiveSupport::SafeBuffer] the HTML for the date inputs which is used in {govuk_date_input}
81
-
82
- def _govuk_date_input_fields(attribute, any_errors, **govuk_date_input_options)
83
- govuk_date_input_options[:attributes] ||= {}
84
- govuk_date_input_options[:attributes][:class] = "govuk-date-input #{govuk_date_input_options[:classes]}".rstrip
85
- date_items = govuk_date_input_options[:date_items] || govuk_default_date_items
86
-
87
- tag.div(**govuk_date_input_options[:attributes]) do
88
- capture do
89
- enumerate_and_set_date_input_options(date_items, any_errors) do |date_item_input_options|
90
- concat(tag.div(class: 'govuk-date-input__item') do
91
- concat(yield("#{attribute}_#{date_item_input_options[:name]}", date_item_input_options))
92
- end)
64
+ # Wrapper method used by {govuk_date_input} to generate the date inputs HTML
65
+ #
66
+ # @param attribute [String, Symbol] the attribute of the date input
67
+ # @param any_errors [Boolean] flag to indicate if the inputs need the error class
68
+ # @param govuk_date_input_options [Hash] options that will be used in customising the HTML
69
+ #
70
+ # @option govuk_date_input_options [String] :classes additional CSS classes for the date inputs HTML
71
+ # @option govuk_date_input_options[Array] :date_items an array of the date items that will be rendered.
72
+ # Each date item hash must contain the +:name+ to add as suffix to attribute.
73
+ # Anything else in the hash will be used as options in a {govuk_input}.
74
+ # @option govuk_date_input_options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
75
+ #
76
+ # @yield the date input item HTML generated by the parent method
77
+ #
78
+ # @yieldparam date_item_attribute [String] the attribute for individual date input
79
+ # @yieldparam date_item_input_options [Hash] the HTML options used for the date input item
80
+ #
81
+ # @return [ActiveSupport::SafeBuffer] the HTML for the date inputs which is used in {govuk_date_input}
82
+
83
+ def _govuk_date_input_fields(attribute, any_errors, **govuk_date_input_options)
84
+ govuk_date_input_options[:attributes] ||= {}
85
+ govuk_date_input_options[:attributes][:class] = "govuk-date-input #{govuk_date_input_options[:classes]}".rstrip
86
+ date_items = govuk_date_input_options[:date_items] || govuk_default_date_items
87
+
88
+ tag.div(**govuk_date_input_options[:attributes]) do
89
+ capture do
90
+ enumerate_and_set_date_input_options(date_items, any_errors) do |date_item_input_options|
91
+ concat(tag.div(class: 'govuk-date-input__item') do
92
+ concat(yield("#{attribute}_#{date_item_input_options[:name]}", date_item_input_options))
93
+ end)
94
+ end
93
95
  end
94
96
  end
95
97
  end
96
- end
97
98
 
98
- # rubocop:disable Metrics/CyclomaticComplexity
99
+ # rubocop:disable Metrics/CyclomaticComplexity
99
100
 
100
- # Enumerates and inititalises the attributes of each date input item and is used by {_govuk_date_input_fields}
101
- #
102
- # @param date_items [Array] an array of the date item hashes that will be inititalised
103
- # @param any_errors [Boolean] flag to indicate if the inputs need the error class
104
- #
105
- # @yield the date input item HTML generated by teach date input item
106
- #
107
- # @yieldparam date_item_input_options [Hash] the HTML options used for the date input item
101
+ # Enumerates and inititalises the attributes of each date input item and is used by {_govuk_date_input_fields}
102
+ #
103
+ # @param date_items [Array] an array of the date item hashes that will be inititalised
104
+ # @param any_errors [Boolean] flag to indicate if the inputs need the error class
105
+ #
106
+ # @yield the date input item HTML generated by teach date input item
107
+ #
108
+ # @yieldparam date_item_input_options [Hash] the HTML options used for the date input item
108
109
 
109
- def enumerate_and_set_date_input_options(date_items, any_errors)
110
- date_items.each do |date_item_input_options|
111
- (date_item_input_options[:input] ||= {})[:attributes] ||= {}
110
+ def enumerate_and_set_date_input_options(date_items, any_errors)
111
+ date_items.each do |date_item_input_options|
112
+ (date_item_input_options[:input] ||= {})[:attributes] ||= {}
112
113
 
113
- date_item_input_options[:input][:classes] = "govuk-date-input__input #{date_item_input_options[:input][:classes]} #{'govuk-input--error' if any_errors}".rstrip
114
+ date_item_input_options[:input][:classes] = "govuk-date-input__input #{date_item_input_options[:input][:classes]} #{'govuk-input--error' if any_errors}".rstrip
114
115
 
115
- date_item_input_options[:input][:attributes][:inputmode] ||= 'numeric'
116
+ date_item_input_options[:input][:attributes][:inputmode] ||= 'numeric'
116
117
 
117
- date_item_input_options[:label] ||= {}
118
- date_item_input_options[:label][:text] ||= date_item_input_options[:name].capitalize
119
- date_item_input_options[:label][:classes] = 'govuk-date-input__label'
118
+ date_item_input_options[:label] ||= {}
119
+ date_item_input_options[:label][:text] ||= date_item_input_options[:name].capitalize
120
+ date_item_input_options[:label][:classes] = 'govuk-date-input__label'
120
121
 
121
- yield(date_item_input_options)
122
+ yield(date_item_input_options)
123
+ end
122
124
  end
123
- end
124
- # rubocop:enable Metrics/CyclomaticComplexity
125
-
126
- # The default date items used in {_govuk_date_input_fields} if no date items are provided
127
-
128
- def govuk_default_date_items
129
- [
130
- {
131
- name: 'day',
132
- input: {
133
- classes: 'govuk-input--width-2'
134
- }
135
- },
136
- {
137
- name: 'month',
138
- input: {
139
- classes: 'govuk-input--width-2'
125
+ # rubocop:enable Metrics/CyclomaticComplexity
126
+
127
+ # The default date items used in {_govuk_date_input_fields} if no date items are provided
128
+
129
+ def govuk_default_date_items
130
+ [
131
+ {
132
+ name: 'day',
133
+ input: {
134
+ classes: 'govuk-input--width-2'
135
+ }
136
+ },
137
+ {
138
+ name: 'month',
139
+ input: {
140
+ classes: 'govuk-input--width-2'
141
+ }
142
+ },
143
+ {
144
+ name: 'year',
145
+ input: {
146
+ classes: 'govuk-input--width-4'
147
+ }
140
148
  }
141
- },
142
- {
143
- name: 'year',
144
- input: {
145
- classes: 'govuk-input--width-4'
146
- }
147
- }
148
- ]
149
+ ]
150
+ end
149
151
  end
150
152
  end
151
153
  end
@@ -2,91 +2,93 @@
2
2
 
3
3
  require_relative '../field'
4
4
 
5
- module CrownMarketplaceUtils::Helpers
6
- module GovUkHelper
7
- module Field
8
- # = GOV.UK File Upload
9
- #
10
- # This helper is used for generating the file upload component from the
11
- # {https://design-system.service.gov.uk/components/file-upload GDS - Components - File Upload}
12
- #
13
- # This is considered a Field module and so makes use of the methods in {CrownMarketplaceUtils::GovUkHelper::Field}
14
-
15
- module FileUpload
16
- include Field
17
-
18
- # Generates the HTML for the GOV.UK file upload component
19
- #
20
- # @param attribute [String, Symbol] the attribute of the file upload
21
- # @param govuk_file_upload_options [Hash] options that will be used for the parts of the form group, label, hint and file upload
5
+ module CrownMarketplaceUtils
6
+ module Helpers
7
+ module GovUkHelper
8
+ module Field
9
+ # = GOV.UK File Upload
22
10
  #
23
- # @option govuk_file_upload_options [String] :error_message (nil) the error message to be displayed
24
- # @option govuk_file_upload_options [ActiveModel] :model (nil) optional model that can be used to find an error message
25
- # @option govuk_file_upload_options [ActionView::Helpers::FormBuilder] :form (nil) optional form builder used to create
26
- # the file upload input and find the error message
27
- # @option govuk_file_upload_options [Hash] :form_group see {govuk_field}
28
- # @option govuk_file_upload_options [Hash] :label see {govuk_field}
29
- # @option govuk_file_upload_options [Hash] :hint see {govuk_field}
30
- # @option govuk_file_upload_options [Hash] :file_upload ({}) the options that will be used when rendering the file upload.
31
- # See {set_file_upload_options} for more details.
11
+ # This helper is used for generating the file upload component from the
12
+ # {https://design-system.service.gov.uk/components/file-upload GDS - Components - File Upload}
32
13
  #
33
- # @return [ActiveSupport::SafeBuffer] the HTML for the GOV.UK File Upload
34
- # which can then be rendered on the page
14
+ # This is considered a Field module and so makes use of the methods in {CrownMarketplaceUtils::GovUkHelper::Field}
15
+
16
+ module FileUpload
17
+ include Field
18
+
19
+ # Generates the HTML for the GOV.UK file upload component
20
+ #
21
+ # @param attribute [String, Symbol] the attribute of the file upload
22
+ # @param govuk_file_upload_options [Hash] options that will be used for the parts of the form group, label, hint and file upload
23
+ #
24
+ # @option govuk_file_upload_options [String] :error_message (nil) the error message to be displayed
25
+ # @option govuk_file_upload_options [ActiveModel] :model (nil) optional model that can be used to find an error message
26
+ # @option govuk_file_upload_options [ActionView::Helpers::FormBuilder] :form (nil) optional form builder used to create
27
+ # the file upload input and find the error message
28
+ # @option govuk_file_upload_options [Hash] :form_group see {govuk_field}
29
+ # @option govuk_file_upload_options [Hash] :label see {govuk_field}
30
+ # @option govuk_file_upload_options [Hash] :hint see {govuk_field}
31
+ # @option govuk_file_upload_options [Hash] :file_upload ({}) the options that will be used when rendering the file upload.
32
+ # See {set_file_upload_options} for more details.
33
+ #
34
+ # @return [ActiveSupport::SafeBuffer] the HTML for the GOV.UK File Upload
35
+ # which can then be rendered on the page
35
36
 
36
- def govuk_file_upload(attribute, **govuk_file_upload_options)
37
- govuk_field(:file_upload, attribute, **govuk_file_upload_options) do |govuk_field_options, error_message|
38
- set_file_upload_options(error_message, govuk_field_options)
37
+ def govuk_file_upload(attribute, **govuk_file_upload_options)
38
+ govuk_field(:file_upload, attribute, **govuk_file_upload_options) do |govuk_field_options, error_message|
39
+ set_file_upload_options(error_message, govuk_field_options)
39
40
 
40
- concat(
41
- if govuk_file_upload_options[:form]
42
- govuk_file_upload_form(govuk_file_upload_options[:form], attribute, **govuk_field_options)
43
- else
44
- govuk_file_upload_tag(attribute, **govuk_field_options)
45
- end
46
- )
41
+ concat(
42
+ if govuk_file_upload_options[:form]
43
+ govuk_file_upload_form(govuk_file_upload_options[:form], attribute, **govuk_field_options)
44
+ else
45
+ govuk_file_upload_tag(attribute, **govuk_field_options)
46
+ end
47
+ )
48
+ end
47
49
  end
48
- end
49
50
 
50
- private
51
+ private
51
52
 
52
- # Generates the file upload HTML for {govuk_file_upload}
53
- #
54
- # @param attribute [String, Symbol] the attribute of the file upload
55
- # @param govuk_file_upload_options [Hash] options that will be used in customising the HTML
56
- #
57
- # @option (see set_file_upload_options)
58
- #
59
- # @return [ActiveSupport::SafeBuffer] the HTML for the file upload field which is used in {govuk_file_upload}
53
+ # Generates the file upload HTML for {govuk_file_upload}
54
+ #
55
+ # @param attribute [String, Symbol] the attribute of the file upload
56
+ # @param govuk_file_upload_options [Hash] options that will be used in customising the HTML
57
+ #
58
+ # @option (see set_file_upload_options)
59
+ #
60
+ # @return [ActiveSupport::SafeBuffer] the HTML for the file upload field which is used in {govuk_file_upload}
60
61
 
61
- def govuk_file_upload_tag(attribute, **govuk_file_upload_options)
62
- file_field_tag(attribute, **govuk_file_upload_options[:attributes])
63
- end
62
+ def govuk_file_upload_tag(attribute, **govuk_file_upload_options)
63
+ file_field_tag(attribute, **govuk_file_upload_options[:attributes])
64
+ end
64
65
 
65
- # Generates the file upload HTML for {govuk_file_upload} when there is a ActionView::Helpers::FormBuilder
66
- #
67
- # @param form [ActionView::Helpers::FormBuilder] the form builder used to create the file upload input
68
- # @param (see govuk_file_upload_tag)
69
- #
70
- # @option (see set_file_upload_options)
71
- #
72
- # @return (see govuk_file_upload_tag)
66
+ # Generates the file upload HTML for {govuk_file_upload} when there is a ActionView::Helpers::FormBuilder
67
+ #
68
+ # @param form [ActionView::Helpers::FormBuilder] the form builder used to create the file upload input
69
+ # @param (see govuk_file_upload_tag)
70
+ #
71
+ # @option (see set_file_upload_options)
72
+ #
73
+ # @return (see govuk_file_upload_tag)
73
74
 
74
- def govuk_file_upload_form(form, attribute, **govuk_file_upload_options)
75
- form.file_field(attribute, **govuk_file_upload_options[:attributes])
76
- end
75
+ def govuk_file_upload_form(form, attribute, **govuk_file_upload_options)
76
+ form.file_field(attribute, **govuk_file_upload_options[:attributes])
77
+ end
77
78
 
78
- # Initialises the attributes for the file upload input
79
- #
80
- # @param error_message [String] used to indicate if there is an error which will add extra classes
81
- # @param govuk_file_upload_options [Hash] options that will be used in customising the HTML
82
- #
83
- # @option govuk_file_upload_options [String] :classes additional CSS classes for the file iupload HTML
84
- # @option govuk_file_upload_options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
79
+ # Initialises the attributes for the file upload input
80
+ #
81
+ # @param error_message [String] used to indicate if there is an error which will add extra classes
82
+ # @param govuk_file_upload_options [Hash] options that will be used in customising the HTML
83
+ #
84
+ # @option govuk_file_upload_options [String] :classes additional CSS classes for the file iupload HTML
85
+ # @option govuk_file_upload_options [Hash] :attributes ({}) any additional attributes that will added as part of the HTML
85
86
 
86
- def set_file_upload_options(error_message, govuk_file_upload_options)
87
- govuk_file_upload_options[:attributes] ||= {}
88
- govuk_file_upload_options[:attributes][:class] = "govuk-file-upload #{govuk_file_upload_options[:classes]}".rstrip
89
- govuk_file_upload_options[:attributes][:class] << ' govuk-file-upload--error' if error_message
87
+ def set_file_upload_options(error_message, govuk_file_upload_options)
88
+ govuk_file_upload_options[:attributes] ||= {}
89
+ govuk_file_upload_options[:attributes][:class] = "govuk-file-upload #{govuk_file_upload_options[:classes]}".rstrip
90
+ govuk_file_upload_options[:attributes][:class] << ' govuk-file-upload--error' if error_message
91
+ end
90
92
  end
91
93
  end
92
94
  end