feat: look for links in configured questions
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
cc4178baba
commit
66d315e8d6
|
@ -23,6 +23,7 @@ class MusicrateSettingsForm(I18nModelForm):
|
||||||
if self.instance.genre_question
|
if self.instance.genre_question
|
||||||
else event.questions.all()
|
else event.questions.all()
|
||||||
)
|
)
|
||||||
|
self.fields["link_questions"].queryset = event.questions.all()
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = MusicrateSettings
|
model = MusicrateSettings
|
||||||
|
@ -30,17 +31,20 @@ class MusicrateSettingsForm(I18nModelForm):
|
||||||
"submission_types",
|
"submission_types",
|
||||||
"genre_question",
|
"genre_question",
|
||||||
"origin_question",
|
"origin_question",
|
||||||
|
"link_questions",
|
||||||
"advance_threshold",
|
"advance_threshold",
|
||||||
)
|
)
|
||||||
widgets = {
|
widgets = {
|
||||||
"submission_types": forms.SelectMultiple(attrs={"class": "select2"}),
|
"submission_types": forms.SelectMultiple(attrs={"class": "select2"}),
|
||||||
"genre_question": forms.Select(attrs={"class": "select2"}),
|
"genre_question": forms.Select(attrs={"class": "select2"}),
|
||||||
"origin_question": forms.Select(attrs={"class": "select2"}),
|
"origin_question": forms.Select(attrs={"class": "select2"}),
|
||||||
|
"link_questions": forms.SelectMultiple(attrs={"class": "select2"}),
|
||||||
}
|
}
|
||||||
field_classes = {
|
field_classes = {
|
||||||
"submission_types": SafeModelMultipleChoiceField,
|
"submission_types": SafeModelMultipleChoiceField,
|
||||||
"genre_question": SafeModelChoiceField,
|
"genre_question": SafeModelChoiceField,
|
||||||
"origin_question": SafeModelChoiceField,
|
"origin_question": SafeModelChoiceField,
|
||||||
|
"link_questions": SafeModelMultipleChoiceField,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: pretalx-musicrate 0.0.1\n"
|
"Project-Id-Version: pretalx-musicrate 0.0.1\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2023-12-16 03:01+0100\n"
|
"POT-Creation-Date: 2023-12-16 03:23+0100\n"
|
||||||
"PO-Revision-Date: 2023-12-16 03:02+0100\n"
|
"PO-Revision-Date: 2023-12-16 03:24+0100\n"
|
||||||
"Last-Translator: Luca <Luca@hackerspace-bamberg.de>\n"
|
"Last-Translator: Luca <Luca@hackerspace-bamberg.de>\n"
|
||||||
"Language-Team: Luca <Luca@hackerspace-bamberg.de>\n"
|
"Language-Team: Luca <Luca@hackerspace-bamberg.de>\n"
|
||||||
"Language: de_DE\n"
|
"Language: de_DE\n"
|
||||||
|
@ -58,6 +58,10 @@ msgstr ""
|
||||||
msgid "Advance Threshold"
|
msgid "Advance Threshold"
|
||||||
msgstr "Weiter-Schwellenwert"
|
msgstr "Weiter-Schwellenwert"
|
||||||
|
|
||||||
|
#: pretalx_musicrate/models.py:63
|
||||||
|
msgid "Link Questions"
|
||||||
|
msgstr "Fragen zu Links"
|
||||||
|
|
||||||
#: pretalx_musicrate/signals.py:16
|
#: pretalx_musicrate/signals.py:16
|
||||||
msgid "Collective Rating"
|
msgid "Collective Rating"
|
||||||
msgstr "Anhörtag"
|
msgstr "Anhörtag"
|
||||||
|
@ -101,19 +105,19 @@ msgstr "Zurück"
|
||||||
msgid "Next"
|
msgid "Next"
|
||||||
msgstr "Weiter"
|
msgstr "Weiter"
|
||||||
|
|
||||||
#: pretalx_musicrate/views.py:40
|
#: pretalx_musicrate/views.py:39
|
||||||
msgid "Invalid token"
|
msgid "Invalid token"
|
||||||
msgstr "Ungültiges Token"
|
msgstr "Ungültiges Token"
|
||||||
|
|
||||||
#: pretalx_musicrate/views.py:115
|
#: pretalx_musicrate/views.py:114
|
||||||
msgid "The pretalx-musicrate settings were updated."
|
msgid "The pretalx-musicrate settings were updated."
|
||||||
msgstr "Die pretalx-musicrate-Einstellungen wurden gespeichert."
|
msgstr "Die pretalx-musicrate-Einstellungen wurden gespeichert."
|
||||||
|
|
||||||
#: pretalx_musicrate/views.py:274
|
#: pretalx_musicrate/views.py:273
|
||||||
msgid "Saved!"
|
msgid "Saved!"
|
||||||
msgstr "Gespeichert!"
|
msgstr "Gespeichert!"
|
||||||
|
|
||||||
#: pretalx_musicrate/views.py:372
|
#: pretalx_musicrate/views.py:375
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "%(num_ratings)d of %(num_jurors)d has rated this submission"
|
msgid "%(num_ratings)d of %(num_jurors)d has rated this submission"
|
||||||
msgid_plural "%(num_ratings)d of %(num_jurors)d have rated this submission"
|
msgid_plural "%(num_ratings)d of %(num_jurors)d have rated this submission"
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 4.2.8 on 2023-12-16 02:17
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("submission", "0074_created_updated_everywhere"),
|
||||||
|
(
|
||||||
|
"pretalx_musicrate",
|
||||||
|
"0005_juror_musicratesettings_last_submission_rating_and_more",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="musicratesettings",
|
||||||
|
name="link_questions",
|
||||||
|
field=models.ManyToManyField(
|
||||||
|
related_name="pretalx_musicrate_settings_links",
|
||||||
|
to="submission.question",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -57,6 +57,12 @@ class MusicrateSettings(models.Model):
|
||||||
related_name="pretalx_musicrate_settings",
|
related_name="pretalx_musicrate_settings",
|
||||||
null=True,
|
null=True,
|
||||||
)
|
)
|
||||||
|
link_questions = models.ManyToManyField(
|
||||||
|
to="submission.Question",
|
||||||
|
related_name="pretalx_musicrate_settings_links",
|
||||||
|
verbose_name=_("Link Questions"),
|
||||||
|
blank=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Juror(PretalxModel):
|
class Juror(PretalxModel):
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
{% bootstrap_field form.submission_types layout='event' %}
|
{% bootstrap_field form.submission_types layout='event' %}
|
||||||
{% bootstrap_field form.genre_question layout='event' %}
|
{% bootstrap_field form.genre_question layout='event' %}
|
||||||
{% bootstrap_field form.origin_question layout='event' %}
|
{% bootstrap_field form.origin_question layout='event' %}
|
||||||
|
{% bootstrap_field form.link_questions layout='event' %}
|
||||||
{% bootstrap_field form.advance_threshold layout='event' %}
|
{% bootstrap_field form.advance_threshold layout='event' %}
|
||||||
{% include "orga/includes/submit_row.html" %}
|
{% include "orga/includes/submit_row.html" %}
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -311,6 +311,10 @@ class PresenterView(EventPermissionRequired, SubmissionMixin, TemplateView):
|
||||||
urlizer(self.submission.description)
|
urlizer(self.submission.description)
|
||||||
urlizer(self.submission.notes)
|
urlizer(self.submission.notes)
|
||||||
urlizer(self.submission.internal_notes)
|
urlizer(self.submission.internal_notes)
|
||||||
|
for answer in self.submission.answers.filter(
|
||||||
|
question__in=self.request.event.pretalx_musicrate_settings.link_questions.all()
|
||||||
|
).values_list("answer", flat=True):
|
||||||
|
urlizer(answer)
|
||||||
links = []
|
links = []
|
||||||
for url in extractor.urls:
|
for url in extractor.urls:
|
||||||
if (m := youtube_re.search(url)) is not None:
|
if (m := youtube_re.search(url)) is not None:
|
||||||
|
|
Loading…
Reference in New Issue