Compare commits

...

7 Commits

Author SHA1 Message Date
Luca 81f1d44700 chore: update localization
continuous-integration/drone/push Build is passing Details
2024-11-02 19:34:39 +01:00
Luca 1c8047a006 refactor: remove dependencies on Bootstrap and jQuery 2024-11-02 19:21:47 +01:00
Luca 6823e11ff0 refactor: match urls using pretalx' custom SLUG_REGEX 2024-11-02 19:20:35 +01:00
Luca a693370a7d chore: remove legacy css classes on widgets 2024-11-02 19:15:31 +01:00
Luca 5b508bf61b fix: mixins import path 2024-11-02 19:14:29 +01:00
Luca d4a1a4738f chore: start development cycle 2024-11-02 19:13:30 +01:00
Luca 91acd4e855 style: add .editorconfig 2024-11-02 19:12:14 +01:00
12 changed files with 107 additions and 115 deletions

5
.editorconfig Normal file
View File

@ -0,0 +1,5 @@
root = true
[*.{html,js}]
indent_size = 4
indent_style = space

View File

@ -1 +1 @@
__version__ = "0.15.0"
__version__ = "2025.1.0.dev0"

View File

@ -37,12 +37,6 @@ class MusicrateSettingsForm(I18nModelForm):
"link_questions",
"advance_threshold",
)
widgets = {
"submission_types": forms.SelectMultiple(attrs={"class": "select2"}),
"genre_question": forms.Select(attrs={"class": "select2"}),
"origin_question": forms.Select(attrs={"class": "select2"}),
"link_questions": forms.SelectMultiple(attrs={"class": "select2"}),
}
field_classes = {
"submission_types": SafeModelMultipleChoiceField,
"genre_question": SafeModelChoiceField,

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pretalx-musicrate 0.9.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-02-14 22:24+0100\n"
"POT-Creation-Date: 2024-11-02 19:23+0100\n"
"PO-Revision-Date: 2024-02-14 22:30+0100\n"
"Last-Translator: Luca <Luca@hackerspace-bamberg.de>\n"
"Language-Team: Luca <Luca@hackerspace-bamberg.de>\n"
@ -18,7 +18,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.1\n"
#: pretalx_musicrate/apps.py:12
#: pretalx_musicrate/apps.py:12 pretalx_musicrate/signals.py:59
msgid "pretalx-musicrate"
msgstr "pretalx-musicrate"
@ -26,7 +26,7 @@ msgstr "pretalx-musicrate"
msgid "pretalx plugin for rating music"
msgstr "pretalx-Plugin zur Bewertung von Musik"
#: pretalx_musicrate/forms.py:85
#: pretalx_musicrate/forms.py:79
msgid "require all"
msgstr "alle voraussetzen"
@ -71,100 +71,95 @@ msgid "The name of the submission's assignee"
msgstr "Der Name der für die Einreichung zuständigen Person"
#: pretalx_musicrate/signals.py:35
msgid "Proposals, but better"
msgstr "Einreichungen, aber besser"
msgid "Sessions, but better"
msgstr "Vorträge, aber besser"
#: pretalx_musicrate/signals.py:45
msgid "Collective Rating"
msgstr "Anhörtag"
#: pretalx_musicrate/templates/pretalx_musicrate/assignee.html:6
#: pretalx_musicrate/templates/pretalx_musicrate/assignee.html:5
#, python-format
msgid "Assignee for %(quotation_open)s%(title)s%(quotation_close)s"
msgstr "Zuständige*r für %(quotation_open)s%(title)s%(quotation_close)s"
#: pretalx_musicrate/templates/pretalx_musicrate/assignee.html:16
#: pretalx_musicrate/templates/pretalx_musicrate/settings.html:22
msgid "Save"
msgstr "Speichern"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:23
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:43
msgid "proposal"
msgid_plural "proposals"
msgstr[0] "Einreichung"
msgstr[1] "Einreichungen"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:46
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:72
msgid "Search"
msgstr "Suche"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:51
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:77
#, python-format
msgid "List filtered by answers to question \"%(question)s\"."
msgstr "Liste gefiltert nach Antworten zur Frage \"%(question)s\"."
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:56
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:82
msgid "Remove filter"
msgstr "Filter entfernen"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:67
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:93
msgid "Rating"
msgstr "Bewertung"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:68
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:94
msgid "Sort by rating (0-10)"
msgstr "Nach Bewertung sortieren (0-10)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:69
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:95
msgid "Sort by rating (10-0)"
msgstr "Nach Bewertung sortieren (10-0)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:72
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:98
msgid "Title"
msgstr "Titel"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:73
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:99
msgid "Sort by title (a-z)"
msgstr "Nach Titel sortieren (a-z)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:74
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:100
msgid "Sort by title (z-a)"
msgstr "Nach Titel sortieren (z-a)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:78
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:104
msgid "Type"
msgstr "Typ"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:82
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:108
msgid "State"
msgstr "Status"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:83
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:109
msgid "Sort by state (a-z)"
msgstr "Nach Status sortieren (a-z)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:84
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:110
msgid "Sort by state (z-a)"
msgstr "Nach Status sortieren (z-a)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:87
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:113
msgid "Assignee"
msgstr "Zuständige*r"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:88
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:114
msgid "Sort by assignee (a-z)"
msgstr "Nach Zuständiger*m sortieren (a-z)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:89
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:115
msgid "Sort by assignee (z-a)"
msgstr "Nach Zuständiger*m sortieren (z-a)"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:128
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:136
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:154
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:162
msgid "edit"
msgstr "bearbeiten"
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:141
#: pretalx_musicrate/templates/pretalx_musicrate/enhanced_list.html:167
msgid "Delete"
msgstr "Löschen"
@ -191,11 +186,11 @@ msgstr "Mitmach-QR-Code anzeigen"
msgid "Go to collective rating"
msgstr "Zum Anhörtag"
#: pretalx_musicrate/templates/pretalx_musicrate/settings.html:8
#: pretalx_musicrate/templates/pretalx_musicrate/settings.html:7
msgid "pretalx-musicrate settings"
msgstr "pretalx-musicrate-Einstellungen"
#: pretalx_musicrate/templates/pretalx_musicrate/settings.html:30
#: pretalx_musicrate/templates/pretalx_musicrate/settings.html:12
msgid "Export ratings"
msgstr "Bewertungen exportieren"

View File

@ -1,7 +1,7 @@
# Generated by Django 4.2.8 on 2023-12-15 18:27
import django.db.models.deletion
import pretalx.common.mixins.models
import pretalx.common.models.mixins
from django.db import migrations, models
import pretalx_musicrate.models
@ -51,8 +51,8 @@ class Migration(migrations.Migration):
"abstract": False,
},
bases=(
pretalx.common.mixins.models.LogMixin,
pretalx.common.mixins.models.FileCleanupMixin,
pretalx.common.models.mixins.LogMixin,
pretalx.common.models.mixins.FileCleanupMixin,
models.Model,
),
),

View File

@ -32,7 +32,7 @@ def pretalx_musicrate_nav_event(sender, request, **kwargs):
"active": request.resolver_match.view_name
== "plugins:pretalx_musicrate:enhanced_list",
"icon": "sticky-note-o",
"label": _("Proposals, but better"),
"label": _("Sessions, but better"),
"url": reverse(
"plugins:pretalx_musicrate:enhanced_list",
kwargs={"event": request.event.slug},
@ -56,7 +56,7 @@ def pretalx_musicrate_settings(sender, request, **kwargs):
return []
return [
{
"label": "pretalx-musicrate",
"label": _("pretalx-musicrate"),
"url": reverse(
"plugins:pretalx_musicrate:settings.musicrate",
kwargs={"event": request.event.slug},

View File

@ -1,4 +1,4 @@
document.addEventListener("DOMContentLoaded", function() {
onReady(() => {
const updateRequireAllVisibility = () => {
if (document.querySelector("#id_tags").value) {
document.querySelector("#requireAll").classList.remove("d-none")
@ -6,6 +6,9 @@ document.addEventListener("DOMContentLoaded", function() {
document.querySelector("#requireAll").classList.add("d-none")
}
}
$("#id_tags").on("change", updateRequireAllVisibility)
document
.querySelector("#id_tags")
.addEventListener("change", updateRequireAllVisibility)
updateRequireAllVisibility()
})

View File

@ -1,22 +1,8 @@
{% extends "orga/base.html" %}
{% load bootstrap4 %}
{% load i18n %}
{% block content %}
<h2>{% blocktranslate with title=submission.title %}Assignee for {{ quotation_open }}{{ title }}{{ quotation_close }}{% endblocktranslate %}</h2>
<form method="post">
{% csrf_token %}
{% bootstrap_form_errors form %}
{% bootstrap_field form.user layout='event' %}
<div class="submit-group panel">
<span></span>
<span>
<button type="submit" class="btn btn-success btn-lg">
<i class="fa fa-check"></i>
{% translate "Save" %}
</button>
</span>
</div>
</form>
{% include "orga/includes/base_form.html" %}
{% endblock %}

View File

@ -1,17 +1,37 @@
{% extends "orga/base.html" %}
{% load bootstrap4 %}
{% load compress %}
{% load i18n %}
{% load rules %}
{% load static %}
{% load url_replace %}
{% block scripts %}
{% compress js %}
<script src="{% static "orga/js/submission_filter.js" %}"></script>
<script defer src="{% static "orga/js/submission_filter.js" %}"></script>
{% endcompress %}
{% compress js %}
<script src="{% static "pretalx_musicrate/submission_filter.js" %}"></script>
<script defer src="{% static "pretalx_musicrate/submission_filter.js" %}"></script>
{% endcompress %}
{% endblock %}
{% block stylesheets %}
{% compress css %}
<style>
.search-form {
#requireAll .form-group {
margin-bottom: 0;
}
#requireAll label {
display: inline-block;
color: #6c757d;
}
}
#requireAll .form-group-inline {
flex-direction: row;
align-items: center;
}
</style>
{% endcompress %}
{% endblock %}
@ -29,20 +49,26 @@
<div class="submit-group search-submit-group">
<form class="search-form">
{% bootstrap_field filter_form.q %}
{% if show_submission_types and filter_form.submission_type %}{% bootstrap_field filter_form.submission_type %}{% endif %}
{{ filter_form.q.as_field_group }}
{% if show_submission_types and filter_form.submission_type %}{{ filter_form.submission_type.as_field_group }}{% endif %}
<div class="d-flex flex-column form-group">
{% bootstrap_field filter_form.state layout='inline' %}
<div id="pending" class="d-none">{% bootstrap_field filter_form.pending_state__isnull layout='inline' %}</div>
{{ filter_form.state.as_field_group }}
<div id="pending" class="ml-1 d-none">{{ filter_form.pending_state__isnull.as_field_group }}</div>
</div>
{% if filter_form.track %}{% bootstrap_field filter_form.track %}{% endif %}
{% if filter_form.track %}{{ filter_form.track.as_field_group }}{% endif %}
{% if filter_form.tags %}
<div class="d-flex flex-column form-group">
{% bootstrap_field filter_form.tags layout='inline' %}
<div id="requireAll" class="d-none">{% bootstrap_field filter_form.require_all_tags layout='inline' %}</div>
{{ filter_form.tags.as_field_group }}
<div id="requireAll" class="ml-1 d-none">{{ filter_form.require_all_tags.as_field_group }}</div>
</div>
{% endif %}
{% if filter_form.content_locale %}{% bootstrap_field filter_form.content_locale %}{% endif %}
{% if filter_form.content_locale %}{{ filter_form.content_locale.as_field_group }}{% endif %}
{# These fields are hidden, but included to keep question search intact #}
{% if request.GET.question %} <input type="hidden" name="question" value="{{ request.GET.question }}"> {% endif %}
{% if request.GET.answer__options %} <input type="hidden" name="answer__options" value="{{ request.GET.answer__options }}"> {% endif %}
{% if request.GET.answer %} <input type="hidden" name="answer" value="{{ request.GET.answer }}"> {% endif %}
{% if request.GET.unanswered %} <input type="hidden" name="unanswered" value="{{ request.GET.unanswered }}"> {% endif %}
<button class="btn btn-success" type="submit">{% translate "Search" %}</button>
</form>
{% if filter_form.is_valid and filter_form.cleaned_data.question %}
@ -51,7 +77,7 @@
{% blocktranslate trimmed with question=filter_form.cleaned_data.question.question %}
List filtered by answers to question "{{ question }}".
{% endblocktranslate %}
<a href="?{% url_replace request 'question' '' 'answer' '' 'answer__options' '' %}" class="text-muted">
<a href="{% querystring question="" answer="" answer__options="" %}" class="text-muted">
<span class="fa fa-times"></span>
{% translate "Remove filter" %}
</a>
@ -65,13 +91,13 @@
<tr>
<th>
{% translate "Rating" %}
<a href="?{% url_replace request 'sort' 'score__value' %}"><i class="fa fa-caret-down" title="{% translate "Sort by rating (0-10)" %}"></i></a>
<a href="?{% url_replace request 'sort' '-score__value' %}"><i class="fa fa-caret-up" title="{% translate "Sort by rating (10-0)" %}"></i></a>
<a href="{% querystring sort="score__value" %}"><i class="fa fa-caret-down" title="{% translate "Sort by rating (0-10)" %}"></i></a>
<a href="{% querystring sort="-score__value" %}"><i class="fa fa-caret-up" title="{% translate "Sort by rating (10-0)" %}"></i></a>
</th>
<th>
{% translate "Title" %}
<a href="?{% url_replace request 'sort' 'title' %}"><i class="fa fa-caret-down" title="{% translate "Sort by title (a-z)" %}"></i></a>
<a href="?{% url_replace request 'sort' '-title' %}"><i class="fa fa-caret-up" title="{% translate "Sort by title (z-a)" %}"></i></a>
<a href="?{% querystring sort="title" %}"><i class="fa fa-caret-down" title="{% translate "Sort by title (a-z)" %}"></i></a>
<a href="?{% querystring sort="-title" %}"><i class="fa fa-caret-up" title="{% translate "Sort by title (z-a)" %}"></i></a>
</th>
{% if show_submission_types %}
<th>
@ -80,13 +106,13 @@
{% endif %}
<th>
{% translate "State" %}
<a href="?{% url_replace request 'sort' 'state' %}"><i class="fa fa-caret-down" title="{% translate "Sort by state (a-z)" %}"></i></a>
<a href="?{% url_replace request 'sort' '-state' %}"><i class="fa fa-caret-up" title="{% translate "Sort by state (z-a)" %}"></i></a>
<a href="?{% querystring sort="state" %}"><i class="fa fa-caret-down" title="{% translate "Sort by state (a-z)" %}"></i></a>
<a href="?{% querystring sort="-state" %}"><i class="fa fa-caret-up" title="{% translate "Sort by state (z-a)" %}"></i></a>
</th>
<th>
{% translate "Assignee" %}
<a href="?{% url_replace request 'sort' 'assignee' %}"><i class="fa fa-caret-down" title="{% translate "Sort by assignee (a-z)" %}"></i></a>
<a href="?{% url_replace request 'sort' '-assignee' %}"><i class="fa fa-caret-up" title="{% translate "Sort by assignee (z-a)" %}"></i></a>
<a href="?{% querystring sort="assignee" %}"><i class="fa fa-caret-down" title="{% translate "Sort by assignee (a-z)" %}"></i></a>
<a href="?{% querystring sort="-assignee" %}"><i class="fa fa-caret-up" title="{% translate "Sort by assignee (z-a)" %}"></i></a>
</th>
{% if can_change_submission %}
<th></th>

View File

@ -1,29 +1,11 @@
{% extends "orga/base.html" %}
{% load bootstrap4 %}
{% load compress %}
{% load i18n %}
{% load static %}
{% block content %}
<h2>{% translate "pretalx-musicrate settings" %}</h2>
<form method="post">
{% csrf_token %}
{% bootstrap_form_errors form %}
{% bootstrap_field form.submission_types layout='event' %}
{% bootstrap_field form.genre_question layout='event' %}
{% bootstrap_field form.origin_question layout='event' %}
{% bootstrap_field form.link_questions layout='event' %}
{% bootstrap_field form.advance_threshold layout='event' %}
<div class="submit-group panel">
<span></span>
<span>
<button type="submit" class="btn btn-success btn-lg">
<i class="fa fa-check"></i>
{% translate "Save" %}
</button>
</span>
</div>
</form>
{% include "orga/includes/base_form.html" %}
<hr>
<a class="btn btn-success btn-lg btn-block" href="{% url "plugins:pretalx_musicrate:export" event=request.event.slug %}">
<i class="fa fa-download"></i>

View File

@ -1,4 +1,5 @@
from django.urls import include, path
from django.urls import include, path, re_path
from pretalx.event.models.event import SLUG_REGEX
from .views import (
AssigneeView,
@ -13,8 +14,8 @@ from .views import (
)
urlpatterns = [
path(
"orga/event/<slug:event>/",
re_path(
rf"^orga/event/(?P<event>{SLUG_REGEX})/",
include(
[
path(
@ -39,8 +40,8 @@ urlpatterns = [
]
),
),
path(
"<slug:event>/p/pretalx_musicrate/",
re_path(
rf"^(?P<event>{SLUG_REGEX})/p/pretalx_musicrate/",
include(
[
path("", QRCodeView.as_view(), name="qrcode"),

View File

@ -14,7 +14,7 @@ from django.utils.translation import gettext_lazy as _, ngettext
from django.views.generic import FormView, TemplateView, View
from django.views.generic.detail import SingleObjectMixin
from django_context_decorator import context
from pretalx.common.mixins.views import EventPermissionRequired
from pretalx.common.views.mixins import EventPermissionRequired
from pretalx.orga.views.submission import BaseSubmissionList, SubmissionList
from pretalx.submission.models import Submission