0
0
Fork 0

Change "Allow trends without prior review" setting to include statuses (#17977)

* Change "Allow trends without prior review" setting to include posts

* Fix i18n-tasks
This commit is contained in:
Eugen Rochko 2022-08-28 04:00:39 +02:00 committed by GitHub
parent c57907737a
commit 546672e292
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 7 deletions

View file

@ -11,7 +11,10 @@ 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')]) }
key = options[:recommended].is_a?(Symbol) ? options[:recommended] : :recommended
options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t(key, scope: 'simple_form'), class: key)]) }
nil
end
end