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.
- checksums.yaml +4 -4
- data/.github/workflows/brakeman-analysis.yml +46 -0
- data/.github/workflows/rubocop-analysis.yml +40 -0
- data/.github/workflows/ruby.yml +52 -0
- data/.rubocop_todo.yml +49 -43
- data/.travis.yml +1 -20
- data/CHANGELOG.md +13 -0
- data/Gemfile +9 -5
- data/Gemfile.lock +163 -119
- data/README.md +4 -3
- data/SECURITY.md +11 -0
- data/app/assets/javascripts/application.js.erb +3 -0
- data/app/assets/stylesheets/application.css.erb +1 -0
- data/app/assets/stylesheets/base.scss +9 -2
- data/app/assets/stylesheets/bootstrap-custom.scss +206 -0
- data/app/assets/stylesheets/common.scss +87 -67
- data/app/assets/stylesheets/header.scss +0 -8
- data/app/controllers/admin/field_groups_controller.rb +1 -1
- data/app/controllers/admin/fields_controller.rb +1 -1
- data/app/controllers/admin/groups_controller.rb +1 -1
- data/app/controllers/admin/tags_controller.rb +2 -2
- data/app/controllers/admin/users_controller.rb +2 -1
- data/app/controllers/application_controller.rb +10 -0
- data/app/controllers/comments_controller.rb +1 -1
- data/app/controllers/entities/accounts_controller.rb +1 -1
- data/app/controllers/entities/campaigns_controller.rb +1 -1
- data/app/controllers/home_controller.rb +3 -1
- data/app/controllers/lists_controller.rb +1 -1
- data/app/controllers/tasks_controller.rb +3 -3
- data/app/controllers/users_controller.rb +3 -1
- data/app/helpers/accounts_helper.rb +12 -0
- data/app/helpers/application_helper.rb +3 -5
- data/app/helpers/tasks_helper.rb +2 -2
- data/app/models/entities/account.rb +1 -1
- data/app/models/entities/account_contact.rb +1 -1
- data/app/models/entities/account_opportunity.rb +1 -1
- data/app/models/entities/campaign.rb +1 -1
- data/app/models/entities/contact.rb +1 -1
- data/app/models/entities/lead.rb +1 -1
- data/app/models/entities/opportunity.rb +1 -1
- data/app/models/fields/custom_field_pair.rb +2 -2
- data/app/models/observers/opportunity_observer.rb +1 -1
- data/app/models/polymorphic/address.rb +1 -1
- data/app/models/polymorphic/comment.rb +1 -1
- data/app/models/polymorphic/email.rb +1 -1
- data/app/models/polymorphic/task.rb +1 -1
- data/app/models/setting.rb +4 -2
- data/app/models/users/preference.rb +2 -2
- data/app/models/users/user.rb +2 -2
- data/app/views/accounts/_edit.html.haml +2 -2
- data/app/views/accounts/_new.html.haml +2 -2
- data/app/views/accounts/_sidebar_index.html.haml +2 -2
- data/app/views/accounts/_sidebar_show.html.haml +19 -19
- data/app/views/accounts/create.js.haml +1 -2
- data/app/views/accounts/destroy.js.haml +1 -1
- data/app/views/accounts/show.html.haml +1 -0
- data/app/views/accounts/update.js.haml +2 -3
- data/app/views/admin/field_groups/create.js.haml +0 -1
- data/app/views/admin/field_groups/destroy.js.haml +0 -1
- data/app/views/admin/field_groups/update.js.haml +0 -1
- data/app/views/admin/fields/create.js.haml +0 -1
- data/app/views/admin/fields/destroy.js.haml +0 -1
- data/app/views/admin/fields/update.js.haml +0 -1
- data/app/views/admin/groups/create.js.haml +0 -1
- data/app/views/admin/groups/destroy.js.haml +0 -1
- data/app/views/admin/groups/update.js.haml +0 -1
- data/app/views/admin/tags/create.js.haml +0 -1
- data/app/views/admin/tags/destroy.js.haml +0 -1
- data/app/views/admin/tags/update.js.haml +0 -1
- data/app/views/admin/users/create.js.haml +0 -1
- data/app/views/admin/users/destroy.js.haml +0 -1
- data/app/views/admin/users/update.js.haml +0 -1
- data/app/views/campaigns/_edit.html.haml +1 -1
- data/app/views/campaigns/_new.html.haml +1 -1
- data/app/views/campaigns/_sidebar_index.html.haml +2 -2
- data/app/views/campaigns/_sidebar_show.html.haml +68 -67
- data/app/views/campaigns/create.js.haml +1 -2
- data/app/views/campaigns/destroy.js.haml +1 -1
- data/app/views/campaigns/show.html.haml +1 -0
- data/app/views/campaigns/update.js.haml +3 -4
- data/app/views/comments/_edit.html.haml +1 -1
- data/app/views/comments/_new.html.haml +1 -1
- data/app/views/comments/update.js.haml +0 -1
- data/app/views/contacts/_edit.html.haml +1 -1
- data/app/views/contacts/_new.html.haml +1 -1
- data/app/views/contacts/_sidebar_show.html.haml +18 -18
- data/app/views/contacts/create.js.haml +0 -1
- data/app/views/contacts/destroy.js.haml +1 -1
- data/app/views/contacts/show.html.haml +1 -0
- data/app/views/contacts/update.js.haml +2 -3
- data/app/views/entities/_title_bar.html.haml +1 -1
- data/app/views/entities/attach.js.haml +2 -2
- data/app/views/entities/discard.js.haml +2 -2
- data/app/views/home/_opportunity.html.haml +1 -1
- data/app/views/home/_task.html.haml +1 -1
- data/app/views/home/index.xls.builder +51 -0
- data/app/views/layouts/_sidebar.html.haml +2 -2
- data/app/views/layouts/_tabbed.html.haml +14 -11
- data/app/views/layouts/application.html.haml +2 -2
- data/app/views/leads/_edit.html.haml +2 -2
- data/app/views/leads/_new.html.haml +2 -2
- data/app/views/leads/_sidebar_index.html.haml +2 -2
- data/app/views/leads/_sidebar_show.html.haml +30 -30
- data/app/views/leads/create.js.haml +2 -3
- data/app/views/leads/destroy.js.haml +2 -2
- data/app/views/leads/promote.js.haml +3 -4
- data/app/views/leads/reject.js.haml +3 -3
- data/app/views/leads/show.html.haml +1 -1
- data/app/views/leads/update.js.haml +4 -5
- data/app/views/lists/create.js.haml +0 -1
- data/app/views/opportunities/_edit.html.haml +1 -1
- data/app/views/opportunities/_index_brief.html.haml +1 -1
- data/app/views/opportunities/_index_long.html.haml +1 -1
- data/app/views/opportunities/_new.html.haml +1 -1
- data/app/views/opportunities/_sidebar_index.html.haml +2 -2
- data/app/views/opportunities/_sidebar_show.html.haml +47 -46
- data/app/views/opportunities/create.js.haml +3 -4
- data/app/views/opportunities/destroy.js.haml +3 -3
- data/app/views/opportunities/show.html.haml +1 -0
- data/app/views/opportunities/update.js.haml +5 -6
- data/app/views/shared/_inline_styles.html.haml +0 -26
- data/app/views/tasks/_assigned.html.haml +1 -1
- data/app/views/tasks/_completed.html.haml +1 -1
- data/app/views/tasks/_edit.html.haml +1 -1
- data/app/views/tasks/_new.html.haml +1 -1
- data/app/views/tasks/_pending.html.haml +1 -1
- data/app/views/tasks/_related.html.haml +1 -1
- data/app/views/tasks/_selector.html.haml +7 -8
- data/app/views/tasks/_sidebar_index.html.haml +2 -2
- data/app/views/tasks/_title.html.haml +1 -1
- data/app/views/tasks/complete.js.haml +1 -1
- data/app/views/tasks/create.js.haml +1 -2
- data/app/views/tasks/destroy.js.haml +1 -1
- data/app/views/tasks/uncomplete.js.haml +1 -2
- data/app/views/tasks/update.js.haml +0 -1
- data/app/views/users/change_password.js.haml +0 -1
- data/app/views/users/update.js.haml +0 -1
- data/app/views/users/upload_avatar.js.haml +0 -1
- data/app/views/versions/_version_item.html.haml +1 -1
- data/bin/setup +6 -6
- data/config/application.rb +1 -1
- data/config/environment.rb +1 -1
- data/config/initializers/content_security_policy.rb +5 -0
- data/config/initializers/new_framework_defaults_6_0.rb +46 -0
- data/config/initializers/simple_form.rb +135 -55
- data/config/initializers/simple_form_bootstrap.rb +433 -0
- data/config/locales/fat_free_crm.cs.yml +86 -47
- data/config/locales/fat_free_crm.ru.yml +1 -0
- data/config/settings.default.yml +0 -41
- data/db/migrate/20200806004152_add_pattern_to_fields.rb +7 -0
- data/db/migrate/20200806004459_add_html5_to_fields.rb +10 -0
- data/db/schema.rb +11 -6
- data/fat_free_crm.gemspec +4 -4
- data/lib/fat_free_crm/core_ext.rb +1 -1
- data/lib/fat_free_crm/gem_ext.rb +0 -1
- data/lib/fat_free_crm/tabs.rb +2 -2
- data/lib/fat_free_crm/version.rb +2 -2
- data/lib/gravatar_image_tag.rb +1 -1
- data/lib/tasks/ffcrm/preference_update.rake +19 -0
- data/lib/tasks/ffcrm/setup.rake +1 -1
- data/lib/templates/erb/scaffold/_form.html.erb +4 -2
- data/spec/controllers/comments_controller_spec.rb +6 -6
- data/spec/controllers/home_controller_spec.rb +3 -3
- data/spec/controllers/users_controller_spec.rb +13 -1
- data/spec/factories/user_factories.rb +5 -2
- data/spec/features/acceptance_helper.rb +1 -1
- data/spec/features/accounts_spec.rb +2 -2
- data/spec/features/admin/groups_spec.rb +1 -1
- data/spec/features/admin/users_spec.rb +1 -1
- data/spec/features/campaigns_spec.rb +2 -2
- data/spec/features/contacts_spec.rb +2 -5
- data/spec/features/leads_spec.rb +11 -7
- data/spec/features/opportunities_spec.rb +4 -4
- data/spec/features/support/browser.rb +6 -2
- data/spec/features/support/selector_helpers.rb +10 -1
- data/spec/features/tasks_spec.rb +6 -6
- data/spec/helpers/accounts_helper_spec.rb +57 -0
- data/spec/models/entities/opportunity_spec.rb +2 -2
- data/spec/models/fields/custom_field_pair_spec.rb +2 -2
- data/spec/models/observers/entity_observer_spec.rb +3 -3
- data/spec/models/polymorphic/task_spec.rb +11 -11
- data/spec/models/polymorphic/version_spec.rb +2 -2
- data/spec/models/users/preference_spec.rb +1 -1
- data/spec/views/accounts/_edit.haml_spec.rb +1 -1
- data/spec/views/accounts/_new.haml_spec.rb +1 -1
- data/spec/views/accounts/create.js.haml_spec.rb +0 -1
- data/spec/views/accounts/update.js.haml_spec.rb +2 -5
- data/spec/views/admin/field_groups/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/field_groups/update.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/create.js.haml_spec.rb +0 -1
- data/spec/views/admin/users/destroy.js.haml_spec.rb +0 -6
- data/spec/views/admin/users/update.js.haml_spec.rb +1 -2
- data/spec/views/campaigns/_edit.haml_spec.rb +1 -1
- data/spec/views/campaigns/_new.haml_spec.rb +1 -1
- data/spec/views/campaigns/create.js.haml_spec.rb +0 -1
- data/spec/views/campaigns/destroy.js.haml_spec.rb +0 -1
- data/spec/views/campaigns/update.js.haml_spec.rb +2 -6
- data/spec/views/contacts/_edit.haml_spec.rb +1 -1
- data/spec/views/contacts/_new.haml_spec.rb +1 -1
- data/spec/views/contacts/create.js.haml_spec.rb +0 -1
- data/spec/views/contacts/update.js.haml_spec.rb +3 -7
- data/spec/views/home/index.haml_spec.rb +2 -2
- data/spec/views/leads/_edit.haml_spec.rb +1 -1
- data/spec/views/leads/_new.haml_spec.rb +1 -1
- data/spec/views/leads/create.js.haml_spec.rb +0 -3
- data/spec/views/leads/destroy.js.haml_spec.rb +0 -2
- data/spec/views/leads/promote.js.haml_spec.rb +3 -11
- data/spec/views/leads/reject.js.haml_spec.rb +0 -3
- data/spec/views/leads/update.js.haml_spec.rb +3 -11
- data/spec/views/opportunities/_edit.haml_spec.rb +1 -1
- data/spec/views/opportunities/_new.haml_spec.rb +1 -1
- data/spec/views/opportunities/create.js.haml_spec.rb +0 -2
- data/spec/views/opportunities/destroy.js.haml_spec.rb +0 -3
- data/spec/views/opportunities/update.js.haml_spec.rb +3 -11
- data/spec/views/tasks/_edit.haml_spec.rb +1 -1
- data/spec/views/tasks/complete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/create.js.haml_spec.rb +0 -2
- data/spec/views/tasks/destroy.js.haml_spec.rb +0 -1
- data/spec/views/tasks/uncomplete.js.haml_spec.rb +0 -1
- data/spec/views/tasks/update.js.haml_spec.rb +1 -4
- data/spec/views/users/change_password.js.haml_spec.rb +1 -2
- data/spec/views/users/update.js.haml_spec.rb +1 -2
- data/spec/views/users/upload_avatar.js.haml_spec.rb +1 -2
- metadata +23 -14
- data/config/initializers/new_framework_defaults_5_2.rb +0 -40
- 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
|
-
|
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
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
|
91
|
+
config.error_notification_tag = :div
|
33
92
|
|
34
93
|
# CSS class to add for error notification helper.
|
35
|
-
|
94
|
+
config.error_notification_class = 'error_notification'
|
36
95
|
|
37
|
-
#
|
38
|
-
# config.
|
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
|
-
#
|
47
|
-
# config.
|
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
|
53
|
-
# config.
|
105
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
106
|
+
# config.collection_wrapper_class = nil
|
54
107
|
|
55
|
-
#
|
56
|
-
#
|
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
|
-
#
|
59
|
-
# config.
|
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 =
|
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
|
68
|
-
#
|
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
|
74
|
-
#
|
75
|
-
#
|
76
|
-
|
77
|
-
#
|
78
|
-
|
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
|
-
#
|
89
|
-
#
|
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
|
-
#
|
98
|
-
# config.
|
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
|
-
#
|
101
|
-
# config.
|
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
|