Skip to content
Snippets Groups Projects
Commit c6864297 authored by Felix Schäfer's avatar Felix Schäfer :construction_worker:
Browse files

Add a hint which questions will be publicly shown

parent e1daa9d9
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-11 22:48+0200\n"
"POT-Creation-Date: 2019-09-12 10:44+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Felix Schäfer\n"
"Language-Team: \n"
......@@ -15,7 +15,6 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"
#: __init__.py:13
#| msgid "Public registration"
msgid "Pretix public registrations"
msgstr ""
......@@ -43,10 +42,16 @@ msgstr "Teilnehmername anzeigen"
msgid "Show product name"
msgstr "Produktname anzeigen"
#: signals.py:38
#: signals.py:46
msgid "Public registration"
msgstr "Öffentliche Anmeldung"
#: signals.py:97
#: signals.py:49
#, python-format
msgid ""
"The answers to the following questions will be publicly shown: %(qlist)s"
msgstr "Antworten auf folgende Fragen werden öffentlich angezeigt: %(qlist)s"
#: signals.py:108
msgid "Public registrations"
msgstr "Öffentliche Anmeldungen"
......@@ -34,10 +34,21 @@ def add_public_registrations_html_head(sender, request=None, **kwargs):
@receiver(question_form_fields, dispatch_uid="public_registration_question")
def add_public_registration_question(sender, position, **kwargs):
if str(position.item.pk) in sender.settings.get('public_registrations_items'):
public_questions = sender.questions.filter(pk__in=sender.settings.get('public_registrations_questions'))
headers = (
[_("Product")] if sender.settings.get('public_registrations_show_item_name') else []
) + (
[_("Name")] if sender.settings.get('public_registrations_show_attendee_name') else []
) + [
q.question for q in public_questions
]
return {'public_registrations_public_registration': forms.BooleanField(
label=_('Public registration'),
required=False,
help_text=sender.settings.get('public_registrations_field_help_text', as_type=LazyI18nString),
help_text=_(
'The answers to the following questions will be publicly shown: %(qlist)s'
% {'qlist': ", ".join(str(h) for h in headers)}
),
)}
else:
return {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment