Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • konstantin/akplanning
  • matedealer/akplanning
  • kif/akplanning
  • mirco/akplanning
  • lordofthevoid/akplanning
  • voidptr/akplanning
  • xayomer/akplanning-fork
  • mollux/akplanning
  • neumantm/akplanning
  • mmarx/akplanning
  • nerf/akplanning
  • felix_bonn/akplanning
  • sebastian.uschmann/akplanning
13 results
Select Git revision
  • komasolver
  • main
  • renovate/django-5.x
  • renovate/django-debug-toolbar-5.x
  • renovate/django_csp-4.x
  • renovate/djangorestframework-3.x
  • renovate/sphinxcontrib-apidoc-0.x
  • renovate/tzdata-2025.x
  • renovate/uwsgi-2.x
9 results
Show changes
Commits on Source (10)
......@@ -267,6 +267,14 @@ class Availability(models.Model):
return Availability(start=timeframe_start, end=timeframe_end, event=event, person=person,
room=room, ak=ak, ak_category=ak_category)
@classmethod
def is_event_covered(cls, event, availabilities: List['Availability']) -> bool:
# NOTE: Cannot use `Availability.with_event_length` as its end is the
# event end + 1 day
full_event = Availability(event=event, start=event.start, end=event.end)
avail_union = Availability.union(availabilities)
return not avail_union or avail_union[0].contains(full_event)
class Meta:
verbose_name = _('Availability')
verbose_name_plural = _('Availabilities')
......
......@@ -272,3 +272,12 @@ class RoomFormWithAvailabilities(AvailabilitiesFormMixin, RoomForm):
# Filter possible values for m2m when event is specified
if hasattr(self.instance, "event") and self.instance.event is not None:
self.fields["properties"].queryset = AKRequirement.objects.filter(event=self.instance.event)
class JSONImportForm(AdminIntermediateForm):
json_data = forms.CharField(
required=True,
widget=forms.Textarea,
label=_("JSON data"),
help_text=_("JSON data from the scheduling solver"),
)
......@@ -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: 2024-05-27 02:31+0000\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,10 +33,9 @@ msgstr "Plan veröffentlichen"
msgid "Unpublish plan"
msgstr "Plan verbergen"
#: AKModel/admin.py:168 AKModel/models.py:360 AKModel/models.py:682
#: AKModel/templates/admin/AKModel/aks_by_user.html:12
#: AKModel/admin.py:168 AKModel/models.py:437 AKModel/models.py:759
#: 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:97
msgid "AKs"
msgstr "AKs"
......@@ -60,11 +59,11 @@ msgstr "In Wiki-Syntax exportieren"
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:320 AKModel/views/ak.py:184
msgid "Reset interest in AKs"
msgstr "Interesse an AKs zurücksetzen"
#: AKModel/admin.py:330 AKModel/views/ak.py:114
#: AKModel/admin.py:330 AKModel/views/ak.py:199
msgid "Reset AKs' interest counters"
msgstr "Interessenszähler der AKs zurücksetzen"
......@@ -109,17 +108,17 @@ msgstr "Die eingegebene Verfügbarkeit enthält ein ungültiges Datum."
msgid "Please fill in your availabilities!"
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/availability/models.py:43 AKModel/models.py:61 AKModel/models.py:235
#: AKModel/models.py:328 AKModel/models.py:347 AKModel/models.py:373
#: AKModel/models.py:427 AKModel/models.py:569 AKModel/models.py:608
#: AKModel/models.py:698 AKModel/models.py:755 AKModel/models.py:946
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/availability/models.py:44 AKModel/models.py:236
#: AKModel/models.py:329 AKModel/models.py:348 AKModel/models.py:374
#: AKModel/models.py:428 AKModel/models.py:570 AKModel/models.py:609
#: AKModel/models.py:699 AKModel/models.py:756 AKModel/models.py:947
msgid "Associated event"
msgstr "Zugehöriges Event"
......@@ -131,8 +130,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:573
#: AKModel/models.py:598 AKModel/models.py:765
msgid "Room"
msgstr "Raum"
......@@ -140,8 +139,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:436
#: AKModel/models.py:597 AKModel/models.py:693
msgid "AK"
msgstr "AK"
......@@ -149,8 +148,8 @@ msgstr "AK"
msgid "AK whose availability this is"
msgstr "Verfügbarkeiten"
#: AKModel/availability/models.py:79 AKModel/models.py:255
#: AKModel/models.py:694
#: AKModel/availability/models.py:79 AKModel/models.py:332
#: AKModel/models.py:771
msgid "AK Category"
msgstr "AK-Kategorie"
......@@ -220,7 +219,7 @@ 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:189 AKModel/models.py:940
msgid "Default Slots"
msgstr "Standardslots"
......@@ -259,7 +258,15 @@ msgstr "Standardverfügbarkeiten für alle Räume anlegen?"
msgid "CSV must contain a name column"
msgstr "CSV muss eine name-Spalte enthalten"
#: AKModel/metaviews/admin.py:156 AKModel/models.py:29
#: AKModel/forms.py:281
msgid "JSON data"
msgstr "JSON-Daten"
#: AKModel/forms.py:282
msgid "JSON data from the scheduling solver"
msgstr "JSON-Daten, die der scheduling-solver produziert hat"
#: AKModel/metaviews/admin.py:156 AKModel/models.py:30
msgid "Start"
msgstr "Start"
......@@ -284,66 +291,66 @@ msgstr "Aktivieren?"
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:21 AKModel/models.py:320 AKModel/models.py:344
#: AKModel/models.py:371 AKModel/models.py:389 AKModel/models.py:561
msgid "Name"
msgstr "Name"
#: AKModel/models.py:21
#: AKModel/models.py:22
msgid "Name or iteration of the event"
msgstr "Name oder Iteration des Events"
#: AKModel/models.py:22
#: AKModel/models.py:23
msgid "Short Form"
msgstr "Kurzer Name"
#: AKModel/models.py:23
#: AKModel/models.py:24
msgid "Short name of letters/numbers/dots/dashes/underscores used in URLs."
msgstr ""
"Kurzname bestehend aus Buchstaben, Nummern, Punkten und Unterstrichen zur "
"Nutzung in URLs"
#: AKModel/models.py:25
#: AKModel/models.py:26
msgid "Place"
msgstr "Ort"
#: AKModel/models.py:26
#: AKModel/models.py:27
msgid "City etc. the event takes place in"
msgstr "Stadt o.ä. in der das Event stattfindet"
#: AKModel/models.py:28
#: AKModel/models.py:29
msgid "Time Zone"
msgstr "Zeitzone"
#: AKModel/models.py:28
#: AKModel/models.py:29
msgid "Time Zone where this event takes place in"
msgstr "Zeitzone in der das Event stattfindet"
#: AKModel/models.py:29
#: AKModel/models.py:30
msgid "Time the event begins"
msgstr "Zeit zu der das Event beginnt"
#: AKModel/models.py:30
#: AKModel/models.py:31
msgid "End"
msgstr "Ende"
#: AKModel/models.py:30
#: AKModel/models.py:31
msgid "Time the event ends"
msgstr "Zeit zu der das Event endet"
#: AKModel/models.py:31
#: AKModel/models.py:32
msgid "Resolution Deadline"
msgstr "Resolutionsdeadline"
#: AKModel/models.py:32
#: AKModel/models.py:33
msgid "When should AKs with intention to submit a resolution be done?"
msgstr "Wann sollen AKs mit Resolutionsabsicht stattgefunden haben?"
#: AKModel/models.py:34
#: AKModel/models.py:35
msgid "Interest Window Start"
msgstr "Beginn Interessensbekundung"
#: AKModel/models.py:36
#: AKModel/models.py:37
msgid ""
"Opening time for expression of interest. When left blank, no interest "
"indication will be possible."
......@@ -351,71 +358,71 @@ msgstr ""
"Öffnungszeitpunkt für die Angabe von Interesse an AKs.Wenn das Feld leer "
"bleibt, wird keine Abgabe von Interesse möglich sein."
#: AKModel/models.py:38
#: AKModel/models.py:39
msgid "Interest Window End"
msgstr "Ende Interessensbekundung"
#: AKModel/models.py:39
#: AKModel/models.py:40
msgid "Closing time for expression of interest."
msgstr "Öffnungszeitpunkt für die Angabe von Interesse an AKs."
#: AKModel/models.py:41
#: AKModel/models.py:42
msgid "Public event"
msgstr "Öffentliches Event"
#: AKModel/models.py:42
#: AKModel/models.py:43
msgid "Show this event on overview page."
msgstr "Zeige dieses Event auf der Übersichtseite an"
#: AKModel/models.py:44
#: AKModel/models.py:45
msgid "Active State"
msgstr "Aktiver Status"
#: AKModel/models.py:44
#: AKModel/models.py:45
msgid "Marks currently active events"
msgstr "Markiert aktuell aktive Events"
#: AKModel/models.py:45
#: AKModel/models.py:46
msgid "Plan Hidden"
msgstr "Plan verborgen"
#: AKModel/models.py:45
#: AKModel/models.py:46
msgid "Hides plan for non-staff users"
msgstr "Verbirgt den Plan für Nutzer*innen ohne erweiterte Rechte"
#: AKModel/models.py:47
#: AKModel/models.py:48
msgid "Plan published at"
msgstr "Plan veröffentlicht am/um"
#: AKModel/models.py:48
#: AKModel/models.py:49
msgid "Timestamp at which the plan was published"
msgstr "Zeitpunkt, zu dem der Plan veröffentlicht wurde"
#: AKModel/models.py:50
#: AKModel/models.py:51
msgid "Base URL"
msgstr "URL-Prefix"
#: AKModel/models.py:50
#: AKModel/models.py:51
msgid "Prefix for wiki link construction"
msgstr "Prefix für die automatische Generierung von Wiki-Links"
#: AKModel/models.py:51
#: AKModel/models.py:52
msgid "Wiki Export Template Name"
msgstr "Wiki-Export Templatename"
#: AKModel/models.py:52
#: AKModel/models.py:53
msgid "Default Slot Length"
msgstr "Standardslotlänge"
#: AKModel/models.py:53
#: AKModel/models.py:54
msgid "Default length in hours that is assumed for AKs in this event."
msgstr "Standardlänge von Slots (in Stunden) für dieses Event"
#: AKModel/models.py:55
#: AKModel/models.py:56
msgid "Contact email address"
msgstr "E-Mail Kontaktadresse"
#: AKModel/models.py:56
#: AKModel/models.py:57
msgid ""
"An email address that is displayed on every page and can be used for all "
"kinds of questions"
......@@ -423,75 +430,75 @@ msgstr ""
"Eine Mailadresse die auf jeder Seite angezeigt wird und für alle Arten von "
"Fragen genutzt werden kann"
#: AKModel/models.py:61
#: AKModel/models.py:62
msgid "Events"
msgstr "Events"
#: AKModel/models.py:169
#: AKModel/models.py:230
msgid "Nickname"
msgstr "Spitzname"
#: AKModel/models.py:169
#: AKModel/models.py:230
msgid "Name to identify an AK owner by"
msgstr "Name, durch den eine AK-Leitung identifiziert wird"
#: AKModel/models.py:170
#: AKModel/models.py:231
msgid "Slug"
msgstr "Slug"
#: AKModel/models.py:170
#: AKModel/models.py:231
msgid "Slug for URL generation"
msgstr "Slug für URL-Generierung"
#: AKModel/models.py:171
#: AKModel/models.py:232
msgid "Institution"
msgstr "Instutution"
#: AKModel/models.py:171
#: AKModel/models.py:232
msgid "Uni etc."
msgstr "Universität o.ä."
#: AKModel/models.py:172 AKModel/models.py:321
#: AKModel/models.py:233 AKModel/models.py:398
msgid "Web Link"
msgstr "Internet Link"
#: AKModel/models.py:172
#: AKModel/models.py:233
msgid "Link to Homepage"
msgstr "Link zu Homepage oder Webseite"
#: AKModel/models.py:178 AKModel/models.py:687
#: AKModel/models.py:239 AKModel/models.py:764
msgid "AK Owner"
msgstr "AK-Leitung"
#: AKModel/models.py:179
#: AKModel/models.py:240
msgid "AK Owners"
msgstr "AK-Leitungen"
#: AKModel/models.py:243
#: AKModel/models.py:320
msgid "Name of the AK Category"
msgstr "Name der AK-Kategorie"
#: AKModel/models.py:244 AKModel/models.py:268
#: AKModel/models.py:321 AKModel/models.py:345
msgid "Color"
msgstr "Farbe"
#: AKModel/models.py:244 AKModel/models.py:268
#: AKModel/models.py:321 AKModel/models.py:345
msgid "Color for displaying"
msgstr "Farbe für die Anzeige"
#: AKModel/models.py:245 AKModel/models.py:315
#: AKModel/models.py:322 AKModel/models.py:392
msgid "Description"
msgstr "Beschreibung"
#: AKModel/models.py:246
#: AKModel/models.py:323
msgid "Short description of this AK Category"
msgstr "Beschreibung der AK-Kategorie"
#: AKModel/models.py:247
#: AKModel/models.py:324
msgid "Present by default"
msgstr "Defaultmäßig präsentieren"
#: AKModel/models.py:248
#: AKModel/models.py:325
msgid ""
"Present AKs of this category by default if AK owner did not specify whether "
"this AK should be presented?"
......@@ -499,132 +506,132 @@ msgstr ""
"AKs dieser Kategorie standardmäßig vorstellen, wenn die Leitungen das für "
"ihren AK nicht explizit spezifiziert haben?"
#: AKModel/models.py:256
#: AKModel/models.py:333
msgid "AK Categories"
msgstr "AK-Kategorien"
#: AKModel/models.py:267
#: AKModel/models.py:344
msgid "Name of the AK Track"
msgstr "Name des AK-Tracks"
#: AKModel/models.py:274
#: AKModel/models.py:351
msgid "AK Track"
msgstr "AK-Track"
#: AKModel/models.py:275
#: AKModel/models.py:352
msgid "AK Tracks"
msgstr "AK-Tracks"
#: AKModel/models.py:294
#: AKModel/models.py:371
msgid "Name of the Requirement"
msgstr "Name der Anforderung"
#: AKModel/models.py:300 AKModel/models.py:691
#: AKModel/models.py:377 AKModel/models.py:768
msgid "AK Requirement"
msgstr "AK-Anforderung"
#: AKModel/models.py:301
#: AKModel/models.py:378
msgid "AK Requirements"
msgstr "AK-Anforderungen"
#: AKModel/models.py:312
#: AKModel/models.py:389
msgid "Name of the AK"
msgstr "Name des AKs"
#: AKModel/models.py:313
#: AKModel/models.py:390
msgid "Short Name"
msgstr "Kurzer Name"
#: AKModel/models.py:314
#: AKModel/models.py:391
msgid "Name displayed in the schedule"
msgstr "Name zur Anzeige im AK-Plan"
#: AKModel/models.py:315
#: AKModel/models.py:392
msgid "Description of the AK"
msgstr "Beschreibung des AKs"
#: AKModel/models.py:317
#: AKModel/models.py:394
msgid "Owners"
msgstr "Leitungen"
#: AKModel/models.py:318
#: AKModel/models.py:395
msgid "Those organizing the AK"
msgstr "Menschen, die den AK organisieren und halten"
#: AKModel/models.py:321
#: AKModel/models.py:398
msgid "Link to wiki page"
msgstr "Link zur Wiki Seite"
#: AKModel/models.py:322
#: AKModel/models.py:399
msgid "Protocol Link"
msgstr "Protokolllink"
#: AKModel/models.py:322
#: AKModel/models.py:399
msgid "Link to protocol"
msgstr "Link zum Protokoll"
#: AKModel/models.py:324
#: AKModel/models.py:401
msgid "Category"
msgstr "Kategorie"
#: AKModel/models.py:325
#: AKModel/models.py:402
msgid "Category of the AK"
msgstr "Kategorie des AKs"
#: AKModel/models.py:326
#: AKModel/models.py:403
msgid "Track"
msgstr "Track"
#: AKModel/models.py:327
#: AKModel/models.py:404
msgid "Track the AK belongs to"
msgstr "Track zu dem der AK gehört"
#: AKModel/models.py:329
#: AKModel/models.py:406
msgid "Resolution Intention"
msgstr "Resolutionsabsicht"
#: AKModel/models.py:330
#: AKModel/models.py:407
msgid "Intends to submit a resolution"
msgstr "Beabsichtigt eine Resolution einzureichen"
#: AKModel/models.py:331
#: AKModel/models.py:408
msgid "Present this AK"
msgstr "AK präsentieren"
#: AKModel/models.py:332
#: AKModel/models.py:409
msgid "Present results of this AK"
msgstr "Die Ergebnisse dieses AKs vorstellen"
#: AKModel/models.py:334 AKModel/views/status.py:163
#: AKModel/models.py:411 AKModel/views/status.py:170
msgid "Requirements"
msgstr "Anforderungen"
#: AKModel/models.py:335
#: AKModel/models.py:412
msgid "AK's Requirements"
msgstr "Anforderungen des AKs"
#: AKModel/models.py:337
#: AKModel/models.py:414
msgid "Conflicting AKs"
msgstr "AK-Konflikte"
#: AKModel/models.py:338
#: AKModel/models.py:415
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:416
msgid "Prerequisite AKs"
msgstr "Vorausgesetzte AKs"
#: AKModel/models.py:340
#: AKModel/models.py:417
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:419
msgid "Organizational Notes"
msgstr "Notizen zur Organisation"
#: AKModel/models.py:343
#: AKModel/models.py:420
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 +641,291 @@ msgstr ""
"Anmerkungen bitte den Button für Direktnachrichten verwenden (nach dem "
"Anlegen/Bearbeiten)."
#: AKModel/models.py:346
#: AKModel/models.py:423
msgid "Interest"
msgstr "Interesse"
#: AKModel/models.py:346
#: AKModel/models.py:423
msgid "Expected number of people"
msgstr "Erwartete Personenzahl"
#: AKModel/models.py:347
#: AKModel/models.py:424
msgid "Interest Counter"
msgstr "Interessenszähler"
#: AKModel/models.py:348
#: AKModel/models.py:425
msgid "People who have indicated interest online"
msgstr "Anzahl Personen, die online Interesse bekundet haben"
#: AKModel/models.py:353
#: AKModel/models.py:430
msgid "Export?"
msgstr "Export?"
#: AKModel/models.py:354
#: AKModel/models.py:431
msgid "Include AK in wiki export?"
msgstr "AK bei Wiki-Export berücksichtigen?"
#: AKModel/models.py:484
#: AKModel/models.py:561
msgid "Name or number of the room"
msgstr "Name oder Nummer des Raums"
#: AKModel/models.py:485
#: AKModel/models.py:562
msgid "Location"
msgstr "Ort"
#: AKModel/models.py:486
#: AKModel/models.py:563
msgid "Name or number of the location"
msgstr "Name oder Nummer des Ortes"
#: AKModel/models.py:487
#: AKModel/models.py:564
msgid "Capacity"
msgstr "Kapazität"
#: AKModel/models.py:488
#: AKModel/models.py:565
msgid "Maximum number of people (-1 for unlimited)."
msgstr "Maximale Personenzahl (-1 wenn unbeschränkt)."
#: AKModel/models.py:489
#: AKModel/models.py:566
msgid "Properties"
msgstr "Eigenschaften"
#: AKModel/models.py:490
#: AKModel/models.py:567
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:574 AKModel/views/status.py:59
msgid "Rooms"
msgstr "Räume"
#: AKModel/models.py:520
#: AKModel/models.py:597
msgid "AK being mapped"
msgstr "AK, der zugeordnet wird"
#: AKModel/models.py:522
#: AKModel/models.py:599
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:600 AKModel/models.py:943
msgid "Slot Begin"
msgstr "Beginn des Slots"
#: AKModel/models.py:523 AKModel/models.py:866
#: AKModel/models.py:600 AKModel/models.py:943
msgid "Time and date the slot begins"
msgstr "Zeit und Datum zu der der AK beginnt"
#: AKModel/models.py:525
#: AKModel/models.py:602
msgid "Duration"
msgstr "Dauer"
#: AKModel/models.py:526
#: AKModel/models.py:603
msgid "Length in hours"
msgstr "Länge in Stunden"
#: AKModel/models.py:528
#: AKModel/models.py:605
msgid "Scheduling fixed"
msgstr "Planung fix"
#: AKModel/models.py:529
#: AKModel/models.py:606
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:611
msgid "Last update"
msgstr "Letzte Aktualisierung"
#: AKModel/models.py:537
#: AKModel/models.py:614
msgid "AK Slot"
msgstr "AK-Slot"
#: AKModel/models.py:538 AKModel/models.py:684
#: AKModel/models.py:615 AKModel/models.py:761
msgid "AK Slots"
msgstr "AK-Slot"
#: AKModel/models.py:560 AKModel/models.py:569
#: AKModel/models.py:637 AKModel/models.py:646
msgid "Not scheduled yet"
msgstr "Noch nicht geplant"
#: AKModel/models.py:617
#: AKModel/models.py:694
msgid "AK this message belongs to"
msgstr "AK zu dem die Nachricht gehört"
#: AKModel/models.py:618
#: AKModel/models.py:695
msgid "Message text"
msgstr "Nachrichtentext"
#: AKModel/models.py:619
#: AKModel/models.py:696
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:700
msgid "Resolved"
msgstr "Erledigt"
#: AKModel/models.py:624
#: AKModel/models.py:701
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:704
msgid "AK Orga Message"
msgstr "AK-Organachricht"
#: AKModel/models.py:628
#: AKModel/models.py:705
msgid "AK Orga Messages"
msgstr "AK-Organachrichten"
#: AKModel/models.py:645
#: AKModel/models.py:722
msgid "Constraint Violation"
msgstr "Constraintverletzung"
#: AKModel/models.py:646
#: AKModel/models.py:723
msgid "Constraint Violations"
msgstr "Constraintverletzungen"
#: AKModel/models.py:653
#: AKModel/models.py:730
msgid "Owner has two parallel slots"
msgstr "Leitung hat zwei Slots parallel"
#: AKModel/models.py:654
#: AKModel/models.py:731
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:732
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:733
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:734
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:735
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:737
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:738
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:739
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:740
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:741
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:747
msgid "Warning"
msgstr "Warnung"
#: AKModel/models.py:671
#: AKModel/models.py:748
msgid "Violation"
msgstr "Verletzung"
#: AKModel/models.py:673
#: AKModel/models.py:750
msgid "Type"
msgstr "Art"
#: AKModel/models.py:674
#: AKModel/models.py:751
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:752
msgid "Level"
msgstr "Level"
#: AKModel/models.py:676
#: AKModel/models.py:753
msgid "Severity level of the violation"
msgstr "Schweregrad der Verletzung"
#: AKModel/models.py:683
#: AKModel/models.py:760
msgid "AK(s) belonging to this constraint"
msgstr "AK(s), die zu diesem Constraint gehören"
#: AKModel/models.py:685
#: AKModel/models.py:762
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:764
msgid "AK Owner belonging to this constraint"
msgstr "AK Leitung(en), die zu diesem Constraint gehören"
#: AKModel/models.py:689
#: AKModel/models.py:766
msgid "Room belonging to this constraint"
msgstr "Raum, der zu diesem Constraint gehört"
#: AKModel/models.py:692
#: AKModel/models.py:769
msgid "AK Requirement belonging to this constraint"
msgstr "AK Anforderung, die zu diesem Constraint gehört"
#: AKModel/models.py:694
#: AKModel/models.py:771
msgid "AK Category belonging to this constraint"
msgstr "AK Kategorie, di zu diesem Constraint gehört"
#: AKModel/models.py:696
#: AKModel/models.py:773
msgid "Comment"
msgstr "Kommentar"
#: AKModel/models.py:696
#: AKModel/models.py:773
msgid "Comment or further details for this violation"
msgstr "Kommentar oder weitere Details zu dieser Vereletzung"
#: AKModel/models.py:699
#: AKModel/models.py:776
msgid "Timestamp"
msgstr "Timestamp"
#: AKModel/models.py:699
#: AKModel/models.py:776
msgid "Time of creation"
msgstr "Zeitpunkt der ERstellung"
#: AKModel/models.py:700
#: AKModel/models.py:777
msgid "Manually Resolved"
msgstr "Manuell behoben"
#: AKModel/models.py:701
#: AKModel/models.py:778
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:805
#: AKModel/templates/admin/AKModel/requirements_overview.html:27
msgid "Details"
msgstr "Details"
#: AKModel/models.py:862
#: AKModel/models.py:939
msgid "Default Slot"
msgstr "Standardslot"
#: AKModel/models.py:867
#: AKModel/models.py:944
msgid "Slot End"
msgstr "Ende des Slots"
#: AKModel/models.py:867
#: AKModel/models.py:944
msgid "Time and date the slot ends"
msgstr "Zeit und Datum zu der der Slot endet"
#: AKModel/models.py:872
#: AKModel/models.py:949
msgid "Primary categories"
msgstr "Primäre Kategorien"
#: AKModel/models.py:873
#: AKModel/models.py:950
msgid "Categories that should be assigned to this slot primarily"
msgstr "Kategorieren, die diesem Slot primär zugewiesen werden sollen"
......@@ -953,19 +962,6 @@ msgstr "Bestätigen"
msgid "Cancel"
msgstr "Abbrechen"
#: AKModel/templates/admin/AKModel/aks_by_user.html:8
msgid "AKs by Owner"
msgstr "AKs der Leitung"
#: AKModel/templates/admin/AKModel/aks_by_user.html:26
#: AKModel/templates/admin/AKModel/requirements_overview.html:31
msgid "Edit"
msgstr "Bearbeiten"
#: AKModel/templates/admin/AKModel/aks_by_user.html:33
msgid "This user does not have any AKs currently"
msgstr "Diese Leitung hat aktuell keine AKs"
#: AKModel/templates/admin/AKModel/event_wizard/activate.html:9
#: AKModel/templates/admin/AKModel/event_wizard/created_prepare_import.html:9
#: AKModel/templates/admin/AKModel/event_wizard/finish.html:9
......@@ -1032,12 +1028,16 @@ msgstr ""
msgid "Requirements Overview"
msgstr "Übersicht Anforderungen"
#: AKModel/templates/admin/AKModel/requirements_overview.html:31
msgid "Edit"
msgstr "Bearbeiten"
#: AKModel/templates/admin/AKModel/requirements_overview.html:38
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:186
msgid "Add Requirement"
msgstr "Anforderung hinzufügen"
......@@ -1090,7 +1090,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:108
msgid "Scheduling"
msgstr "Scheduling"
......@@ -1123,43 +1123,47 @@ msgstr "Login"
msgid "Register"
msgstr "Registrieren"
#: AKModel/views/ak.py:17
#: AKModel/views/ak.py:20
msgid "Requirements for Event"
msgstr "Anforderungen für das Event"
#: AKModel/views/ak.py:34
#: AKModel/views/ak.py:37
msgid "AK CSV Export"
msgstr "AK-CSV-Export"
#: AKModel/views/ak.py:48
#: AKModel/views/ak.py:50
msgid "AK JSON Export"
msgstr "AK-JSON-Export"
#: AKModel/views/ak.py:133
msgid "AK Wiki Export"
msgstr "AK-Wiki-Export"
#: AKModel/views/ak.py:59 AKModel/views/manage.py:53
#: AKModel/views/ak.py:144 AKModel/views/manage.py:53
msgid "Wishes"
msgstr "Wünsche"
#: AKModel/views/ak.py:71
#: AKModel/views/ak.py:156
msgid "Delete AK Orga Messages"
msgstr "AK-Organachrichten löschen"
#: AKModel/views/ak.py:89
#: AKModel/views/ak.py:174
msgid "AK Orga Messages successfully deleted"
msgstr "AK-Organachrichten erfolgreich gelöscht"
#: AKModel/views/ak.py:101
#: AKModel/views/ak.py:186
msgid "Interest of the following AKs will be set to not filled (-1):"
msgstr "Interesse an den folgenden AKs wird auf nicht ausgefüllt (-1) gesetzt:"
#: AKModel/views/ak.py:102
#: AKModel/views/ak.py:187
msgid "Reset of interest in AKs successful."
msgstr "Interesse an AKs erfolgreich zurückgesetzt."
#: AKModel/views/ak.py:116
#: AKModel/views/ak.py:201
msgid "Interest counter of the following AKs will be set to 0:"
msgstr "Interessensbekundungszähler der folgenden AKs wird auf 0 gesetzt:"
#: AKModel/views/ak.py:117
#: AKModel/views/ak.py:202
msgid "AKs' interest counters set back to 0."
msgstr "Interessenszähler der AKs zurückgesetzt"
......@@ -1173,7 +1177,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:153
msgid "Export AK Slides"
msgstr "AK-Folien exportieren"
......@@ -1241,7 +1245,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:129
msgid "Edit Default Slots"
msgstr "Standardslots bearbeiten"
......@@ -1257,12 +1261,16 @@ msgid "Updated {u} slot(s). created {c} new slot(s) and deleted {d} slot(s)"
msgstr ""
"{u} Slot(s) aktualisiert, {c} Slot(s) hinzugefügt und {d} Slot(s) gelöscht"
#: AKModel/views/manage.py:252
msgid "AK JSON Import"
msgstr "AK-JSON-Import"
#: AKModel/views/room.py:37
#, python-format
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:81
msgid "Import Rooms from CSV"
msgstr "Räume aus CSV importieren"
......@@ -1280,50 +1288,64 @@ 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:115
msgid "AKs requiring special attention"
msgstr "AKs, die besondere Aufmerksamkeit benötigen"
#: AKModel/views/status.py:122
#: AKModel/views/status.py:121
msgid "Enter Interest"
msgstr "Interesse erfassen"
#: AKModel/views/status.py:134
#: AKModel/views/status.py:133
msgid "Manage ak tracks"
msgstr "AK-Tracks verwalten"
#: AKModel/views/status.py:138
#: AKModel/views/status.py:137
msgid "Import AK schedule from JSON"
msgstr "AK-Plan aus JSON importieren"
#: AKModel/views/status.py:141
msgid "Export AKs as CSV"
msgstr "AKs als CSV exportieren"
#: AKModel/views/status.py:142
#: AKModel/views/status.py:145
msgid "Export AKs as JSON"
msgstr "AKs als JSON exportieren"
#: AKModel/views/status.py:149
msgid "Export AKs for Wiki"
msgstr "AKs im Wiki-Format exportieren"
#: AKModel/views/status.py:175
#: AKModel/views/status.py:182
msgid "Show AKs for requirements"
msgstr "Zu Anforderungen gehörige AKs anzeigen"
#: AKModel/views/status.py:189
#: AKModel/views/status.py:196
msgid "Event Status"
msgstr "Eventstatus"
#~ msgid "AKs by Owner"
#~ msgstr "AKs der Leitung"
#~ msgid "This user does not have any AKs currently"
#~ msgstr "Diese Leitung hat aktuell keine AKs"
#~ msgid "Opening time for expression of interest."
#~ msgstr "Öffnungszeitpunkt für die Angabe von Interesse an AKs."
......
import itertools
import json
from datetime import timedelta
from django.db import models
......@@ -162,6 +163,66 @@ class Event(models.Model):
.filter(availabilities__count=0, owners__count__gt=0)
)
def time_slots(self, *, slots_in_an_hour=1.0):
from AKModel.availability.models import Availability
rooms = Room.objects.filter(event=self)
slot_duration = timedelta(hours=(1.0 / slots_in_an_hour))
slot_index = 0
current_slot = self.start
current_block = []
previous_slot = None
room_availabilities = list({availability
for room in rooms
for availability in room.availabilities.all()})
while current_slot < self.end:
slot = Availability(event=self,
start=current_slot,
end=current_slot + slot_duration)
if any((availability.contains(slot)
for availability in room_availabilities)):
if previous_slot is not None and previous_slot + slot_duration < current_slot:
yield current_block
current_block = []
current_block.append(slot_index)
previous_slot = current_slot
slot_index += 1
current_slot += slot_duration
yield current_block
def time_slot(self, *, time_slot_index, slots_in_an_hour=1.0):
from AKModel.availability.models import Availability
slot_duration = timedelta(hours=(1.0 / slots_in_an_hour))
start = self.start + time_slot_index * slot_duration
return Availability(event=self,
start=start,
end=start + slot_duration)
def schedule_from_json(self, schedule):
schedule = json.loads(schedule)
slots_in_an_hour = schedule["input"]["timeslots"]["info"]["duration"]
for scheduled_slot in schedule["scheduled_aks"]:
slot = AKSlot.objects.get(scheduled_slot["ak_id"])
slot.room = scheduled_slot["room_id"]
start = min(scheduled_slot["time_slot_ids"])
end = max(scheduled_slot["time_slot_ids"])
slot.start = self.time_slot(time_slot_index=start,
slots_in_an_hour=slots_in_an_hour)
slot.end = self.time_slot(time_slot_index=end + 1,
slots_in_an_hour=slots_in_an_hour)
class AKOwner(models.Model):
""" An AKOwner describes the person organizing/holding an AK.
......@@ -513,6 +574,29 @@ class Room(models.Model):
def __str__(self):
return self.title
def as_json(self) -> str:
from AKModel.availability.models import Availability
# check if room is available for the whole event
# -> no time constraint needs to be introduced
if Availability.is_event_covered(self.event, self.availabilities.all()):
time_constraints = []
else:
time_constraints = [f"availability-room-{self.pk}"]
data = {
"id": self.pk,
"info": {
"name": self.name,
},
"capacity": self.capacity,
"fulfilled_room_constraints": [constraint.name
for constraint in self.properties.all()],
"time_constraints": time_constraints
}
return json.dumps(data)
class AKSlot(models.Model):
""" An AK Mapping matches an AK to a room during a certain time.
......@@ -608,6 +692,44 @@ class AKSlot(models.Model):
self.duration = min(self.duration, event_duration_hours)
super().save(force_insert, force_update, using, update_fields)
def as_json(self) -> str:
from AKModel.availability.models import Availability
# check if ak resp. owner is available for the whole event
# -> no time constraint needs to be introduced
if not self.fixed and Availability.is_event_covered(self.event, self.ak.availabilities.all()):
ak_time_constraints = []
else:
ak_time_constraints = [f"availability-ak-{self.ak.pk}"]
def _owner_time_constraints(owner: AKOwner):
if Availability.is_event_covered(self.event, owner.availabilities.all()):
return []
else:
return [f"availability-person-{owner.pk}"]
data = {
"id": self.pk,
"duration": int(self.duration * self.slots_in_an_hour),
"properties": {},
"room_constraints": [constraint.name
for constraint in self.ak.requirements.all()],
"time_constraints": ["resolution"] if self.ak.reso else [],
"info": {
"name": self.ak.name,
"head": ", ".join([str(owner)
for owner in self.ak.owners.all()]),
"description": self.ak.description,
"reso": self.ak.reso,
},
}
data["time_constraints"].extend(ak_time_constraints)
for owner in self.ak.owners.all():
data["time_constraints"].extend(_owner_time_constraints(owner))
return json.dumps(data)
class AKOrgaMessage(models.Model):
"""
......
{% extends "admin/base_site.html" %}
{% load tz %}
{% block content %}
<pre>
{"aks": [
{% for slot in slots %}{{ slot.as_json }}{% if not forloop.last %},
{% endif %}{% endfor %}
],
"rooms": [
{% for room in rooms %}{{ room.as_json }}{% if not forloop.last %},
{% endif %}{% endfor %}
],
"participants": {{ participants }},
"timeslots": {{ timeslots }}
}
</pre>
{% endblock %}
......@@ -5,8 +5,9 @@ from rest_framework.routers import DefaultRouter
import AKModel.views.api
from AKModel.views.manage import ExportSlidesView, PlanPublishView, PlanUnpublishView, DefaultSlotEditorView, \
AKsByUserView
from AKModel.views.ak import AKRequirementOverview, AKCSVExportView, AKWikiExportView, AKMessageDeleteView
AKsByUserView, AKJSONImportView
from AKModel.views.ak import AKRequirementOverview, AKCSVExportView, AKJSONExportView, AKWikiExportView, \
AKMessageDeleteView
from AKModel.views.event_wizard import NewEventWizardStartView, NewEventWizardPrepareImportView, \
NewEventWizardImportView, NewEventWizardActivateView, NewEventWizardFinishView, NewEventWizardSettingsView
from AKModel.views.room import RoomBatchCreationView
......@@ -96,6 +97,10 @@ def get_admin_urls_event(admin_site):
name="aks_by_owner"),
path('<slug:event_slug>/ak-csv-export/', admin_site.admin_view(AKCSVExportView.as_view()),
name="ak_csv_export"),
path('<slug:event_slug>/ak-json-export/', admin_site.admin_view(AKJSONExportView.as_view()),
name="ak_json_export"),
path('<slug:event_slug>/ak-json-import/', admin_site.admin_view(AKJSONImportView.as_view()),
name="ak_json_import"),
path('<slug:slug>/ak-wiki-export/', admin_site.admin_view(AKWikiExportView.as_view()),
name="ak_wiki_export"),
path('<slug:event_slug>/delete-orga-messages/', admin_site.admin_view(AKMessageDeleteView.as_view()),
......
import json
from datetime import timedelta
from typing import List
from django.contrib import messages
from django.urls import reverse_lazy
from django.utils.translation import gettext_lazy as _
......@@ -5,7 +9,7 @@ from django.views.generic import ListView, DetailView
from AKModel.metaviews.admin import AdminViewMixin, FilterByEventSlugMixin, EventSlugMixin, IntermediateAdminView, \
IntermediateAdminActionView
from AKModel.models import AKRequirement, AKSlot, Event, AKOrgaMessage, AK
from AKModel.models import AKRequirement, AKSlot, Event, AKOrgaMessage, AK, Room, AKOwner
class AKRequirementOverview(AdminViewMixin, FilterByEventSlugMixin, ListView):
......@@ -37,6 +41,111 @@ class AKCSVExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
return super().get_queryset().order_by("ak__track")
class AKJSONExportView(AdminViewMixin, FilterByEventSlugMixin, ListView):
"""
View: Export all AK slots of this event in JSON format ordered by tracks
"""
template_name = "admin/AKModel/ak_json_export.html"
model = AKSlot
context_object_name = "slots"
title = _("AK JSON Export")
def get_queryset(self):
return super().get_queryset().order_by("ak__track")
def get_context_data(self, **kwargs):
from AKModel.availability.models import Availability
SLOTS_IN_AN_HOUR = 1
rooms = Room.objects.filter(event=self.event)
participants = []
timeslots = {
"info": {"duration": (1.0 / SLOTS_IN_AN_HOUR), },
"blocks": [],
}
context = super().get_context_data(**kwargs)
context["rooms"] = rooms
context["participants"] = json.dumps(participants)
for slot in context["slots"]:
slot.slots_in_an_hour = SLOTS_IN_AN_HOUR
ak_availabilities = {
slot.ak.pk: Availability.union(slot.ak.availabilities.all())
for slot in context["slots"]
}
room_availabilities = {
room.pk: Availability.union(room.availabilities.all())
for room in rooms
}
person_availabilities = {
person.pk: Availability.union(person.availabilities.all())
for person in AKOwner.objects.filter(event=self.event)
}
ak_fixed = {
ak: values.get()
for ak in ak_availabilities.keys()
if (values := AKSlot.objects.select_related().filter(ak__pk=ak, fixed=True)).exists()
}
def _test_slot_contained(slot: Availability, availabilities: List[Availability]) -> bool:
return any(availability.contains(slot) for availability in availabilities)
def _test_event_covered(slot: Availability, availabilities: List[Availability]) -> bool:
return not Availability.is_event_covered(self.event, availabilities)
def _test_fixed_ak(ak, slot) -> bool:
if not ak in ak_fixed:
return False
fixed_slot = Availability(self.event, start=ak_fixed[ak].start, end=ak_fixed[ak].end)
return fixed_slot.overlaps(slot, strict=True)
def _test_add_constraint(slot: Availability, availabilities: List[Availability]) -> bool:
return _test_event_covered(slot, availabilities) and _test_slot_contained(slot, availabilities)
for block in self.event.time_slots(slots_in_an_hour=SLOTS_IN_AN_HOUR):
current_block = []
for slot_index in block:
slot = self.event.time_slot(time_slot_index=slot_index,
slots_in_an_hour=SLOTS_IN_AN_HOUR)
constraints = []
if self.event.reso_deadline is None or slot.end < self.event.reso_deadline:
constraints.append("resolution")
for ak, availabilities in ak_availabilities.items():
if _test_add_constraint(slot, availabilities) or _test_fixed_ak(ak, slot):
constraints.append(f"availability-ak-{ak}")
for person, availabilities in person_availabilities.items():
if _test_add_constraint(slot, availabilities):
constraints.append(f"availability-person-{person}")
for person, availabilities in room_availabilities.items():
if _test_add_constraint(slot, availabilities):
constraints.append(f"availability-room-{room}")
current_block.append({
"id": slot_index,
"info": {
"start": slot.simplified,
},
"fulfilled_time_constraints": constraints,
})
timeslots["blocks"].append(current_block)
context["timeslots"] = json.dumps(timeslots)
return context
class AKWikiExportView(AdminViewMixin, DetailView):
"""
View: Export AKs of this event in wiki syntax
......
......@@ -12,7 +12,7 @@ from django.views.generic import TemplateView, DetailView
from django_tex.core import render_template_with_context, run_tex_in_directory
from django_tex.response import PDFResponse
from AKModel.forms import SlideExportForm, DefaultSlotEditorForm
from AKModel.forms import SlideExportForm, DefaultSlotEditorForm, JSONImportForm
from AKModel.metaviews.admin import EventSlugMixin, IntermediateAdminView, IntermediateAdminActionView, AdminViewMixin
from AKModel.models import ConstraintViolation, Event, DefaultSlot, AKOwner
......@@ -245,3 +245,13 @@ class AKsByUserView(AdminViewMixin, EventSlugMixin, DetailView):
model = AKOwner
context_object_name = 'owner'
template_name = "admin/AKModel/aks_by_user.html"
class AKJSONImportView(EventSlugMixin, IntermediateAdminView):
form_class = JSONImportForm
title = _("AK JSON Import")
def form_valid(self, form):
self.event.schedule_from_json(form.data["json_data"])
return redirect("admin:event_status", self.event.slug)
......@@ -133,10 +133,18 @@ class EventAKsWidget(TemplateStatusWidget):
"text": _("Manage ak tracks"),
"url": reverse_lazy("admin:tracks_manage", kwargs={"event_slug": context["event"].slug}),
},
{
"text": _("Import AK schedule from JSON"),
"url": reverse_lazy("admin:ak_json_import", kwargs={"event_slug": context["event"].slug}),
},
{
"text": _("Export AKs as CSV"),
"url": reverse_lazy("admin:ak_csv_export", kwargs={"event_slug": context["event"].slug}),
},
{
"text": _("Export AKs as JSON"),
"url": reverse_lazy("admin:ak_json_export", kwargs={"event_slug": context["event"].slug}),
},
{
"text": _("Export AKs for Wiki"),
"url": reverse_lazy("admin:ak_wiki_export", kwargs={"slug": context["event"].slug}),
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-05-15 20:03+0200\n"
"POT-Creation-Date: 2024-05-27 01:57+0000\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"
......@@ -38,7 +38,7 @@ msgstr "Veranstaltung"
#: AKPlan/templates/AKPlan/plan_index.html:59
#: AKPlan/templates/AKPlan/plan_room.html:13
#: AKPlan/templates/AKPlan/plan_room.html:59
#: AKPlan/templates/AKPlan/plan_wall.html:65
#: AKPlan/templates/AKPlan/plan_wall.html:67
msgid "Room"
msgstr "Raum"
......@@ -63,12 +63,12 @@ msgid "AK Wall"
msgstr "AK-Wall"
#: AKPlan/templates/AKPlan/plan_index.html:130
#: AKPlan/templates/AKPlan/plan_wall.html:130
#: AKPlan/templates/AKPlan/plan_wall.html:132
msgid "Current AKs"
msgstr "Aktuelle AKs"
#: AKPlan/templates/AKPlan/plan_index.html:137
#: AKPlan/templates/AKPlan/plan_wall.html:135
#: AKPlan/templates/AKPlan/plan_wall.html:137
msgid "Next AKs"
msgstr "Nächste AKs"
......@@ -99,7 +99,7 @@ msgstr "Eigenschaften"
msgid "Track"
msgstr "Track"
#: AKPlan/templates/AKPlan/plan_wall.html:145
#: AKPlan/templates/AKPlan/plan_wall.html:147
msgid "Reload page automatically?"
msgstr "Seite automatisch neu laden?"
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-16 16:30+0200\n"
"POT-Creation-Date: 2024-05-27 01:57+0000\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,10 +17,10 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: AKPlanning/settings.py:148
#: AKPlanning/settings.py:147
msgid "German"
msgstr "Deutsch"
#: AKPlanning/settings.py:149
#: AKPlanning/settings.py:148
msgid "English"
msgstr "Englisch"
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-08-16 16:30+0200\n"
"POT-Creation-Date: 2024-05-27 01:57+0000\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:93
#: AKSubmission/forms.py:95
#, python-format
msgid "\"%(duration)s\" is not a valid duration"
msgstr "\"%(duration)s\" ist keine gültige Dauer"
#: AKSubmission/forms.py:159
#: AKSubmission/forms.py:155
msgid "Duration(s)"
msgstr "Dauer(n)"
#: AKSubmission/forms.py:161
#: AKSubmission/forms.py:157
msgid ""
"Enter at least one planned duration (in hours). If your AK should have "
"multiple slots, use multiple lines"
......