Merge pull request #1917 from ClearlyClaire/glitch-soc/fixes/not-recommended-label

Fix “not recommended” label being shown as “recommended”
th-downstream
Claire 2 years ago committed by GitHub
commit efa93f0b5a

@ -204,7 +204,8 @@
}
.account-role,
.simple_form .recommended {
.simple_form .recommended,
.simple_form .not_recommended {
display: inline-block;
padding: 4px 6px;
cursor: default;
@ -229,6 +230,12 @@
}
}
.simple_form .not_recommended {
color: lighten($error-red, 12%);
background-color: rgba(lighten($error-red, 12%), 0.1);
border-color: rgba(lighten($error-red, 12%), 0.5);
}
.account__header__fields {
max-width: 100vw;
padding: 0;

@ -103,7 +103,8 @@ code {
}
}
.recommended {
.recommended,
.not_recommended {
position: absolute;
margin: 0 4px;
margin-top: -2px;

@ -202,7 +202,8 @@
}
.account-role,
.simple_form .recommended {
.simple_form .recommended,
.simple_form .not_recommended {
display: inline-block;
padding: 4px 6px;
cursor: default;
@ -227,6 +228,12 @@
}
}
.simple_form .not_recommended {
color: lighten($error-red, 12%);
background-color: rgba(lighten($error-red, 12%), 0.1);
border-color: rgba(lighten($error-red, 12%), 0.5);
}
.account__header__fields {
max-width: 100vw;
padding: 0;

@ -103,7 +103,8 @@ code {
}
}
.recommended {
.recommended,
.not_recommended {
position: absolute;
margin: 0 4px;
margin-top: -2px;

@ -50,7 +50,7 @@ ignore_unused:
- 'activerecord.errors.*'
- '{devise,pagination,doorkeeper}.*'
- '{date,datetime,time,number}.*'
- 'simple_form.{yes,no,recommended}'
- 'simple_form.{yes,no,recommended,not_recommended}'
- 'simple_form.{placeholders,hints,labels}.*'
- 'simple_form.{error_notification,required}.:'
- 'errors.messages.*'

@ -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

@ -298,6 +298,7 @@ en:
events: Enabled events
url: Endpoint URL
'no': 'No'
not_recommended: Not recommended
recommended: Recommended
required:
mark: "*"

Loading…
Cancel
Save