Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - app/controllers/settings/notifications_controller.rb - app/javascript/packs/public.js - app/views/settings/preferences/show.html.haml - app/views/stream_entries/_simple_status.html.haml - config/locales/simple_form.en.yml - config/locales/simple_form.pl.yml - config/navigation.rb - config/routes.rb
This commit is contained in:
@@ -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|
|
||||
|
||||
Reference in New Issue
Block a user