{"action":"created","issue":{"url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/65","repository_url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form","labels_url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/65/comments","events_url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/65/events","html_url":"https://github.com/DavyJonesLocker/client_side_validations-simple_form/issues/65","id":252237141,"node_id":"MDU6SXNzdWUyNTIyMzcxNDE=","number":65,"title":"Bootstrap v4","user":{"login":"tagliala","id":556268,"node_id":"MDQ6VXNlcjU1NjI2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/556268?v=4","gravatar_id":"","url":"https://api.github.com/users/tagliala","html_url":"https://github.com/tagliala","followers_url":"https://api.github.com/users/tagliala/followers","following_url":"https://api.github.com/users/tagliala/following{/other_user}","gists_url":"https://api.github.com/users/tagliala/gists{/gist_id}","starred_url":"https://api.github.com/users/tagliala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tagliala/subscriptions","organizations_url":"https://api.github.com/users/tagliala/orgs","repos_url":"https://api.github.com/users/tagliala/repos","events_url":"https://api.github.com/users/tagliala/events{/privacy}","received_events_url":"https://api.github.com/users/tagliala/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-23T10:39:38Z","updated_at":"2018-07-20T18:32:18Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Some random stuff useful for Bootstrap v4\r\n\r\nSimple Form configuration:\r\n```rb\r\n# frozen_string_literal: true\r\n\r\n# Use this setup block to configure all options available in SimpleForm.\r\nSimpleForm.setup do |config|\r\n  config.error_notification_class = 'alert alert-danger'\r\n  config.button_class = 'btn btn-primary'\r\n  config.boolean_label_class = nil\r\n\r\n  config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.use :placeholder\r\n    b.optional :maxlength\r\n    b.optional :pattern\r\n    b.optional :min_max\r\n    b.optional :readonly\r\n    b.use :label, class: 'form-control-label'\r\n\r\n    b.use :input, class: 'form-control'\r\n    b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n    b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  end\r\n\r\n  config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.use :placeholder\r\n    b.optional :maxlength\r\n    b.optional :readonly\r\n    b.use :label, class: 'form-control-label'\r\n\r\n    b.use :input\r\n    b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n    b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  end\r\n\r\n  #   config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n  #     b.use :html5\r\n  #     b.optional :readonly\r\n  #\r\n  #     b.wrapper tag: 'div', class: 'checkbox' do |ba|\r\n  #       ba.use :label_input\r\n  #     end\r\n  #\r\n  #     b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n  #     b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  #   end\r\n\r\n  config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.optional :readonly\r\n\r\n    b.wrapper tag: 'label', class: 'custom-control custom-checkbox' do |ba|\r\n      ba.use :input, class: 'custom-control-input'\r\n      ba.wrapper tag: 'span', class: 'custom-control-label' do |bb|\r\n        bb.use :label_text\r\n      end\r\n    end\r\n\r\n    b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n    b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  end\r\n\r\n  config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.optional :readonly\r\n    b.use :label, class: 'form-control-label'\r\n    b.use :input\r\n    b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n    b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  end\r\n\r\n  config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.use :placeholder\r\n    b.optional :maxlength\r\n    b.optional :pattern\r\n    b.optional :min_max\r\n    b.optional :readonly\r\n    b.use :label, class: 'col-sm-3 control-label'\r\n\r\n    b.wrapper tag: 'div', class: 'col-sm-9' do |ba|\r\n      ba.use :input, class: 'form-control'\r\n      ba.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n      ba.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n    end\r\n  end\r\n\r\n  config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.use :placeholder\r\n    b.optional :maxlength\r\n    b.optional :readonly\r\n    b.use :label, class: 'col-sm-3 control-label'\r\n\r\n    b.wrapper tag: 'div', class: 'col-sm-9' do |ba|\r\n      ba.use :input\r\n      ba.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n      ba.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n    end\r\n  end\r\n\r\n  config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.optional :readonly\r\n\r\n    b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr|\r\n      wr.wrapper tag: 'div', class: 'checkbox' do |ba|\r\n        ba.use :label_input\r\n      end\r\n\r\n      wr.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n      wr.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n    end\r\n  end\r\n\r\n  config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.optional :readonly\r\n\r\n    b.use :label, class: 'col-sm-3 control-label'\r\n\r\n    b.wrapper tag: 'div', class: 'col-sm-9' do |ba|\r\n      ba.use :input\r\n      ba.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n      ba.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n    end\r\n  end\r\n\r\n  config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.use :placeholder\r\n    b.optional :maxlength\r\n    b.optional :pattern\r\n    b.optional :min_max\r\n    b.optional :readonly\r\n    b.use :label, class: 'sr-only'\r\n\r\n    b.use :input, class: 'form-control'\r\n    b.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n    b.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n  end\r\n\r\n  config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-danger' do |b|\r\n    b.use :html5\r\n    b.optional :readonly\r\n    b.use :label, class: 'form-control-label'\r\n    b.wrapper tag: 'div', class: 'form-inline' do |ba|\r\n      ba.use :input, class: 'form-control'\r\n      ba.use :error, wrap_with: { tag: 'div', class: 'form-control-feedback' }\r\n      ba.use :hint,  wrap_with: { tag: 'small', class: 'form-text text-muted' }\r\n    end\r\n  end\r\n  # Wrappers for forms and inputs using the Bootstrap toolkit.\r\n  # Check the Bootstrap docs (http://getbootstrap.com)\r\n  # to learn about the different styles for forms and inputs,\r\n  # buttons and other elements.\r\n  config.default_wrapper = :vertical_form\r\n  config.wrapper_mappings = {\r\n    check_boxes: :vertical_radio_and_checkboxes,\r\n    radio_buttons: :vertical_radio_and_checkboxes,\r\n    file: :vertical_file_input,\r\n    boolean: :vertical_boolean,\r\n    datetime: :multi_select,\r\n    date: :multi_select,\r\n    time: :multi_select\r\n  }\r\nend\r\n# rubocop:enable Metrics/BlockLength\r\n```\r\n\r\nJavascript file for horizontal form:\r\n```coffee\r\nClientSideValidations.formBuilders['SimpleForm::FormBuilder'].wrappers.horizontal_form =\r\n  add: (element, settings, message) ->\r\n    wrapper = element.closest(\"#{settings.wrapper_tag}.#{settings.wrapper_class.replace(/\\ /g, '.')}\")\r\n    errorWrapper = element.closest(\"#{settings.wrapper_tag}[class^=\\\"col-\\\"]\")\r\n    errorElement = wrapper.find(\"#{settings.error_tag}.#{settings.error_class.replace(/\\ /g, '.')}\")\r\n    unless errorElement.length\r\n      errorElement = $(\"<#{settings.error_tag}/>\", { class: settings.error_class, text: message })\r\n      errorWrapper.append(errorElement)\r\n    element.addClass(settings.wrapper_error_class)\r\n    errorElement.text(message)\r\n  remove: (element, settings) ->\r\n    wrapper = element.closest(\"#{settings.wrapper_tag}.#{settings.wrapper_class.replace(/\\ /g, '.')}\")\r\n    errorWrapper = element.closest(\"#{settings.wrapper_tag}[class^=\\\"col-\\\"]\")\r\n    errorElement = errorWrapper.find(\"#{settings.error_tag}.#{settings.error_class.replace(/\\ /g, '.')}\")\r\n    element.removeClass(settings.wrapper_error_class)\r\n    errorElement.remove()\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/comments/406689639","html_url":"https://github.com/DavyJonesLocker/client_side_validations-simple_form/issues/65#issuecomment-406689639","issue_url":"https://api.github.com/repos/DavyJonesLocker/client_side_validations-simple_form/issues/65","id":406689639,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjY4OTYzOQ==","user":{"login":"tagliala","id":556268,"node_id":"MDQ6VXNlcjU1NjI2OA==","avatar_url":"https://avatars2.githubusercontent.com/u/556268?v=4","gravatar_id":"","url":"https://api.github.com/users/tagliala","html_url":"https://github.com/tagliala","followers_url":"https://api.github.com/users/tagliala/followers","following_url":"https://api.github.com/users/tagliala/following{/other_user}","gists_url":"https://api.github.com/users/tagliala/gists{/gist_id}","starred_url":"https://api.github.com/users/tagliala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tagliala/subscriptions","organizations_url":"https://api.github.com/users/tagliala/orgs","repos_url":"https://api.github.com/users/tagliala/repos","events_url":"https://api.github.com/users/tagliala/events{/privacy}","received_events_url":"https://api.github.com/users/tagliala/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T18:32:18Z","updated_at":"2018-07-20T18:32:18Z","author_association":"CONTRIBUTOR","body":"@macfurin thanks for the heads-up.\r\n\r\nI will take a look"}}
{"actor":{"display_login":"tagliala"}}