Allow markdown in multiple-choice question options

This commit is contained in:
Raphael Michel
2020-03-23 17:17:36 +01:00
parent 8986db0975
commit 11b2bd8887
4 changed files with 13 additions and 1 deletions

View File

@@ -214,6 +214,10 @@ def guess_country(event):
return country
class QuestionCheckboxSelectMultiple(forms.CheckboxSelectMultiple):
option_template_name = 'pretixbase/forms/widgets/checkbox_option_with_links.html'
class BaseQuestionsForm(forms.Form):
"""
This form class is responsible for asking order-related questions. This includes
@@ -332,7 +336,7 @@ class BaseQuestionsForm(forms.Form):
label=label, required=required,
help_text=help_text,
to_field_name='identifier',
widget=forms.CheckboxSelectMultiple,
widget=QuestionCheckboxSelectMultiple,
initial=initial.options.all() if initial else None,
)
elif q.type == Question.TYPE_FILE:

View File

@@ -0,0 +1,2 @@
{% load rich_text %}
{% if widget.wrap_label %}<label{% if widget.attrs.id %} for="{{ widget.attrs.id }}"{% endif %}>{% endif %}{% include "django/forms/widgets/input.html" %}{% if widget.wrap_label %} {{ widget.label|rich_text_snippet }}</label>{% endif %}