mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Backend forms: Do not allow to click empty labels
This commit is contained in:
@@ -19,6 +19,12 @@ def render_label(content, label_for=None, label_class=None, label_title='', opti
|
||||
attrs['class'] = label_class
|
||||
if label_title:
|
||||
attrs['title'] = label_title
|
||||
|
||||
if text_value(content) == ' ':
|
||||
# Empty label, e.g. checkbox
|
||||
attrs.setdefault('class', '')
|
||||
attrs['class'] += ' label-empty'
|
||||
|
||||
builder = '<{tag}{attrs}>{content}{opt}</{tag}>'
|
||||
return format_html(
|
||||
builder,
|
||||
|
||||
Reference in New Issue
Block a user