diff --git a/webcompat/form.py b/webcompat/form.py index 320720d74..f403f2e68 100644 --- a/webcompat/form.py +++ b/webcompat/form.py @@ -173,22 +173,20 @@ class PrefixedRadioField(RadioField): - """Prefix radio field label with an image.""" + """Prefix radio field label with an image. + + This renders the radio elements with a specific html markup. + """ def __init__(self, *args, **kwargs): prefixed_choices = kwargs.pop('choices') - template = '
{text}' choices = [] - - css_class = 'icon-container' for slug, img, text in prefixed_choices: - filename = 'img/svg/icons/{img}'.format(img=img) + filename = f'img/svg/icons/{img}' src = url_for('static', filename=filename) - label = Markup(template.format( - src=src, css_class=css_class, text=text) - ) + t = f'
{text}' + label = Markup(t) choice = (slug, label) choices.append(choice) - kwargs['choices'] = choices super().__init__(*args, **kwargs)