diff options
Diffstat (limited to 'lib/gitlab/form_builders/gitlab_ui_form_builder.rb')
-rw-r--r-- | lib/gitlab/form_builders/gitlab_ui_form_builder.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/gitlab/form_builders/gitlab_ui_form_builder.rb b/lib/gitlab/form_builders/gitlab_ui_form_builder.rb index 9174ca165cd..ea98f6b2eec 100644 --- a/lib/gitlab/form_builders/gitlab_ui_form_builder.rb +++ b/lib/gitlab/form_builders/gitlab_ui_form_builder.rb @@ -3,6 +3,20 @@ module Gitlab module FormBuilders class GitlabUiFormBuilder < ActionView::Helpers::FormBuilder + def submit(value = nil, options = {}) + if options[:pajamas_button] + @template.render Pajamas::ButtonComponent.new( + variant: :confirm, + type: :submit, + button_options: options.except(:pajamas_button) + ) do + value + end + else + super + end + end + def gitlab_ui_checkbox_component( method, label = nil, @@ -45,6 +59,10 @@ module Gitlab ).render_in(@template, &block) end + def gitlab_ui_datepicker(method, options = {}) + @template.text_field @object_name, method, options.merge(class: "datepicker form-control gl-form-input") + end + private def format_options(options) |