From 38fad52a8d81e7603a6bf242e4d8117edb560509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20H=C3=A4ttasch?= <benjamin.haettasch@fachschaft.informatik.tu-darmstadt.de> Date: Tue, 25 Feb 2025 22:42:44 +0100 Subject: [PATCH] Introduce AKTypes Introduce model (including migration and admin interface) Integrate into new event wizard Display as property in details representation (e.g., used in scheduler) Allow to choose types in AK add/edit forms Show type info on AK detail page and in overview table Adjust tests (including new tests for requirement and type visibility in submission form) Update translations --- AKModel/admin.py | 15 +- AKModel/fixtures/model.json | 8 + AKModel/forms.py | 11 +- AKModel/locale/de_DE/LC_MESSAGES/django.po | 341 ++++++++++-------- AKModel/migrations/0061_types.py | 33 ++ AKModel/models.py | 23 ++ .../admin/AKModel/ak_csv_export.html | 4 +- AKSubmission/forms.py | 8 +- .../locale/de_DE/LC_MESSAGES/django.po | 130 +++---- .../templates/AKSubmission/ak_detail.html | 10 + .../templates/AKSubmission/ak_table.html | 10 + AKSubmission/tests.py | 35 ++ AKSubmission/views.py | 4 +- 13 files changed, 408 insertions(+), 224 deletions(-) create mode 100644 AKModel/migrations/0061_types.py diff --git a/AKModel/admin.py b/AKModel/admin.py index d2ba18f3..a9e7e6b2 100644 --- a/AKModel/admin.py +++ b/AKModel/admin.py @@ -15,7 +15,7 @@ from simple_history.admin import SimpleHistoryAdmin from AKModel.availability.models import Availability from AKModel.forms import RoomFormWithAvailabilities from AKModel.models import Event, AKOwner, AKCategory, AKTrack, AKRequirement, AK, AKSlot, Room, AKOrgaMessage, \ - ConstraintViolation, DefaultSlot + ConstraintViolation, DefaultSlot, AKType from AKModel.urls import get_admin_urls_event_wizard, get_admin_urls_event from AKModel.views.ak import AKResetInterestView, AKResetInterestCounterView from AKModel.views.manage import CVMarkResolvedView, CVSetLevelViolationView, CVSetLevelWarningView @@ -215,6 +215,18 @@ class AKRequirementAdmin(PrepopulateWithNextActiveEventMixin, admin.ModelAdmin): ordering = ['name'] +@admin.register(AKType) +class AKTypeAdmin(PrepopulateWithNextActiveEventMixin, admin.ModelAdmin): + """ + Admin interface for AKRequirements + """ + model = AKType + list_display = ['name', 'event'] + list_filter = ['event'] + list_editable = [] + ordering = ['name'] + + class WishFilter(SimpleListFilter): """ Re-usable filter for wishes @@ -257,6 +269,7 @@ class AKAdminForm(forms.ModelForm): self.fields["requirements"].queryset = AKRequirement.objects.filter(event=self.instance.event) self.fields["conflicts"].queryset = AK.objects.filter(event=self.instance.event) self.fields["prerequisites"].queryset = AK.objects.filter(event=self.instance.event) + self.fields["types"].queryset = AKType.objects.filter(event=self.instance.event) @admin.register(AK) diff --git a/AKModel/fixtures/model.json b/AKModel/fixtures/model.json index d848041d..86166761 100644 --- a/AKModel/fixtures/model.json +++ b/AKModel/fixtures/model.json @@ -193,6 +193,14 @@ "event": 2 } }, +{ + "model": "AKModel.aktype", + "pk": 1, + "fields": { + "name": "Input", + "event": 2 + } +}, { "model": "AKModel.historicalak", "pk": 1, diff --git a/AKModel/forms.py b/AKModel/forms.py index 4d1fe7ef..be4929c4 100644 --- a/AKModel/forms.py +++ b/AKModel/forms.py @@ -10,7 +10,7 @@ from django.forms.utils import ErrorList from django.utils.translation import gettext_lazy as _ from AKModel.availability.forms import AvailabilitiesFormMixin -from AKModel.models import Event, AKCategory, AKRequirement, Room +from AKModel.models import Event, AKCategory, AKRequirement, Room, AKType class DateTimeInput(forms.DateInput): @@ -101,6 +101,13 @@ class NewEventWizardImportForm(forms.Form): required=False, ) + import_types = forms.ModelMultipleChoiceField( + queryset=AKType.objects.all(), + widget=forms.CheckboxSelectMultiple, + label=_("Copy types"), + required=False, + ) + # pylint: disable=too-many-arguments def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, @@ -111,6 +118,8 @@ class NewEventWizardImportForm(forms.Form): event=self.initial["import_event"]) self.fields["import_requirements"].queryset = self.fields["import_requirements"].queryset.filter( event=self.initial["import_event"]) + self.fields["import_types"].queryset = self.fields["import_types"].queryset.filter( + event=self.initial["import_event"]) # pylint: disable=import-outside-toplevel # Local imports used to prevent cyclic imports and to only import when AKDashboard is available diff --git a/AKModel/locale/de_DE/LC_MESSAGES/django.po b/AKModel/locale/de_DE/LC_MESSAGES/django.po index 261c5b2c..9285fb18 100644 --- a/AKModel/locale/de_DE/LC_MESSAGES/django.po +++ b/AKModel/locale/de_DE/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-25 01:29+0200\n" +"POT-Creation-Date: 2025-02-25 22:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -33,54 +33,54 @@ msgstr "Plan veröffentlichen" msgid "Unpublish plan" msgstr "Plan verbergen" -#: AKModel/admin.py:168 AKModel/models.py:360 AKModel/models.py:682 +#: AKModel/admin.py:168 AKModel/models.py:381 AKModel/models.py:707 #: AKModel/templates/admin/AKModel/aks_by_user.html:12 #: AKModel/templates/admin/AKModel/status/event_aks.html:10 -#: AKModel/views/manage.py:73 AKModel/views/status.py:98 +#: AKModel/views/manage.py:73 AKModel/views/status.py:102 msgid "AKs" msgstr "AKs" -#: AKModel/admin.py:222 +#: AKModel/admin.py:234 msgid "Wish" msgstr "AK-Wunsch" -#: AKModel/admin.py:228 +#: AKModel/admin.py:240 msgid "Is wish" msgstr "Ist ein Wunsch" -#: AKModel/admin.py:229 +#: AKModel/admin.py:241 msgid "Is not a wish" msgstr "Ist kein Wunsch" -#: AKModel/admin.py:288 +#: AKModel/admin.py:301 msgid "Export to wiki syntax" msgstr "In Wiki-Syntax exportieren" -#: AKModel/admin.py:305 +#: AKModel/admin.py:318 msgid "Cannot export AKs from more than one event at the same time." msgstr "Kann nicht AKs von mehreren Events zur selben Zeit exportieren." -#: AKModel/admin.py:320 AKModel/views/ak.py:99 +#: AKModel/admin.py:333 AKModel/views/ak.py:99 msgid "Reset interest in AKs" msgstr "Interesse an AKs zurücksetzen" -#: AKModel/admin.py:330 AKModel/views/ak.py:114 +#: AKModel/admin.py:343 AKModel/views/ak.py:114 msgid "Reset AKs' interest counters" msgstr "Interessenszähler der AKs zurücksetzen" -#: AKModel/admin.py:429 AKModel/admin.py:443 +#: AKModel/admin.py:442 AKModel/admin.py:456 msgid "AK Details" msgstr "AK-Details" -#: AKModel/admin.py:505 AKModel/views/manage.py:99 +#: AKModel/admin.py:518 AKModel/views/manage.py:99 msgid "Mark Constraint Violations as manually resolved" msgstr "Markiere Constraintverletzungen als manuell behoben" -#: AKModel/admin.py:514 AKModel/views/manage.py:112 +#: AKModel/admin.py:527 AKModel/views/manage.py:112 msgid "Set Constraint Violations to level \"violation\"" msgstr "Constraintverletzungen auf Level \"Violation\" setzen" -#: AKModel/admin.py:523 AKModel/views/manage.py:125 +#: AKModel/admin.py:536 AKModel/views/manage.py:125 msgid "Set Constraint Violations to level \"warning\"" msgstr "Constraintverletzungen auf Level \"Warning\" setzen" @@ -111,15 +111,17 @@ msgstr "Bitte Verfügbarkeiten eintragen!" #: AKModel/availability/models.py:43 AKModel/models.py:60 AKModel/models.py:174 #: AKModel/models.py:251 AKModel/models.py:270 AKModel/models.py:296 -#: AKModel/models.py:350 AKModel/models.py:492 AKModel/models.py:531 -#: AKModel/models.py:621 AKModel/models.py:678 AKModel/models.py:869 +#: AKModel/models.py:315 AKModel/models.py:371 AKModel/models.py:517 +#: AKModel/models.py:556 AKModel/models.py:646 AKModel/models.py:703 +#: AKModel/models.py:894 msgid "Event" msgstr "Event" #: AKModel/availability/models.py:44 AKModel/models.py:175 #: AKModel/models.py:252 AKModel/models.py:271 AKModel/models.py:297 -#: AKModel/models.py:351 AKModel/models.py:493 AKModel/models.py:532 -#: AKModel/models.py:622 AKModel/models.py:679 AKModel/models.py:870 +#: AKModel/models.py:316 AKModel/models.py:372 AKModel/models.py:518 +#: AKModel/models.py:557 AKModel/models.py:647 AKModel/models.py:704 +#: AKModel/models.py:895 msgid "Associated event" msgstr "Zugehöriges Event" @@ -131,8 +133,8 @@ msgstr "Person" msgid "Person whose availability this is" msgstr "Person deren Verfügbarkeit hier abgebildet wird" -#: AKModel/availability/models.py:61 AKModel/models.py:496 -#: AKModel/models.py:521 AKModel/models.py:688 +#: AKModel/availability/models.py:61 AKModel/models.py:521 +#: AKModel/models.py:546 AKModel/models.py:713 msgid "Room" msgstr "Raum" @@ -140,8 +142,8 @@ msgstr "Raum" msgid "Room whose availability this is" msgstr "Raum dessen Verfügbarkeit hier abgebildet wird" -#: AKModel/availability/models.py:70 AKModel/models.py:359 -#: AKModel/models.py:520 AKModel/models.py:616 +#: AKModel/availability/models.py:70 AKModel/models.py:380 +#: AKModel/models.py:545 AKModel/models.py:641 msgid "AK" msgstr "AK" @@ -150,7 +152,7 @@ msgid "AK whose availability this is" msgstr "Verfügbarkeiten" #: AKModel/availability/models.py:79 AKModel/models.py:255 -#: AKModel/models.py:694 +#: AKModel/models.py:719 msgid "AK Category" msgstr "AK-Kategorie" @@ -179,39 +181,43 @@ msgstr "AK-Kategorien kopieren" msgid "Copy ak requirements" msgstr "AK-Anforderungen kopieren" -#: AKModel/forms.py:124 +#: AKModel/forms.py:107 +msgid "Copy types" +msgstr "Typen kopieren" + +#: AKModel/forms.py:133 msgid "Copy dashboard buttons" msgstr "Dashboard-Buttons kopieren" -#: AKModel/forms.py:165 +#: AKModel/forms.py:174 msgid "# next AKs" msgstr "# nächste AKs" -#: AKModel/forms.py:166 +#: AKModel/forms.py:175 msgid "How many next AKs should be shown on a slide?" msgstr "Wie viele nächste AKs sollen auf einer Folie angezeigt werden?" -#: AKModel/forms.py:169 +#: AKModel/forms.py:178 msgid "Presentation only?" msgstr "Nur Vorstellung?" -#: AKModel/forms.py:171 AKModel/forms.py:178 +#: AKModel/forms.py:180 AKModel/forms.py:187 msgid "Yes" msgstr "Ja" -#: AKModel/forms.py:171 AKModel/forms.py:178 +#: AKModel/forms.py:180 AKModel/forms.py:187 msgid "No" msgstr "Nein" -#: AKModel/forms.py:173 +#: AKModel/forms.py:182 msgid "Restrict AKs to those that asked for chance to be presented?" msgstr "AKs auf solche, die um eine Vorstellung gebeten haben, einschränken?" -#: AKModel/forms.py:176 +#: AKModel/forms.py:185 msgid "Space for notes in wishes?" msgstr "Platz für Notizen bei den Wünschen?" -#: AKModel/forms.py:180 +#: AKModel/forms.py:189 msgid "" "Create symbols indicating space to note down owners and timeslots for " "wishes, e.g., to be filled out on a touch screen while presenting?" @@ -220,11 +226,11 @@ msgstr "" "fürWünsche markieren, z.B. um während der Präsentation auf einem Touchscreen " "ausgefüllt zu werden?" -#: AKModel/forms.py:189 AKModel/models.py:863 +#: AKModel/forms.py:198 AKModel/models.py:888 msgid "Default Slots" msgstr "Standardslots" -#: AKModel/forms.py:191 +#: AKModel/forms.py:200 msgid "" "Click and drag to add default slots, double-click to delete. Or use the " "start and end inputs to add entries to the calendar view." @@ -233,11 +239,11 @@ msgstr "" "Einträge zu löschen. Oder Start- und End-Eingabe verwenden, um der " "Kalenderansicht neue Einträge hinzuzufügen." -#: AKModel/forms.py:207 +#: AKModel/forms.py:216 msgid "New rooms" msgstr "Neue Räume" -#: AKModel/forms.py:208 +#: AKModel/forms.py:217 msgid "" "Enter room details in CSV format. Required colum is \"name\", optional " "colums are \"location\", \"capacity\", and \"url\" for online/hybrid rooms. " @@ -247,15 +253,15 @@ msgstr "" "Spalten sind \"location\", \"capacity\", und \"url\" for Online-/" "HybridräumeTrennzeichen: Semikolon" -#: AKModel/forms.py:214 +#: AKModel/forms.py:223 msgid "Default availabilities?" msgstr "Standardverfügbarkeiten?" -#: AKModel/forms.py:215 +#: AKModel/forms.py:224 msgid "Create default availabilities for all rooms?" msgstr "Standardverfügbarkeiten für alle Räume anlegen?" -#: AKModel/forms.py:231 +#: AKModel/forms.py:240 msgid "CSV must contain a name column" msgstr "CSV muss eine name-Spalte enthalten" @@ -285,7 +291,8 @@ msgid "Finish" msgstr "Abschluss" #: AKModel/models.py:20 AKModel/models.py:243 AKModel/models.py:267 -#: AKModel/models.py:294 AKModel/models.py:312 AKModel/models.py:484 +#: AKModel/models.py:294 AKModel/models.py:313 AKModel/models.py:331 +#: AKModel/models.py:507 msgid "Name" msgstr "Name" @@ -451,7 +458,7 @@ msgstr "Instutution" msgid "Uni etc." msgstr "Universität o.ä." -#: AKModel/models.py:172 AKModel/models.py:321 +#: AKModel/models.py:172 AKModel/models.py:340 msgid "Web Link" msgstr "Internet Link" @@ -459,7 +466,7 @@ msgstr "Internet Link" msgid "Link to Homepage" msgstr "Link zu Homepage oder Webseite" -#: AKModel/models.py:178 AKModel/models.py:687 +#: AKModel/models.py:178 AKModel/models.py:712 msgid "AK Owner" msgstr "AK-Leitung" @@ -479,7 +486,7 @@ msgstr "Farbe" msgid "Color for displaying" msgstr "Farbe für die Anzeige" -#: AKModel/models.py:245 AKModel/models.py:315 +#: AKModel/models.py:245 AKModel/models.py:334 msgid "Description" msgstr "Beschreibung" @@ -519,7 +526,7 @@ msgstr "AK-Tracks" msgid "Name of the Requirement" msgstr "Name der Anforderung" -#: AKModel/models.py:300 AKModel/models.py:691 +#: AKModel/models.py:300 AKModel/models.py:716 msgid "AK Requirement" msgstr "AK-Anforderung" @@ -527,104 +534,124 @@ msgstr "AK-Anforderung" msgid "AK Requirements" msgstr "AK-Anforderungen" -#: AKModel/models.py:312 +#: AKModel/models.py:313 +msgid "Name describing the type" +msgstr "Name, der den Typ beschreibt" + +#: AKModel/models.py:319 +msgid "AK Type" +msgstr "Typ" + +#: AKModel/models.py:320 +msgid "AK Types" +msgstr "AK-Typen" + +#: AKModel/models.py:331 msgid "Name of the AK" msgstr "Name des AKs" -#: AKModel/models.py:313 +#: AKModel/models.py:332 msgid "Short Name" msgstr "Kurzer Name" -#: AKModel/models.py:314 +#: AKModel/models.py:333 msgid "Name displayed in the schedule" msgstr "Name zur Anzeige im AK-Plan" -#: AKModel/models.py:315 +#: AKModel/models.py:334 msgid "Description of the AK" msgstr "Beschreibung des AKs" -#: AKModel/models.py:317 +#: AKModel/models.py:336 msgid "Owners" msgstr "Leitungen" -#: AKModel/models.py:318 +#: AKModel/models.py:337 msgid "Those organizing the AK" msgstr "Menschen, die den AK organisieren und halten" -#: AKModel/models.py:321 +#: AKModel/models.py:340 msgid "Link to wiki page" msgstr "Link zur Wiki Seite" -#: AKModel/models.py:322 +#: AKModel/models.py:341 msgid "Protocol Link" msgstr "Protokolllink" -#: AKModel/models.py:322 +#: AKModel/models.py:341 msgid "Link to protocol" msgstr "Link zum Protokoll" -#: AKModel/models.py:324 +#: AKModel/models.py:343 msgid "Category" msgstr "Kategorie" -#: AKModel/models.py:325 +#: AKModel/models.py:344 msgid "Category of the AK" msgstr "Kategorie des AKs" -#: AKModel/models.py:326 +#: AKModel/models.py:345 +msgid "Types" +msgstr "Typen" + +#: AKModel/models.py:346 +msgid "This AK is" +msgstr "Dieser AK ist" + +#: AKModel/models.py:347 msgid "Track" msgstr "Track" -#: AKModel/models.py:327 +#: AKModel/models.py:348 msgid "Track the AK belongs to" msgstr "Track zu dem der AK gehört" -#: AKModel/models.py:329 +#: AKModel/models.py:350 msgid "Resolution Intention" msgstr "Resolutionsabsicht" -#: AKModel/models.py:330 +#: AKModel/models.py:351 msgid "Intends to submit a resolution" msgstr "Beabsichtigt eine Resolution einzureichen" -#: AKModel/models.py:331 +#: AKModel/models.py:352 msgid "Present this AK" msgstr "AK präsentieren" -#: AKModel/models.py:332 +#: AKModel/models.py:353 msgid "Present results of this AK" msgstr "Die Ergebnisse dieses AKs vorstellen" -#: AKModel/models.py:334 AKModel/views/status.py:163 +#: AKModel/models.py:355 AKModel/views/status.py:167 msgid "Requirements" msgstr "Anforderungen" -#: AKModel/models.py:335 +#: AKModel/models.py:356 msgid "AK's Requirements" msgstr "Anforderungen des AKs" -#: AKModel/models.py:337 +#: AKModel/models.py:358 msgid "Conflicting AKs" msgstr "AK-Konflikte" -#: AKModel/models.py:338 +#: AKModel/models.py:359 msgid "AKs that conflict and thus must not take place at the same time" msgstr "" "AKs, die Konflikte haben und deshalb nicht gleichzeitig stattfinden dürfen" -#: AKModel/models.py:339 +#: AKModel/models.py:360 msgid "Prerequisite AKs" msgstr "Vorausgesetzte AKs" -#: AKModel/models.py:340 +#: AKModel/models.py:361 msgid "AKs that should precede this AK in the schedule" msgstr "AKs die im AK-Plan vor diesem AK stattfinden müssen" -#: AKModel/models.py:342 +#: AKModel/models.py:363 msgid "Organizational Notes" msgstr "Notizen zur Organisation" -#: AKModel/models.py:343 +#: AKModel/models.py:364 msgid "" "Notes to organizers. These are public. For private notes, please use the " "button for private messages on the detail page of this AK (after creation/" @@ -634,289 +661,291 @@ msgstr "" "Anmerkungen bitte den Button für Direktnachrichten verwenden (nach dem " "Anlegen/Bearbeiten)." -#: AKModel/models.py:346 +#: AKModel/models.py:367 msgid "Interest" msgstr "Interesse" -#: AKModel/models.py:346 +#: AKModel/models.py:367 msgid "Expected number of people" msgstr "Erwartete Personenzahl" -#: AKModel/models.py:347 +#: AKModel/models.py:368 msgid "Interest Counter" msgstr "Interessenszähler" -#: AKModel/models.py:348 +#: AKModel/models.py:369 msgid "People who have indicated interest online" msgstr "Anzahl Personen, die online Interesse bekundet haben" -#: AKModel/models.py:353 +#: AKModel/models.py:374 msgid "Export?" msgstr "Export?" -#: AKModel/models.py:354 +#: AKModel/models.py:375 msgid "Include AK in wiki export?" msgstr "AK bei Wiki-Export berücksichtigen?" -#: AKModel/models.py:484 +#: AKModel/models.py:507 msgid "Name or number of the room" msgstr "Name oder Nummer des Raums" -#: AKModel/models.py:485 +#: AKModel/models.py:508 msgid "Location" msgstr "Ort" -#: AKModel/models.py:486 +#: AKModel/models.py:509 msgid "Name or number of the location" msgstr "Name oder Nummer des Ortes" -#: AKModel/models.py:487 +#: AKModel/models.py:510 msgid "Capacity" msgstr "Kapazität" -#: AKModel/models.py:488 +#: AKModel/models.py:511 msgid "Maximum number of people (-1 for unlimited)." msgstr "Maximale Personenzahl (-1 wenn unbeschränkt)." -#: AKModel/models.py:489 +#: AKModel/models.py:512 msgid "Properties" msgstr "Eigenschaften" -#: AKModel/models.py:490 +#: AKModel/models.py:513 msgid "AK requirements fulfilled by the room" msgstr "AK-Anforderungen, die dieser Raum erfüllt" -#: AKModel/models.py:497 AKModel/views/status.py:60 +#: AKModel/models.py:522 AKModel/views/status.py:59 msgid "Rooms" msgstr "Räume" -#: AKModel/models.py:520 +#: AKModel/models.py:545 msgid "AK being mapped" msgstr "AK, der zugeordnet wird" -#: AKModel/models.py:522 +#: AKModel/models.py:547 msgid "Room the AK will take place in" msgstr "Raum in dem der AK stattfindet" -#: AKModel/models.py:523 AKModel/models.py:866 +#: AKModel/models.py:548 AKModel/models.py:891 msgid "Slot Begin" msgstr "Beginn des Slots" -#: AKModel/models.py:523 AKModel/models.py:866 +#: AKModel/models.py:548 AKModel/models.py:891 msgid "Time and date the slot begins" msgstr "Zeit und Datum zu der der AK beginnt" -#: AKModel/models.py:525 +#: AKModel/models.py:550 msgid "Duration" msgstr "Dauer" -#: AKModel/models.py:526 +#: AKModel/models.py:551 msgid "Length in hours" msgstr "Länge in Stunden" -#: AKModel/models.py:528 +#: AKModel/models.py:553 msgid "Scheduling fixed" msgstr "Planung fix" -#: AKModel/models.py:529 +#: AKModel/models.py:554 msgid "Length and time of this AK should not be changed" msgstr "Dauer und Zeit dieses AKs sollten nicht verändert werden" -#: AKModel/models.py:534 +#: AKModel/models.py:559 msgid "Last update" msgstr "Letzte Aktualisierung" -#: AKModel/models.py:537 +#: AKModel/models.py:562 msgid "AK Slot" msgstr "AK-Slot" -#: AKModel/models.py:538 AKModel/models.py:684 +#: AKModel/models.py:563 AKModel/models.py:709 msgid "AK Slots" msgstr "AK-Slot" -#: AKModel/models.py:560 AKModel/models.py:569 +#: AKModel/models.py:585 AKModel/models.py:594 msgid "Not scheduled yet" msgstr "Noch nicht geplant" -#: AKModel/models.py:617 +#: AKModel/models.py:642 msgid "AK this message belongs to" msgstr "AK zu dem die Nachricht gehört" -#: AKModel/models.py:618 +#: AKModel/models.py:643 msgid "Message text" msgstr "Nachrichtentext" -#: AKModel/models.py:619 +#: AKModel/models.py:644 msgid "Message to the organizers. This is not publicly visible." msgstr "" "Nachricht an die Organisator*innen. Diese ist nicht öffentlich sichtbar." -#: AKModel/models.py:623 +#: AKModel/models.py:648 msgid "Resolved" msgstr "Erledigt" -#: AKModel/models.py:624 +#: AKModel/models.py:649 msgid "This message has been resolved (no further action needed)" -msgstr "Diese Nachricht wurde vollständig bearbeitet (keine weiteren Aktionen notwendig)" +msgstr "" +"Diese Nachricht wurde vollständig bearbeitet (keine weiteren Aktionen " +"notwendig)" -#: AKModel/models.py:627 +#: AKModel/models.py:652 msgid "AK Orga Message" msgstr "AK-Organachricht" -#: AKModel/models.py:628 +#: AKModel/models.py:653 msgid "AK Orga Messages" msgstr "AK-Organachrichten" -#: AKModel/models.py:645 +#: AKModel/models.py:670 msgid "Constraint Violation" msgstr "Constraintverletzung" -#: AKModel/models.py:646 +#: AKModel/models.py:671 msgid "Constraint Violations" msgstr "Constraintverletzungen" -#: AKModel/models.py:653 +#: AKModel/models.py:678 msgid "Owner has two parallel slots" msgstr "Leitung hat zwei Slots parallel" -#: AKModel/models.py:654 +#: AKModel/models.py:679 msgid "AK Slot was scheduled outside the AK's availabilities" msgstr "AK Slot wurde außerhalb der Verfügbarkeit des AKs platziert" -#: AKModel/models.py:655 +#: AKModel/models.py:680 msgid "Room has two AK slots scheduled at the same time" msgstr "Raum hat zwei AK Slots gleichzeitig" -#: AKModel/models.py:656 +#: AKModel/models.py:681 msgid "Room does not satisfy the requirement of the scheduled AK" msgstr "Room erfüllt die Anforderungen des platzierten AKs nicht" -#: AKModel/models.py:657 +#: AKModel/models.py:682 msgid "AK Slot is scheduled at the same time as an AK listed as a conflict" msgstr "" "AK Slot wurde wurde zur gleichen Zeit wie ein Konflikt des AKs platziert" -#: AKModel/models.py:658 +#: AKModel/models.py:683 msgid "AK Slot is scheduled before an AK listed as a prerequisite" msgstr "AK Slot wurde vor einem als Voraussetzung gelisteten AK platziert" -#: AKModel/models.py:660 +#: AKModel/models.py:685 msgid "" "AK Slot for AK with intention to submit a resolution is scheduled after " "resolution deadline" msgstr "" "AK Slot eines AKs mit Resoabsicht wurde nach der Resodeadline platziert" -#: AKModel/models.py:661 +#: AKModel/models.py:686 msgid "AK Slot in a category is outside that categories availabilities" msgstr "AK Slot wurde außerhalb der Verfügbarkeiten seiner Kategorie" -#: AKModel/models.py:662 +#: AKModel/models.py:687 msgid "Two AK Slots for the same AK scheduled at the same time" msgstr "Zwei AK Slots eines AKs wurden zur selben Zeit platziert" -#: AKModel/models.py:663 +#: AKModel/models.py:688 msgid "Room does not have enough space for interest in scheduled AK Slot" msgstr "Room hat nicht genug Platz für das Interesse am geplanten AK-Slot" -#: AKModel/models.py:664 +#: AKModel/models.py:689 msgid "AK Slot is scheduled outside the event's availabilities" msgstr "AK Slot wurde außerhalb der Verfügbarkeit des Events platziert" -#: AKModel/models.py:670 +#: AKModel/models.py:695 msgid "Warning" msgstr "Warnung" -#: AKModel/models.py:671 +#: AKModel/models.py:696 msgid "Violation" msgstr "Verletzung" -#: AKModel/models.py:673 +#: AKModel/models.py:698 msgid "Type" msgstr "Art" -#: AKModel/models.py:674 +#: AKModel/models.py:699 msgid "Type of violation, i.e. what kind of constraint was violated" msgstr "Art der Verletzung, gibt an welche Art Constraint verletzt wurde" -#: AKModel/models.py:675 +#: AKModel/models.py:700 msgid "Level" msgstr "Level" -#: AKModel/models.py:676 +#: AKModel/models.py:701 msgid "Severity level of the violation" msgstr "Schweregrad der Verletzung" -#: AKModel/models.py:683 +#: AKModel/models.py:708 msgid "AK(s) belonging to this constraint" msgstr "AK(s), die zu diesem Constraint gehören" -#: AKModel/models.py:685 +#: AKModel/models.py:710 msgid "AK Slot(s) belonging to this constraint" msgstr "AK Slot(s), die zu diesem Constraint gehören" -#: AKModel/models.py:687 +#: AKModel/models.py:712 msgid "AK Owner belonging to this constraint" msgstr "AK Leitung(en), die zu diesem Constraint gehören" -#: AKModel/models.py:689 +#: AKModel/models.py:714 msgid "Room belonging to this constraint" msgstr "Raum, der zu diesem Constraint gehört" -#: AKModel/models.py:692 +#: AKModel/models.py:717 msgid "AK Requirement belonging to this constraint" msgstr "AK Anforderung, die zu diesem Constraint gehört" -#: AKModel/models.py:694 +#: AKModel/models.py:719 msgid "AK Category belonging to this constraint" msgstr "AK Kategorie, di zu diesem Constraint gehört" -#: AKModel/models.py:696 +#: AKModel/models.py:721 msgid "Comment" msgstr "Kommentar" -#: AKModel/models.py:696 +#: AKModel/models.py:721 msgid "Comment or further details for this violation" msgstr "Kommentar oder weitere Details zu dieser Vereletzung" -#: AKModel/models.py:699 +#: AKModel/models.py:724 msgid "Timestamp" msgstr "Timestamp" -#: AKModel/models.py:699 +#: AKModel/models.py:724 msgid "Time of creation" msgstr "Zeitpunkt der ERstellung" -#: AKModel/models.py:700 +#: AKModel/models.py:725 msgid "Manually Resolved" msgstr "Manuell behoben" -#: AKModel/models.py:701 +#: AKModel/models.py:726 msgid "Mark this violation manually as resolved" msgstr "Markiere diese Verletzung manuell als behoben" -#: AKModel/models.py:728 AKModel/templates/admin/AKModel/aks_by_user.html:22 +#: AKModel/models.py:753 AKModel/templates/admin/AKModel/aks_by_user.html:22 #: AKModel/templates/admin/AKModel/requirements_overview.html:27 msgid "Details" msgstr "Details" -#: AKModel/models.py:862 +#: AKModel/models.py:887 msgid "Default Slot" msgstr "Standardslot" -#: AKModel/models.py:867 +#: AKModel/models.py:892 msgid "Slot End" msgstr "Ende des Slots" -#: AKModel/models.py:867 +#: AKModel/models.py:892 msgid "Time and date the slot ends" msgstr "Zeit und Datum zu der der Slot endet" -#: AKModel/models.py:872 +#: AKModel/models.py:897 msgid "Primary categories" msgstr "Primäre Kategorien" -#: AKModel/models.py:873 +#: AKModel/models.py:898 msgid "Categories that should be assigned to this slot primarily" msgstr "Kategorieren, die diesem Slot primär zugewiesen werden sollen" @@ -1037,7 +1066,7 @@ msgid "No AKs with this requirement" msgstr "Kein AK mit dieser Anforderung" #: AKModel/templates/admin/AKModel/requirements_overview.html:45 -#: AKModel/views/status.py:179 +#: AKModel/views/status.py:183 msgid "Add Requirement" msgstr "Anforderung hinzufügen" @@ -1090,7 +1119,7 @@ msgstr "Bisher keine Räume" msgid "Active Events" msgstr "Aktive Events" -#: AKModel/templates/admin/ak_index.html:16 AKModel/views/status.py:109 +#: AKModel/templates/admin/ak_index.html:16 AKModel/views/status.py:113 msgid "Scheduling" msgstr "Scheduling" @@ -1173,7 +1202,7 @@ msgstr "'%(obj)s' kopiert" msgid "Could not copy '%(obj)s' (%(error)s)" msgstr "'%(obj)s' konnte nicht kopiert werden (%(error)s)" -#: AKModel/views/manage.py:35 AKModel/views/status.py:146 +#: AKModel/views/manage.py:35 AKModel/views/status.py:150 msgid "Export AK Slides" msgstr "AK-Folien exportieren" @@ -1241,7 +1270,7 @@ msgstr "Den Plan/die Pläne verbergen von:" msgid "Plan unpublished" msgstr "Plan verborgen" -#: AKModel/views/manage.py:166 AKModel/views/status.py:130 +#: AKModel/views/manage.py:166 AKModel/views/status.py:134 msgid "Edit Default Slots" msgstr "Standardslots bearbeiten" @@ -1262,7 +1291,7 @@ msgstr "" msgid "Created Room '%(room)s'" msgstr "Raum '%(room)s' angelegt" -#: AKModel/views/room.py:51 AKModel/views/status.py:82 +#: AKModel/views/room.py:51 AKModel/views/status.py:86 msgid "Import Rooms from CSV" msgstr "Räume aus CSV importieren" @@ -1280,47 +1309,47 @@ msgstr "{count} Raum/Räume importiert" msgid "No rooms imported" msgstr "Keine Räume importiert" -#: AKModel/views/status.py:17 +#: AKModel/views/status.py:16 msgid "Overview" msgstr "Überblick" -#: AKModel/views/status.py:33 +#: AKModel/views/status.py:32 msgid "Categories" msgstr "Kategorien" -#: AKModel/views/status.py:37 +#: AKModel/views/status.py:36 msgid "Add category" msgstr "Kategorie hinzufügen" -#: AKModel/views/status.py:64 +#: AKModel/views/status.py:63 msgid "Add Room" msgstr "Raum hinzufügen" -#: AKModel/views/status.py:116 +#: AKModel/views/status.py:120 msgid "AKs requiring special attention" msgstr "AKs, die besondere Aufmerksamkeit benötigen" -#: AKModel/views/status.py:122 +#: AKModel/views/status.py:126 msgid "Enter Interest" msgstr "Interesse erfassen" -#: AKModel/views/status.py:134 +#: AKModel/views/status.py:138 msgid "Manage ak tracks" msgstr "AK-Tracks verwalten" -#: AKModel/views/status.py:138 +#: AKModel/views/status.py:142 msgid "Export AKs as CSV" msgstr "AKs als CSV exportieren" -#: AKModel/views/status.py:142 +#: AKModel/views/status.py:146 msgid "Export AKs for Wiki" msgstr "AKs im Wiki-Format exportieren" -#: AKModel/views/status.py:175 +#: AKModel/views/status.py:179 msgid "Show AKs for requirements" msgstr "Zu Anforderungen gehörige AKs anzeigen" -#: AKModel/views/status.py:189 +#: AKModel/views/status.py:193 msgid "Event Status" msgstr "Eventstatus" diff --git a/AKModel/migrations/0061_types.py b/AKModel/migrations/0061_types.py new file mode 100644 index 00000000..815a1563 --- /dev/null +++ b/AKModel/migrations/0061_types.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.13 on 2025-02-25 20:58 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('AKModel', '0060_orga_message_resolved'), + ] + + operations = [ + migrations.CreateModel( + name='AKType', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(help_text='Name describing the type', max_length=128, verbose_name='Name')), + ('event', models.ForeignKey(help_text='Associated event', on_delete=django.db.models.deletion.CASCADE, to='AKModel.event', verbose_name='Event')), + ], + options={ + 'verbose_name': 'AK Type', + 'verbose_name_plural': 'AK Types', + 'ordering': ['name'], + 'unique_together': {('event', 'name')}, + }, + ), + migrations.AddField( + model_name='ak', + name='types', + field=models.ManyToManyField(blank=True, help_text='This AK is', to='AKModel.aktype', verbose_name='Types'), + ), + ] diff --git a/AKModel/models.py b/AKModel/models.py index 22586a57..0890e536 100644 --- a/AKModel/models.py +++ b/AKModel/models.py @@ -306,6 +306,25 @@ class AKRequirement(models.Model): return self.name +class AKType(models.Model): + """ An AKType allows to associate one or multiple types with an AK, e.g., to better describe the format of that AK + or to which group of people it is addressed. Types are specified per event and are an optional feature. + """ + name = models.CharField(max_length=128, verbose_name=_('Name'), help_text=_('Name describing the type')) + + event = models.ForeignKey(to=Event, on_delete=models.CASCADE, verbose_name=_('Event'), + help_text=_('Associated event')) + + class Meta: + verbose_name = _('AK Type') + verbose_name_plural = _('AK Types') + ordering = ['name'] + unique_together = ['event', 'name'] + + def __str__(self): + return self.name + + class AK(models.Model): """ An AK is a slot-based activity to be scheduled during an event. """ @@ -323,6 +342,8 @@ class AK(models.Model): category = models.ForeignKey(to=AKCategory, on_delete=models.PROTECT, verbose_name=_('Category'), help_text=_('Category of the AK')) + types = models.ManyToManyField(to=AKType, blank=True, verbose_name=_('Types'), + help_text=_("This AK is")) track = models.ForeignKey(to=AKTrack, blank=True, on_delete=models.SET_NULL, null=True, verbose_name=_('Track'), help_text=_('Track the AK belongs to')) @@ -385,6 +406,8 @@ class AK(models.Model): {_('Interest')}: {self.interest}""" if self.requirements.count() > 0: detail_string += f"\n{_('Requirements')}: {', '.join(str(r) for r in self.requirements.all())}" + if self.types.count() > 0: + detail_string += f"\n{_('Types')}: {', '.join(str(r) for r in self.types.all())}" if self.conflicts.count() > 0: detail_string += f"\n{_('Conflicts')}: {', '.join(str(c) for c in self.conflicts.all())}" if self.prerequisites.count() > 0: diff --git a/AKModel/templates/admin/AKModel/ak_csv_export.html b/AKModel/templates/admin/AKModel/ak_csv_export.html index b6f1e089..dfd0f04d 100644 --- a/AKModel/templates/admin/AKModel/ak_csv_export.html +++ b/AKModel/templates/admin/AKModel/ak_csv_export.html @@ -4,8 +4,8 @@ {% block content %} <pre> -title;duration;who;requirements;prerequisites;conflicts;availabilities;category;track;reso;notes; -{% for slot in slots %}{{ slot.ak.short_name }};{{ slot.duration }};{{ slot.ak.owners.all|join:", " }};{{ slot.ak.requirements.all|join:", " }};{{ slot.ak.prerequisites.all|join:", " }};{{ slot.ak.conflicts.all|join:", " }};{% for a in slot.ak.availabilities.all %}{{ a.start | timezone:event.timezone | date:"l H:i" }} - {{ a.end | timezone:event.timezone | date:"l H:i" }}, {% endfor %};{{ slot.ak.category }};{{ slot.ak.track }};{{ slot.ak.reso }};{{ slot.ak.notes }}; +title;duration;who;requirements;prerequisites;conflicts;availabilities;category;types;track;reso;notes; +{% for slot in slots %}{{ slot.ak.short_name }};{{ slot.duration }};{{ slot.ak.owners.all|join:", " }};{{ slot.ak.requirements.all|join:", " }};{{ slot.ak.prerequisites.all|join:", " }};{{ slot.ak.conflicts.all|join:", " }};{% for a in slot.ak.availabilities.all %}{{ a.start | timezone:event.timezone | date:"l H:i" }} - {{ a.end | timezone:event.timezone | date:"l H:i" }}, {% endfor %};{{ slot.ak.category }};{{ slot.ak.types.all|join:", " }};{{ slot.ak.track }};{{ slot.ak.reso }};{{ slot.ak.notes }}; {% endfor %} </pre> {% endblock %} diff --git a/AKSubmission/forms.py b/AKSubmission/forms.py index 644ff5aa..70913ae7 100644 --- a/AKSubmission/forms.py +++ b/AKSubmission/forms.py @@ -11,7 +11,7 @@ from django.utils.translation import gettext_lazy as _ from AKModel.availability.forms import AvailabilitiesFormMixin from AKModel.availability.models import Availability -from AKModel.models import AK, AKOwner, AKCategory, AKRequirement, AKSlot, AKOrgaMessage +from AKModel.models import AK, AKOwner, AKCategory, AKRequirement, AKSlot, AKOrgaMessage, AKType class AKForm(AvailabilitiesFormMixin, forms.ModelForm): @@ -37,6 +37,7 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): 'owners', 'description', 'category', + 'types', 'reso', 'present', 'requirements', @@ -48,6 +49,7 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): widgets = { 'requirements': forms.CheckboxSelectMultiple, + 'types': forms.CheckboxSelectMultiple, 'event': forms.HiddenInput, } @@ -61,6 +63,10 @@ class AKForm(AvailabilitiesFormMixin, forms.ModelForm): self.fields["prerequisites"].widget.attrs = {'class': 'chosen-select'} self.fields['category'].queryset = AKCategory.objects.filter(event=self.initial.get('event')) + self.fields['types'].queryset = AKType.objects.filter(event=self.initial.get('event')) + # Don't ask for types if there are no types configured for this event + if self.fields['types'].queryset.count() == 0: + self.fields.pop('types') self.fields['requirements'].queryset = AKRequirement.objects.filter(event=self.initial.get('event')) # Don't ask for requirements if there are no requirements configured for this event if self.fields['requirements'].queryset.count() == 0: diff --git a/AKSubmission/locale/de_DE/LC_MESSAGES/django.po b/AKSubmission/locale/de_DE/LC_MESSAGES/django.po index 420a3629..f3a20fd7 100644 --- a/AKSubmission/locale/de_DE/LC_MESSAGES/django.po +++ b/AKSubmission/locale/de_DE/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-02-02 23:53+0100\n" +"POT-Creation-Date: 2025-02-25 22:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -17,16 +17,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: AKSubmission/forms.py:95 +#: AKSubmission/forms.py:101 #, python-format msgid "\"%(duration)s\" is not a valid duration" msgstr "\"%(duration)s\" ist keine gültige Dauer" -#: AKSubmission/forms.py:155 +#: AKSubmission/forms.py:161 msgid "Duration(s)" msgstr "Dauer(n)" -#: AKSubmission/forms.py:157 +#: AKSubmission/forms.py:163 msgid "" "Enter at least one planned duration (in hours). If your AK should have " "multiple slots, use multiple lines" @@ -34,7 +34,7 @@ msgstr "" "Mindestens eine geplante Dauer (in Stunden) angeben. Wenn der AK mehrere " "Slots haben soll, mehrere Zeilen verwenden" -#: AKSubmission/templates/AKSubmission/ak_detail.html:23 +#: AKSubmission/templates/AKSubmission/ak_detail.html:22 #: AKSubmission/templates/AKSubmission/ak_edit.html:13 #: AKSubmission/templates/AKSubmission/ak_history.html:16 #: AKSubmission/templates/AKSubmission/ak_overview.html:22 @@ -52,61 +52,61 @@ msgstr "" msgid "AK Submission" msgstr "AK-Eintragung" -#: AKSubmission/templates/AKSubmission/ak_detail.html:127 +#: AKSubmission/templates/AKSubmission/ak_detail.html:126 #: AKSubmission/templates/AKSubmission/ak_interest_script.html:50 msgid "Interest indication currently not allowed. Sorry." msgstr "Interessenangabe aktuell nicht erlaubt. Sorry." -#: AKSubmission/templates/AKSubmission/ak_detail.html:129 +#: AKSubmission/templates/AKSubmission/ak_detail.html:128 #: AKSubmission/templates/AKSubmission/ak_interest_script.html:52 msgid "Could not save your interest. Sorry." msgstr "Interesse konnte nicht gespeichert werden. Sorry." -#: AKSubmission/templates/AKSubmission/ak_detail.html:150 +#: AKSubmission/templates/AKSubmission/ak_detail.html:149 msgid "Interest" msgstr "Interesse" -#: AKSubmission/templates/AKSubmission/ak_detail.html:152 -#: AKSubmission/templates/AKSubmission/ak_table.html:55 +#: AKSubmission/templates/AKSubmission/ak_detail.html:151 +#: AKSubmission/templates/AKSubmission/ak_table.html:65 msgid "Show Interest" msgstr "Interesse bekunden" -#: AKSubmission/templates/AKSubmission/ak_detail.html:158 -#: AKSubmission/templates/AKSubmission/ak_table.html:46 +#: AKSubmission/templates/AKSubmission/ak_detail.html:157 +#: AKSubmission/templates/AKSubmission/ak_table.html:56 msgid "Open external link" msgstr "Externen Link öffnen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:163 +#: AKSubmission/templates/AKSubmission/ak_detail.html:162 msgid "Open protocol link" msgstr "Protokolllink öffnen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:168 +#: AKSubmission/templates/AKSubmission/ak_detail.html:167 #: AKSubmission/templates/AKSubmission/ak_history.html:19 #: AKSubmission/templates/AKSubmission/ak_history.html:31 msgid "History" msgstr "Versionsgeschichte" -#: AKSubmission/templates/AKSubmission/ak_detail.html:171 +#: AKSubmission/templates/AKSubmission/ak_detail.html:170 #: AKSubmission/templates/AKSubmission/akmessage_add.html:8 #: AKSubmission/templates/AKSubmission/akmessage_add.html:16 #: AKSubmission/templates/AKSubmission/akmessage_add.html:22 msgid "Add confidential message to organizers" msgstr "Sende eine private Nachricht an das Organisationsteam" -#: AKSubmission/templates/AKSubmission/ak_detail.html:174 -#: AKSubmission/templates/AKSubmission/ak_detail.html:317 +#: AKSubmission/templates/AKSubmission/ak_detail.html:173 +#: AKSubmission/templates/AKSubmission/ak_detail.html:326 #: AKSubmission/templates/AKSubmission/ak_edit.html:16 -#: AKSubmission/templates/AKSubmission/ak_table.html:51 +#: AKSubmission/templates/AKSubmission/ak_table.html:61 msgid "Edit" msgstr "Bearbeiten" -#: AKSubmission/templates/AKSubmission/ak_detail.html:179 +#: AKSubmission/templates/AKSubmission/ak_detail.html:178 #: AKSubmission/templates/AKSubmission/ak_history.html:31 -#: AKSubmission/templates/AKSubmission/ak_table.html:34 +#: AKSubmission/templates/AKSubmission/ak_table.html:37 msgid "AK Wish" msgstr "AK-Wunsch" -#: AKSubmission/templates/AKSubmission/ak_detail.html:187 +#: AKSubmission/templates/AKSubmission/ak_detail.html:186 #, python-format msgid "" "This AK currently takes place for another <span v-html=\"timeUntilEnd\">" @@ -116,7 +116,8 @@ msgstr "" "%(featured_slot_remaining)s</span> Minute(n) in %(room)s statt. \n" " " -#: AKSubmission/templates/AKSubmission/ak_detail.html:190 +#: AKSubmission/templates/AKSubmission/ak_detail.html:189 +#, python-format msgid "" "This AK starts in <span v-html=\"timeUntilStart\">" "%(featured_slot_remaining)s</span> minute(s) in %(room)s. " @@ -125,89 +126,94 @@ msgstr "" "%(featured_slot_remaining)s</span> Minute(n) in %(room)s. \n" " " -#: AKSubmission/templates/AKSubmission/ak_detail.html:195 -#: AKSubmission/templates/AKSubmission/ak_detail.html:325 +#: AKSubmission/templates/AKSubmission/ak_detail.html:194 +#: AKSubmission/templates/AKSubmission/ak_detail.html:334 msgid "Go to virtual room" msgstr "Zum virtuellen Raum" -#: AKSubmission/templates/AKSubmission/ak_detail.html:206 +#: AKSubmission/templates/AKSubmission/ak_detail.html:205 #: AKSubmission/templates/AKSubmission/ak_table.html:10 msgid "Who?" msgstr "Wer?" -#: AKSubmission/templates/AKSubmission/ak_detail.html:212 +#: AKSubmission/templates/AKSubmission/ak_detail.html:211 #: AKSubmission/templates/AKSubmission/ak_history.html:36 #: AKSubmission/templates/AKSubmission/ak_table.html:11 msgid "Category" msgstr "Kategorie" -#: AKSubmission/templates/AKSubmission/ak_detail.html:219 +#: AKSubmission/templates/AKSubmission/ak_detail.html:218 +#: AKSubmission/templates/AKSubmission/ak_table.html:13 +msgid "Types" +msgstr "Typen" + +#: AKSubmission/templates/AKSubmission/ak_detail.html:228 #: AKSubmission/templates/AKSubmission/ak_history.html:37 msgid "Track" msgstr "Track" -#: AKSubmission/templates/AKSubmission/ak_detail.html:225 +#: AKSubmission/templates/AKSubmission/ak_detail.html:234 msgid "Present this AK" msgstr "Diesen AK vorstellen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:230 +#: AKSubmission/templates/AKSubmission/ak_detail.html:239 msgid "(Category Default)" msgstr "(Kategorievoreinstellung)" -#: AKSubmission/templates/AKSubmission/ak_detail.html:236 +#: AKSubmission/templates/AKSubmission/ak_detail.html:245 msgid "Reso intention?" msgstr "Resoabsicht?" -#: AKSubmission/templates/AKSubmission/ak_detail.html:243 +#: AKSubmission/templates/AKSubmission/ak_detail.html:252 msgid "Requirements" msgstr "Anforderungen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:256 +#: AKSubmission/templates/AKSubmission/ak_detail.html:265 msgid "Conflicting AKs" msgstr "AK-Konflikte" -#: AKSubmission/templates/AKSubmission/ak_detail.html:264 +#: AKSubmission/templates/AKSubmission/ak_detail.html:273 msgid "Prerequisite AKs" msgstr "Vorausgesetzte AKs" -#: AKSubmission/templates/AKSubmission/ak_detail.html:272 +#: AKSubmission/templates/AKSubmission/ak_detail.html:281 msgid "Notes" msgstr "Notizen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:285 +#: AKSubmission/templates/AKSubmission/ak_detail.html:294 msgid "When?" msgstr "Wann?" -#: AKSubmission/templates/AKSubmission/ak_detail.html:287 +#: AKSubmission/templates/AKSubmission/ak_detail.html:296 #: AKSubmission/templates/AKSubmission/akslot_delete.html:35 msgid "Duration" msgstr "Dauer" -#: AKSubmission/templates/AKSubmission/ak_detail.html:289 +#: AKSubmission/templates/AKSubmission/ak_detail.html:298 msgid "Room" msgstr "Raum" -#: AKSubmission/templates/AKSubmission/ak_detail.html:320 +#: AKSubmission/templates/AKSubmission/ak_detail.html:329 msgid "Delete" msgstr "Löschen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:331 +#: AKSubmission/templates/AKSubmission/ak_detail.html:340 msgid "Schedule" msgstr "Schedule" -#: AKSubmission/templates/AKSubmission/ak_detail.html:343 +#: AKSubmission/templates/AKSubmission/ak_detail.html:352 msgid "Add another slot" msgstr "Einen neuen AK-Slot hinzufügen" -#: AKSubmission/templates/AKSubmission/ak_detail.html:353 +#: AKSubmission/templates/AKSubmission/ak_detail.html:362 msgid "Possible Times" msgstr "Mögliche Zeiten" -#: AKSubmission/templates/AKSubmission/ak_detail.html:357 +#: AKSubmission/templates/AKSubmission/ak_detail.html:366 msgid "Start" msgstr "Start" -#: AKSubmission/templates/AKSubmission/ak_detail.html:358 +#: AKSubmission/templates/AKSubmission/ak_detail.html:367 msgid "End" msgstr "Ende" @@ -259,12 +265,12 @@ msgid "Time" msgstr "Zeit" #: AKSubmission/templates/AKSubmission/ak_history.html:48 -#: AKSubmission/templates/AKSubmission/ak_table.html:25 +#: AKSubmission/templates/AKSubmission/ak_table.html:28 msgid "Present results of this AK" msgstr "Die Ergebnisse dieses AKs vorstellen" #: AKSubmission/templates/AKSubmission/ak_history.html:52 -#: AKSubmission/templates/AKSubmission/ak_table.html:29 +#: AKSubmission/templates/AKSubmission/ak_table.html:32 msgid "Intends to submit a resolution" msgstr "Beabsichtigt eine Resolution einzureichen" @@ -284,11 +290,11 @@ msgstr "AK-Liste" msgid "Add AK" msgstr "AK hinzufügen" -#: AKSubmission/templates/AKSubmission/ak_table.html:42 +#: AKSubmission/templates/AKSubmission/ak_table.html:52 msgid "Details" msgstr "Details" -#: AKSubmission/templates/AKSubmission/ak_table.html:66 +#: AKSubmission/templates/AKSubmission/ak_table.html:76 msgid "There are no AKs in this category yet" msgstr "Es gibt noch keine AKs in dieser Kategorie" @@ -404,64 +410,64 @@ msgstr "" "AKs die sich gewünscht wurden, aber bei denen noch nicht klar ist, wer sie " "macht. Falls du dir das vorstellen kannst, trag dich einfach ein" -#: AKSubmission/views.py:167 +#: AKSubmission/views.py:169 msgid "Currently planned AKs" msgstr "Aktuell geplante AKs" -#: AKSubmission/views.py:300 +#: AKSubmission/views.py:302 msgid "Event inactive. Cannot create or update." msgstr "Event inaktiv. Hinzufügen/Bearbeiten nicht möglich." -#: AKSubmission/views.py:325 +#: AKSubmission/views.py:327 msgid "AK successfully created" msgstr "AK erfolgreich angelegt" -#: AKSubmission/views.py:398 +#: AKSubmission/views.py:400 msgid "AK successfully updated" msgstr "AK erfolgreich aktualisiert" -#: AKSubmission/views.py:449 +#: AKSubmission/views.py:451 #, python-brace-format msgid "Added '{owner}' as new owner of '{ak.name}'" msgstr "'{owner}' als neue Leitung von '{ak.name}' hinzugefügt" -#: AKSubmission/views.py:553 +#: AKSubmission/views.py:555 msgid "No user selected" msgstr "Keine Person ausgewählt" -#: AKSubmission/views.py:569 +#: AKSubmission/views.py:571 msgid "Person Info successfully updated" msgstr "Personen-Info erfolgreich aktualisiert" -#: AKSubmission/views.py:605 +#: AKSubmission/views.py:607 msgid "AK Slot successfully added" msgstr "AK-Slot erfolgreich angelegt" -#: AKSubmission/views.py:624 +#: AKSubmission/views.py:626 msgid "You cannot edit a slot that has already been scheduled" msgstr "Bereits geplante AK-Slots können nicht mehr bearbeitet werden" -#: AKSubmission/views.py:634 +#: AKSubmission/views.py:636 msgid "AK Slot successfully updated" msgstr "AK-Slot erfolgreich aktualisiert" -#: AKSubmission/views.py:652 +#: AKSubmission/views.py:654 msgid "You cannot delete a slot that has already been scheduled" msgstr "Bereits geplante AK-Slots können nicht mehr gelöscht werden" -#: AKSubmission/views.py:662 +#: AKSubmission/views.py:664 msgid "AK Slot successfully deleted" msgstr "AK-Slot erfolgreich angelegt" -#: AKSubmission/views.py:674 +#: AKSubmission/views.py:676 msgid "Messages" msgstr "Nachrichten" -#: AKSubmission/views.py:684 +#: AKSubmission/views.py:686 msgid "Delete all messages" msgstr "Alle Nachrichten löschen" -#: AKSubmission/views.py:711 +#: AKSubmission/views.py:713 msgid "Message to organizers successfully saved" msgstr "Nachricht an die Organisator*innen erfolgreich gespeichert" diff --git a/AKSubmission/templates/AKSubmission/ak_detail.html b/AKSubmission/templates/AKSubmission/ak_detail.html index 08c58485..82fcb64a 100644 --- a/AKSubmission/templates/AKSubmission/ak_detail.html +++ b/AKSubmission/templates/AKSubmission/ak_detail.html @@ -213,6 +213,16 @@ {% category_linked_badge ak.category ak.event.slug %} </td> </tr> + {% if ak.types.count > 0 %} + <tr> + <td>{% trans "Types" %}</td> + <td> + {% for type in ak.types.all %} + <span class="badge bg-info">{{ type }}</span> + {% endfor %} + </td> + </tr> + {% endif %} {% if ak.track %} <tr> <td>{% trans 'Track' %}</td> diff --git a/AKSubmission/templates/AKSubmission/ak_table.html b/AKSubmission/templates/AKSubmission/ak_table.html index 775e95e0..1d21554a 100644 --- a/AKSubmission/templates/AKSubmission/ak_table.html +++ b/AKSubmission/templates/AKSubmission/ak_table.html @@ -9,6 +9,9 @@ <th>{% trans "Name" %}</th> <th>{% trans "Who?" %}</th> <th>{% trans 'Category' %}</th> + {% if show_types %} + <th>{% trans 'Types' %}</th> + {% endif %} <th></th> </tr> </thead> @@ -37,6 +40,13 @@ {% endif %} </td> <td>{% category_linked_badge ak.category event.slug %}</td> + {% if show_types %} + <td> + {% for aktype in ak.types.all %} + <span class="badge bg-info">{{ aktype }}</span> + {% endfor %} + </td> + {% endif %} <td class="text-end" style="white-space: nowrap;"> <a href="{{ ak.detail_url }}" data-bs-toggle="tooltip" title="{% trans 'Details' %}" diff --git a/AKSubmission/tests.py b/AKSubmission/tests.py index 018289aa..2e79be6d 100644 --- a/AKSubmission/tests.py +++ b/AKSubmission/tests.py @@ -6,6 +6,7 @@ from django.utils.datetime_safe import datetime from AKModel.models import AK, AKSlot, Event from AKModel.tests import BasicViewTests +from AKSubmission.forms import AKSubmissionForm class ModelViewTests(BasicViewTests, TestCase): @@ -236,3 +237,37 @@ class ModelViewTests(BasicViewTests, TestCase): msg_prefix=f"No correct redirect: {add_new_user_to_ak_url} (POST) -> {detail_url}") self._assert_message(response, "Added 'New test owner' as new owner of 'Test AK Inhalt'") self.assertEqual(AK.objects.get(pk=1).owners.count(), 2) + + def test_visibility_requirements_in_submission_form(self): + """ + Test visibility of requirements field in submission form + """ + event = Event.get_by_slug('kif42') + form = AKSubmissionForm(data={'name': 'Test AK', 'event': event}, instance=None, initial={"event":event}) + self.assertIn('requirements', form.fields, + msg="Requirements field not present in form even though event has requirements") + + event2 = Event.objects.create(name='Event without requirements', + slug='no_req', + start=datetime.now(), end=datetime.now(), + active=True) + form2 = AKSubmissionForm(data={'name': 'Test AK', 'event': event2}, instance=None, initial={"event": event2}) + self.assertNotIn('requirements', form2.fields, + msg="Requirements field should not be present for events without requirements") + + def test_visibility_types_in_submission_form(self): + """ + Test visibility of types field in submission form + """ + event = Event.get_by_slug('kif42') + form = AKSubmissionForm(data={'name': 'Test AK', 'event': event}, instance=None, initial={"event":event}) + self.assertIn('types', form.fields, + msg="Requirements field not present in form even though event has requirements") + + event2 = Event.objects.create(name='Event without types', + slug='no_types', + start=datetime.now(), end=datetime.now(), + active=True) + form2 = AKSubmissionForm(data={'name': 'Test AK', 'event': event2}, instance=None, initial={"event": event2}) + self.assertNotIn('types', form2.fields, + msg="Requirements field should not be present for events without types") diff --git a/AKSubmission/views.py b/AKSubmission/views.py index e7940a01..5263b875 100644 --- a/AKSubmission/views.py +++ b/AKSubmission/views.py @@ -59,7 +59,7 @@ class AKOverviewView(FilterByEventSlugMixin, ListView): :rtype: QuerySet[AK] """ # Use prefetching and relation selection/joining to reduce the amount of necessary queries - return category.ak_set.select_related('event').prefetch_related('owners').all() + return category.ak_set.select_related('event').prefetch_related('owners').prefetch_related('types').all() def get_active_category_name(self, context): """ @@ -130,6 +130,8 @@ class AKOverviewView(FilterByEventSlugMixin, ListView): context["active_category"] = self.get_active_category_name(context) context['table_title'] = self.get_table_title(context) + context['show_types'] = self.event.aktype_set.count() > 0 + # ========================================================== # Display interest indication button? # ========================================================== -- GitLab