forked from CGM_Public/pretix_original
Allow markdown in multiple-choice question options
This commit is contained in:
@@ -214,6 +214,10 @@ def guess_country(event):
|
|||||||
return country
|
return country
|
||||||
|
|
||||||
|
|
||||||
|
class QuestionCheckboxSelectMultiple(forms.CheckboxSelectMultiple):
|
||||||
|
option_template_name = 'pretixbase/forms/widgets/checkbox_option_with_links.html'
|
||||||
|
|
||||||
|
|
||||||
class BaseQuestionsForm(forms.Form):
|
class BaseQuestionsForm(forms.Form):
|
||||||
"""
|
"""
|
||||||
This form class is responsible for asking order-related questions. This includes
|
This form class is responsible for asking order-related questions. This includes
|
||||||
@@ -332,7 +336,7 @@ class BaseQuestionsForm(forms.Form):
|
|||||||
label=label, required=required,
|
label=label, required=required,
|
||||||
help_text=help_text,
|
help_text=help_text,
|
||||||
to_field_name='identifier',
|
to_field_name='identifier',
|
||||||
widget=forms.CheckboxSelectMultiple,
|
widget=QuestionCheckboxSelectMultiple,
|
||||||
initial=initial.options.all() if initial else None,
|
initial=initial.options.all() if initial else None,
|
||||||
)
|
)
|
||||||
elif q.type == Question.TYPE_FILE:
|
elif q.type == Question.TYPE_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 %}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
{% load bootstrap3 %}
|
{% load bootstrap3 %}
|
||||||
{% load eventurl %}
|
{% load eventurl %}
|
||||||
{% load money %}
|
{% load money %}
|
||||||
|
{% load rich_text %}
|
||||||
{% load safelink %}
|
{% load safelink %}
|
||||||
{% load eventsignal %}
|
{% load eventsignal %}
|
||||||
{% block title %}
|
{% block title %}
|
||||||
@@ -377,6 +378,8 @@
|
|||||||
<img src="{{ q.answer.backend_file_url }}?token={% answer_token request q.answer %}">
|
<img src="{{ q.answer.backend_file_url }}?token={% answer_token request q.answer %}">
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% elif q.type == "M" %}
|
||||||
|
{{ q.answer|rich_text_snippet }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ q.answer|linebreaksbr }}
|
{{ q.answer|linebreaksbr }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load eventurl %}
|
{% load eventurl %}
|
||||||
{% load safelink %}
|
{% load safelink %}
|
||||||
|
{% load rich_text %}
|
||||||
{% load money %}
|
{% load money %}
|
||||||
{% blocktrans asvar s_taxes %}taxes{% endblocktrans %}
|
{% blocktrans asvar s_taxes %}taxes{% endblocktrans %}
|
||||||
{% for line in cart.positions %}
|
{% for line in cart.positions %}
|
||||||
@@ -59,6 +60,8 @@
|
|||||||
<a href="{{ q.answer.frontend_file_url }}?token={% answer_token request q.answer %}">
|
<a href="{{ q.answer.frontend_file_url }}?token={% answer_token request q.answer %}">
|
||||||
{{ q.answer.file_name }}
|
{{ q.answer.file_name }}
|
||||||
</a>
|
</a>
|
||||||
|
{% elif q.type == "M" %}
|
||||||
|
{{ q.answer|rich_text_snippet }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ q.answer|linebreaksbr }}
|
{{ q.answer|linebreaksbr }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user