0
0
Fork 0

Change preferences page into appearance, notifications, and other (#10977)

This commit is contained in:
Eugen Rochko 2019-06-07 03:39:24 +02:00 committed by GitHub
parent a60364ca7d
commit 1db4117030
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 130 additions and 296 deletions

View file

@ -8,7 +8,16 @@ module AppendComponent
end
end
module RecommendedComponent
def recommended(wrapper_options = nil)
return unless options[:recommended]
options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t('simple_form.recommended'), class: 'recommended')]) }
nil
end
end
SimpleForm.include_component(AppendComponent)
SimpleForm.include_component(RecommendedComponent)
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
@ -65,6 +74,7 @@ SimpleForm.setup do |config|
b.use :html5
b.wrapper tag: :div, class: :label_input do |ba|
ba.optional :recommended
ba.use :label
ba.wrapper tag: :div, class: :label_input__wrapper do |bb|