Convert radios on provider ratio page (basic)

Also changes the CSS for the radios slider variant
component.
This commit is contained in:
Tom Byers
2020-11-12 13:38:09 +00:00
parent 45526598c6
commit e979aef43f
3 changed files with 14 additions and 8 deletions

View File

@@ -1597,10 +1597,18 @@ class ProviderForm(StripWhitespaceForm):
class ProviderRatioForm(StripWhitespaceForm):
ratio = RadioField(choices=[
(str(value), '{}% / {}%'.format(value, 100 - value))
for value in range(100, -10, -10)
])
ratio = GovukRadiosField(choices=[
(str(value), '{}% / {}%'.format(value, 100 - value))
for value in range(100, -10, -10)
],
param_extensions={
"classes": "govuk-radios--inline",
"fieldset": {
"legend": {
"classes": "govuk-visually-hidden"
}
}
})
@property
def percentage_left(self):