Projet

Général

Profil

0001-misc-add-a-class-to-disabled-radiobutton-items-13516.patch

Frédéric Péters, 09 octobre 2016 10:34

Télécharger (1,49 ko)

Voir les différences:

Subject: [PATCH] misc: add a class to disabled radiobutton items (#13516)

 wcs/qommon/form.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
wcs/qommon/form.py
215 215
        tags = []
216 216
        for option in options:
217 217
            object, description, key = option[:3]
218
            label_tag = htmltext('<label>')
218 219
            html_attrs = self.attrs.copy()
219 220
            if self.is_selected(object):
220 221
                html_attrs['checked'] = 'checked'
221 222
            if self.options_with_attributes and option[-1].get('disabled'):
222 223
                html_attrs['disabled'] = 'disabled'
224
                label_tag = htmltext('<label class="disabled">')
223 225
            r = htmltag("input", xml_end=True,
224 226
                        type="radio",
225 227
                        name=self.name,
226 228
                        value=key,
227 229
                        **html_attrs)
228
            tags.append(htmltext('<label>') + r + htmlescape(description) + htmltext('</label>'))
230
            tags.append(label_tag + r + htmlescape(description) + htmltext('</label>'))
229 231
        return htmlescape(self.delim).join(tags)
230 232

  
231 233
def checkbox_render_content(self):
232
-