fat_free_crm 0.19.2 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fat_free_crm might be problematic. Click here for more details.

Files changed (226) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/brakeman-analysis.yml +46 -0
  3. data/.github/workflows/rubocop-analysis.yml +40 -0
  4. data/.github/workflows/ruby.yml +52 -0
  5. data/.rubocop_todo.yml +49 -43
  6. data/.travis.yml +1 -20
  7. data/CHANGELOG.md +13 -0
  8. data/Gemfile +9 -5
  9. data/Gemfile.lock +163 -119
  10. data/README.md +4 -3
  11. data/SECURITY.md +11 -0
  12. data/app/assets/javascripts/application.js.erb +3 -0
  13. data/app/assets/stylesheets/application.css.erb +1 -0
  14. data/app/assets/stylesheets/base.scss +9 -2
  15. data/app/assets/stylesheets/bootstrap-custom.scss +206 -0
  16. data/app/assets/stylesheets/common.scss +87 -67
  17. data/app/assets/stylesheets/header.scss +0 -8
  18. data/app/controllers/admin/field_groups_controller.rb +1 -1
  19. data/app/controllers/admin/fields_controller.rb +1 -1
  20. data/app/controllers/admin/groups_controller.rb +1 -1
  21. data/app/controllers/admin/tags_controller.rb +2 -2
  22. data/app/controllers/admin/users_controller.rb +2 -1
  23. data/app/controllers/application_controller.rb +10 -0
  24. data/app/controllers/comments_controller.rb +1 -1
  25. data/app/controllers/entities/accounts_controller.rb +1 -1
  26. data/app/controllers/entities/campaigns_controller.rb +1 -1
  27. data/app/controllers/home_controller.rb +3 -1
  28. data/app/controllers/lists_controller.rb +1 -1
  29. data/app/controllers/tasks_controller.rb +3 -3
  30. data/app/controllers/users_controller.rb +3 -1
  31. data/app/helpers/accounts_helper.rb +12 -0
  32. data/app/helpers/application_helper.rb +3 -5
  33. data/app/helpers/tasks_helper.rb +2 -2
  34. data/app/models/entities/account.rb +1 -1
  35. data/app/models/entities/account_contact.rb +1 -1
  36. data/app/models/entities/account_opportunity.rb +1 -1
  37. data/app/models/entities/campaign.rb +1 -1
  38. data/app/models/entities/contact.rb +1 -1
  39. data/app/models/entities/lead.rb +1 -1
  40. data/app/models/entities/opportunity.rb +1 -1
  41. data/app/models/fields/custom_field_pair.rb +2 -2
  42. data/app/models/observers/opportunity_observer.rb +1 -1
  43. data/app/models/polymorphic/address.rb +1 -1
  44. data/app/models/polymorphic/comment.rb +1 -1
  45. data/app/models/polymorphic/email.rb +1 -1
  46. data/app/models/polymorphic/task.rb +1 -1
  47. data/app/models/setting.rb +4 -2
  48. data/app/models/users/preference.rb +2 -2
  49. data/app/models/users/user.rb +2 -2
  50. data/app/views/accounts/_edit.html.haml +2 -2
  51. data/app/views/accounts/_new.html.haml +2 -2
  52. data/app/views/accounts/_sidebar_index.html.haml +2 -2
  53. data/app/views/accounts/_sidebar_show.html.haml +19 -19
  54. data/app/views/accounts/create.js.haml +1 -2
  55. data/app/views/accounts/destroy.js.haml +1 -1
  56. data/app/views/accounts/show.html.haml +1 -0
  57. data/app/views/accounts/update.js.haml +2 -3
  58. data/app/views/admin/field_groups/create.js.haml +0 -1
  59. data/app/views/admin/field_groups/destroy.js.haml +0 -1
  60. data/app/views/admin/field_groups/update.js.haml +0 -1
  61. data/app/views/admin/fields/create.js.haml +0 -1
  62. data/app/views/admin/fields/destroy.js.haml +0 -1
  63. data/app/views/admin/fields/update.js.haml +0 -1
  64. data/app/views/admin/groups/create.js.haml +0 -1
  65. data/app/views/admin/groups/destroy.js.haml +0 -1
  66. data/app/views/admin/groups/update.js.haml +0 -1
  67. data/app/views/admin/tags/create.js.haml +0 -1
  68. data/app/views/admin/tags/destroy.js.haml +0 -1
  69. data/app/views/admin/tags/update.js.haml +0 -1
  70. data/app/views/admin/users/create.js.haml +0 -1
  71. data/app/views/admin/users/destroy.js.haml +0 -1
  72. data/app/views/admin/users/update.js.haml +0 -1
  73. data/app/views/campaigns/_edit.html.haml +1 -1
  74. data/app/views/campaigns/_new.html.haml +1 -1
  75. data/app/views/campaigns/_sidebar_index.html.haml +2 -2
  76. data/app/views/campaigns/_sidebar_show.html.haml +68 -67
  77. data/app/views/campaigns/create.js.haml +1 -2
  78. data/app/views/campaigns/destroy.js.haml +1 -1
  79. data/app/views/campaigns/show.html.haml +1 -0
  80. data/app/views/campaigns/update.js.haml +3 -4
  81. data/app/views/comments/_edit.html.haml +1 -1
  82. data/app/views/comments/_new.html.haml +1 -1
  83. data/app/views/comments/update.js.haml +0 -1
  84. data/app/views/contacts/_edit.html.haml +1 -1
  85. data/app/views/contacts/_new.html.haml +1 -1
  86. data/app/views/contacts/_sidebar_show.html.haml +18 -18
  87. data/app/views/contacts/create.js.haml +0 -1
  88. data/app/views/contacts/destroy.js.haml +1 -1
  89. data/app/views/contacts/show.html.haml +1 -0
  90. data/app/views/contacts/update.js.haml +2 -3
  91. data/app/views/entities/_title_bar.html.haml +1 -1
  92. data/app/views/entities/attach.js.haml +2 -2
  93. data/app/views/entities/discard.js.haml +2 -2
  94. data/app/views/home/_opportunity.html.haml +1 -1
  95. data/app/views/home/_task.html.haml +1 -1
  96. data/app/views/home/index.xls.builder +51 -0
  97. data/app/views/layouts/_sidebar.html.haml +2 -2
  98. data/app/views/layouts/_tabbed.html.haml +14 -11
  99. data/app/views/layouts/application.html.haml +2 -2
  100. data/app/views/leads/_edit.html.haml +2 -2
  101. data/app/views/leads/_new.html.haml +2 -2
  102. data/app/views/leads/_sidebar_index.html.haml +2 -2
  103. data/app/views/leads/_sidebar_show.html.haml +30 -30
  104. data/app/views/leads/create.js.haml +2 -3
  105. data/app/views/leads/destroy.js.haml +2 -2
  106. data/app/views/leads/promote.js.haml +3 -4
  107. data/app/views/leads/reject.js.haml +3 -3
  108. data/app/views/leads/show.html.haml +1 -1
  109. data/app/views/leads/update.js.haml +4 -5
  110. data/app/views/lists/create.js.haml +0 -1
  111. data/app/views/opportunities/_edit.html.haml +1 -1
  112. data/app/views/opportunities/_index_brief.html.haml +1 -1
  113. data/app/views/opportunities/_index_long.html.haml +1 -1
  114. data/app/views/opportunities/_new.html.haml +1 -1
  115. data/app/views/opportunities/_sidebar_index.html.haml +2 -2
  116. data/app/views/opportunities/_sidebar_show.html.haml +47 -46
  117. data/app/views/opportunities/create.js.haml +3 -4
  118. data/app/views/opportunities/destroy.js.haml +3 -3
  119. data/app/views/opportunities/show.html.haml +1 -0
  120. data/app/views/opportunities/update.js.haml +5 -6
  121. data/app/views/shared/_inline_styles.html.haml +0 -26
  122. data/app/views/tasks/_assigned.html.haml +1 -1
  123. data/app/views/tasks/_completed.html.haml +1 -1
  124. data/app/views/tasks/_edit.html.haml +1 -1
  125. data/app/views/tasks/_new.html.haml +1 -1
  126. data/app/views/tasks/_pending.html.haml +1 -1
  127. data/app/views/tasks/_related.html.haml +1 -1
  128. data/app/views/tasks/_selector.html.haml +7 -8
  129. data/app/views/tasks/_sidebar_index.html.haml +2 -2
  130. data/app/views/tasks/_title.html.haml +1 -1
  131. data/app/views/tasks/complete.js.haml +1 -1
  132. data/app/views/tasks/create.js.haml +1 -2
  133. data/app/views/tasks/destroy.js.haml +1 -1
  134. data/app/views/tasks/uncomplete.js.haml +1 -2
  135. data/app/views/tasks/update.js.haml +0 -1
  136. data/app/views/users/change_password.js.haml +0 -1
  137. data/app/views/users/update.js.haml +0 -1
  138. data/app/views/users/upload_avatar.js.haml +0 -1
  139. data/app/views/versions/_version_item.html.haml +1 -1
  140. data/bin/setup +6 -6
  141. data/config/application.rb +1 -1
  142. data/config/environment.rb +1 -1
  143. data/config/initializers/content_security_policy.rb +5 -0
  144. data/config/initializers/new_framework_defaults_6_0.rb +46 -0
  145. data/config/initializers/simple_form.rb +135 -55
  146. data/config/initializers/simple_form_bootstrap.rb +433 -0
  147. data/config/locales/fat_free_crm.cs.yml +86 -47
  148. data/config/locales/fat_free_crm.ru.yml +1 -0
  149. data/config/settings.default.yml +0 -41
  150. data/db/migrate/20200806004152_add_pattern_to_fields.rb +7 -0
  151. data/db/migrate/20200806004459_add_html5_to_fields.rb +10 -0
  152. data/db/schema.rb +11 -6
  153. data/fat_free_crm.gemspec +4 -4
  154. data/lib/fat_free_crm/core_ext.rb +1 -1
  155. data/lib/fat_free_crm/gem_ext.rb +0 -1
  156. data/lib/fat_free_crm/tabs.rb +2 -2
  157. data/lib/fat_free_crm/version.rb +2 -2
  158. data/lib/gravatar_image_tag.rb +1 -1
  159. data/lib/tasks/ffcrm/preference_update.rake +19 -0
  160. data/lib/tasks/ffcrm/setup.rake +1 -1
  161. data/lib/templates/erb/scaffold/_form.html.erb +4 -2
  162. data/spec/controllers/comments_controller_spec.rb +6 -6
  163. data/spec/controllers/home_controller_spec.rb +3 -3
  164. data/spec/controllers/users_controller_spec.rb +13 -1
  165. data/spec/factories/user_factories.rb +5 -2
  166. data/spec/features/acceptance_helper.rb +1 -1
  167. data/spec/features/accounts_spec.rb +2 -2
  168. data/spec/features/admin/groups_spec.rb +1 -1
  169. data/spec/features/admin/users_spec.rb +1 -1
  170. data/spec/features/campaigns_spec.rb +2 -2
  171. data/spec/features/contacts_spec.rb +2 -5
  172. data/spec/features/leads_spec.rb +11 -7
  173. data/spec/features/opportunities_spec.rb +4 -4
  174. data/spec/features/support/browser.rb +6 -2
  175. data/spec/features/support/selector_helpers.rb +10 -1
  176. data/spec/features/tasks_spec.rb +6 -6
  177. data/spec/helpers/accounts_helper_spec.rb +57 -0
  178. data/spec/models/entities/opportunity_spec.rb +2 -2
  179. data/spec/models/fields/custom_field_pair_spec.rb +2 -2
  180. data/spec/models/observers/entity_observer_spec.rb +3 -3
  181. data/spec/models/polymorphic/task_spec.rb +11 -11
  182. data/spec/models/polymorphic/version_spec.rb +2 -2
  183. data/spec/models/users/preference_spec.rb +1 -1
  184. data/spec/views/accounts/_edit.haml_spec.rb +1 -1
  185. data/spec/views/accounts/_new.haml_spec.rb +1 -1
  186. data/spec/views/accounts/create.js.haml_spec.rb +0 -1
  187. data/spec/views/accounts/update.js.haml_spec.rb +2 -5
  188. data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -1
  189. data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -1
  190. data/spec/views/admin/users/create.js.haml_spec.rb +0 -1
  191. data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -6
  192. data/spec/views/admin/users/update.js.haml_spec.rb +1 -2
  193. data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
  194. data/spec/views/campaigns/_new.haml_spec.rb +1 -1
  195. data/spec/views/campaigns/create.js.haml_spec.rb +0 -1
  196. data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -1
  197. data/spec/views/campaigns/update.js.haml_spec.rb +2 -6
  198. data/spec/views/contacts/_edit.haml_spec.rb +1 -1
  199. data/spec/views/contacts/_new.haml_spec.rb +1 -1
  200. data/spec/views/contacts/create.js.haml_spec.rb +0 -1
  201. data/spec/views/contacts/update.js.haml_spec.rb +3 -7
  202. data/spec/views/home/index.haml_spec.rb +2 -2
  203. data/spec/views/leads/_edit.haml_spec.rb +1 -1
  204. data/spec/views/leads/_new.haml_spec.rb +1 -1
  205. data/spec/views/leads/create.js.haml_spec.rb +0 -3
  206. data/spec/views/leads/destroy.js.haml_spec.rb +0 -2
  207. data/spec/views/leads/promote.js.haml_spec.rb +3 -11
  208. data/spec/views/leads/reject.js.haml_spec.rb +0 -3
  209. data/spec/views/leads/update.js.haml_spec.rb +3 -11
  210. data/spec/views/opportunities/_edit.haml_spec.rb +1 -1
  211. data/spec/views/opportunities/_new.haml_spec.rb +1 -1
  212. data/spec/views/opportunities/create.js.haml_spec.rb +0 -2
  213. data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -3
  214. data/spec/views/opportunities/update.js.haml_spec.rb +3 -11
  215. data/spec/views/tasks/_edit.haml_spec.rb +1 -1
  216. data/spec/views/tasks/complete.js.haml_spec.rb +0 -1
  217. data/spec/views/tasks/create.js.haml_spec.rb +0 -2
  218. data/spec/views/tasks/destroy.js.haml_spec.rb +0 -1
  219. data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -1
  220. data/spec/views/tasks/update.js.haml_spec.rb +1 -4
  221. data/spec/views/users/change_password.js.haml_spec.rb +1 -2
  222. data/spec/views/users/update.js.haml_spec.rb +1 -2
  223. data/spec/views/users/upload_avatar.js.haml_spec.rb +1 -2
  224. metadata +23 -14
  225. data/config/initializers/new_framework_defaults_5_2.rb +0 -40
  226. data/lib/fat_free_crm/gem_ext/simple_form/action_view_extensions/form_helper.rb +0 -24
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+ # Be sure to restart your server when you modify this file.
3
+ #
4
+ # This file contains migration options to ease your Rails 6.0 upgrade.
5
+ #
6
+ # Once upgraded flip defaults one by one to migrate to the new default.
7
+ #
8
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
9
+
10
+ # Don't force requests from old versions of IE to be UTF-8 encoded.
11
+ # Rails.application.config.action_view.default_enforce_utf8 = false
12
+
13
+ # Embed purpose and expiry metadata inside signed and encrypted
14
+ # cookies for increased security.
15
+ #
16
+ # This option is not backwards compatible with earlier Rails versions.
17
+ # It's best enabled when your entire app is migrated and stable on 6.0.
18
+ # Rails.application.config.action_dispatch.use_cookies_with_metadata = true
19
+
20
+ # Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification.
21
+ # Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false
22
+
23
+ # Return false instead of self when enqueuing is aborted from a callback.
24
+ # Rails.application.config.active_job.return_false_on_aborted_enqueue = true
25
+
26
+ # Send Active Storage analysis and purge jobs to dedicated queues.
27
+ # Rails.application.config.active_storage.queues.analysis = :active_storage_analysis
28
+ # Rails.application.config.active_storage.queues.purge = :active_storage_purge
29
+
30
+ # When assigning to a collection of attachments declared via `has_many_attached`, replace existing
31
+ # attachments instead of appending. Use #attach to add new attachments without replacing existing ones.
32
+ # Rails.application.config.active_storage.replace_on_assign_to_many = true
33
+
34
+ # Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.
35
+ #
36
+ # The default delivery jobs (ActionMailer::Parameterized::DeliveryJob, ActionMailer::DeliveryJob),
37
+ # will be removed in Rails 6.1. This setting is not backwards compatible with earlier Rails versions.
38
+ # If you send mail in the background, job workers need to have a copy of
39
+ # MailDeliveryJob to ensure all delivery jobs are processed properly.
40
+ # Make sure your entire app is migrated and stable on 6.0 before using this setting.
41
+ # Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
42
+
43
+ # Enable the same cache key to be reused when the object being cached of type
44
+ # `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)
45
+ # of the relation's cache key into the cache version to support recycling cache key.
46
+ # Rails.application.config.active_record.collection_cache_versioning = true
@@ -5,88 +5,148 @@
5
5
  # Fat Free CRM is freely distributable under the terms of MIT license.
6
6
  # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
7
7
  #------------------------------------------------------------------------------
8
- require 'simple_form'
9
-
8
+ #
9
+ # Uncomment this and change the path if necessary to include your own
10
+ # components.
11
+ # See https://github.com/heartcombo/simple_form#custom-components to know
12
+ # more about custom components.
13
+ # Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
14
+ #
10
15
  # Use this setup block to configure all options available in SimpleForm.
11
16
  SimpleForm.setup do |config|
12
- # Components used by the form builder to generate a complete input. You can remove
13
- # any of them, change the order, or even add your own components to the stack.
14
- # config.components = [ :placeholder, :label_input, :hint, :error ]
15
-
16
- # Default tag used on hints.
17
- # config.hint_tag = :span
18
-
19
- # CSS class to add to all hint tags.
20
- # config.hint_class = :hint
21
-
22
- # CSS class used on errors.
23
- # config.error_class = :error
24
-
25
- # Default tag used on errors.
26
- # config.error_tag = :span
27
-
28
- # Method used to tidy up errors.
17
+ # Wrappers are used by the form builder to generate a
18
+ # complete input. You can remove any component from the
19
+ # wrapper, change the order or even add your own to the
20
+ # stack. The options given below are used to wrap the
21
+ # whole input.
22
+ config.wrappers :default, class: :input,
23
+ hint_class: :field_with_hint, error_class: :field_with_errors, valid_class: :field_without_errors do |b|
24
+ ## Extensions enabled by default
25
+ # Any of these extensions can be disabled for a
26
+ # given input by passing: `f.input EXTENSION_NAME => false`.
27
+ # You can make any of these extensions optional by
28
+ # renaming `b.use` to `b.optional`.
29
+
30
+ # Determines whether to use HTML5 (:email, :url, ...)
31
+ # and required attributes
32
+ b.use :html5
33
+
34
+ # Calculates placeholders automatically from I18n
35
+ # You can also pass a string as f.input placeholder: "Placeholder"
36
+ b.use :placeholder
37
+
38
+ ## Optional extensions
39
+ # They are disabled unless you pass `f.input EXTENSION_NAME => true`
40
+ # to the input. If so, they will retrieve the values from the model
41
+ # if any exists. If you want to enable any of those
42
+ # extensions by default, you can change `b.optional` to `b.use`.
43
+
44
+ # Calculates maxlength from length validations for string inputs
45
+ # and/or database column lengths
46
+ b.optional :maxlength
47
+
48
+ # Calculate minlength from length validations for string inputs
49
+ b.optional :minlength
50
+
51
+ # Calculates pattern from format validations for string inputs
52
+ b.optional :pattern
53
+
54
+ # Calculates min and max from length validations for numeric inputs
55
+ b.optional :min_max
56
+
57
+ # Calculates readonly automatically from readonly attributes
58
+ b.optional :readonly
59
+
60
+ ## Inputs
61
+ # b.use :input, class: 'input', error_class: 'is-invalid', valid_class: 'is-valid'
62
+ b.use :label_input
63
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
64
+ b.use :error, wrap_with: { tag: :span, class: :error }
65
+
66
+ ## full_messages_for
67
+ # If you want to display the full error message for the attribute, you can
68
+ # use the component :full_error, like:
69
+ #
70
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
71
+ end
72
+
73
+ # The default wrapper to be used by the FormBuilder.
74
+ config.default_wrapper = :default
75
+
76
+ # Define the way to render check boxes / radio buttons with labels.
77
+ # Defaults to :nested for bootstrap config.
78
+ # inline: input + label
79
+ # nested: label > input
80
+ config.boolean_style = :nested
81
+
82
+ # Default class for buttons
83
+ config.button_class = 'btn'
84
+
85
+ # Method used to tidy up errors. Specify any Rails Array method.
86
+ # :first lists the first message for each field.
87
+ # Use :to_sentence to list all errors for each field.
29
88
  # config.error_method = :first
30
89
 
31
90
  # Default tag used for error notification helper.
32
- # config.error_notification_tag = :p
91
+ config.error_notification_tag = :div
33
92
 
34
93
  # CSS class to add for error notification helper.
35
- # config.error_notification_class = :error_notification
94
+ config.error_notification_class = 'error_notification'
36
95
 
37
- # ID to add for error notification helper.
38
- # config.error_notification_id = nil
39
-
40
- # You can wrap all inputs in a pre-defined tag.
41
- # config.wrapper_tag = :div
42
-
43
- # CSS class to add to all wrapper tags.
44
- # config.wrapper_class = :input
96
+ # Series of attempts to detect a default label method for collection.
97
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
45
98
 
46
- # CSS class to add to the wrapper if the field has errors.
47
- # config.wrapper_error_class = :field_with_errors
99
+ # Series of attempts to detect a default value method for collection.
100
+ # config.collection_value_methods = [ :id, :to_s ]
48
101
 
49
102
  # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
50
103
  # config.collection_wrapper_tag = nil
51
104
 
52
- # You can wrap each item in a collection of radio/check boxes with a tag, defaulting to span.
53
- # config.item_wrapper_tag = :span
105
+ # You can define the class to use on all collection wrappers. Defaulting to none.
106
+ # config.collection_wrapper_class = nil
54
107
 
55
- # Series of attempts to detect a default label method for collection.
56
- # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
108
+ # You can wrap each item in a collection of radio/check boxes with a tag,
109
+ # defaulting to :span.
110
+ # config.item_wrapper_tag = :span
57
111
 
58
- # Series of attempts to detect a default value method for collection.
59
- # config.collection_value_methods = [ :id, :to_s ]
112
+ # You can define a class to use in all item wrappers. Defaulting to none.
113
+ # config.item_wrapper_class = nil
60
114
 
61
115
  # How the label text should be generated altogether with the required text.
62
- config.label_text = ->(label, _required, _explicit_label) { label.to_s }
116
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
63
117
 
64
118
  # You can define the class to use on all labels. Default is nil.
65
119
  # config.label_class = nil
66
120
 
67
- # You can define the class to use on all forms. Default is simple_form.
68
- # config.form_class = :simple_form
121
+ # You can define the default class to be used on forms. Can be overriden
122
+ # with `html: { :class }`. Defaulting to none.
123
+ # config.default_form_class = nil
124
+
125
+ # You can define which elements should obtain additional classes
126
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
69
127
 
70
128
  # Whether attributes are required by default (or not). Default is true.
71
129
  # config.required_by_default = true
72
130
 
73
- # Tell browsers whether to use default HTML5 validations (novalidate option).
74
- # Default is enabled.
75
- # config.browser_validations = true
76
-
77
- # Determines whether HTML5 types (:email, :url, :search, :tel) and attributes
78
- # (e.g. required) are used or not. True by default.
79
- # Having this on in non-HTML5 compliant sites can cause odd behavior in
80
- # HTML5-aware browsers such as Chrome.
81
- # config.html5 = true
131
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
132
+ # These validations are enabled in SimpleForm's internal config but disabled by default
133
+ # in this configuration, which is recommended due to some quirks from different browsers.
134
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
135
+ # change this configuration to true.
136
+ config.browser_validations = true
82
137
 
83
138
  # Custom mappings for input types. This should be a hash containing a regexp
84
139
  # to match as key, and the input type that will be used when the field name
85
140
  # matches the regexp as value.
86
141
  # config.input_mappings = { /count/ => :integer }
87
142
 
88
- # Collection of methods to detect if a file type was given.
89
- # config.file_methods = [ :mounted_as, :file?, :public_filename ]
143
+ # Custom wrappers for input types. This should be a hash containing an input
144
+ # type as key and the wrapper that will be used for all inputs with specified type.
145
+ # config.wrapper_mappings = { string: :prepend }
146
+
147
+ # Namespaces where SimpleForm should look for custom input classes that
148
+ # override default inputs.
149
+ # config.custom_inputs_namespaces << "CustomInputs"
90
150
 
91
151
  # Default priority for time_zone inputs.
92
152
  # config.time_zone_priority = nil
@@ -94,9 +154,29 @@ SimpleForm.setup do |config|
94
154
  # Default priority for country inputs.
95
155
  # config.country_priority = nil
96
156
 
97
- # Default size for text inputs.
98
- # config.default_input_size = 50
157
+ # When false, do not use translations for labels.
158
+ # config.translate_labels = true
159
+
160
+ # Automatically discover new inputs in Rails' autoload path.
161
+ # config.inputs_discovery = true
162
+
163
+ # Cache SimpleForm inputs discovery
164
+ # config.cache_discovery = !Rails.env.development?
165
+
166
+ # Default class for inputs
167
+ # config.input_class = nil
168
+
169
+ # Define the default class of the input wrapper of the boolean input.
170
+ config.boolean_label_class = 'checkbox'
171
+
172
+ # Defines if the default input wrapper class should be included in radio
173
+ # collection wrappers.
174
+ # config.include_default_input_wrapper_class = true
175
+
176
+ # Defines which i18n scope will be used in Simple Form.
177
+ # config.i18n_scope = 'simple_form'
99
178
 
100
- # When false, do not use translations for labels, hints or placeholders.
101
- # config.translate = true
179
+ # Defines validation classes to the input_field. By default it's nil.
180
+ # config.input_field_valid_class = 'is-valid'
181
+ # config.input_field_error_class = 'is-invalid'
102
182
  end