forked from CGM_Public/pretix_original
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
|
attrs['class'] = label_class
|
||||||
if label_title:
|
if label_title:
|
||||||
attrs['title'] = 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}>'
|
builder = '<{tag}{attrs}>{content}{opt}</{tag}>'
|
||||||
return format_html(
|
return format_html(
|
||||||
builder,
|
builder,
|
||||||
|
|||||||
@@ -311,6 +311,9 @@ input[type=number].short {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
label.label-empty {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
label .optional {
|
label .optional {
|
||||||
color: $text-muted;
|
color: $text-muted;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|||||||
Reference in New Issue
Block a user