Force specific room sequence
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Luca 2022-08-29 19:52:57 +02:00
parent 9544af57f3
commit 38af4168f1
2 changed files with 12 additions and 3 deletions

View File

@ -7,6 +7,7 @@ from urllib.request import urlopen
from zoneinfo import ZoneInfo from zoneinfo import ZoneInfo
GRANULARITY = 30 GRANULARITY = 30
ROOM_SEQUENCE = ('Sondermaschinenbau', 'Smart City Schmiede', 'Sofaecke', 'CTF')
SCHEDULE_URL = 'https://cfp.fairydust.reisen/iger-2022/schedule/export/schedule.json' SCHEDULE_URL = 'https://cfp.fairydust.reisen/iger-2022/schedule/export/schedule.json'
TIMEZONE = 'Europe/Berlin' TIMEZONE = 'Europe/Berlin'
@ -18,6 +19,12 @@ def parse_duration(s, num_parts):
return duration return duration
def room_sequence_key(room):
try:
return ROOM_SEQUENCE.index(room)
except ValueError:
return len(ROOM_SEQUENCE)
def main(): def main():
with urlopen(SCHEDULE_URL) as f: with urlopen(SCHEDULE_URL) as f:
data = loads(f.read()) data = loads(f.read())
@ -71,6 +78,7 @@ def main():
'title': event['title'], 'title': event['title'],
'url': event['url'], 'url': event['url'],
} for event in events] for name, events in rooms.items()}, } for event in events] for name, events in rooms.items()},
'room_sequence': sorted(rooms.keys(), key=room_sequence_key),
'span': GRANULARITY // timeslot, 'span': GRANULARITY // timeslot,
'start_date': start_date.isoformat(timespec='seconds'), 'start_date': start_date.isoformat(timespec='seconds'),
'timeline': timeline, 'timeline': timeline,

View File

@ -26,10 +26,11 @@
{{ $lastDate = .date }} {{ $lastDate = .date }}
{{ end }} {{ end }}
</div> </div>
{{ range $name, $events := .rooms }} {{ $rooms := .rooms }}
{{ range .room_sequence }}
<div class="schedule-grid schedule-room"> <div class="schedule-grid schedule-room">
<h3 class="schedule-title">{{ $name }}</h3> <h3 class="schedule-title">{{ . }}</h3>
{{ range $events }} {{ range index $rooms . }}
<a class="schedule-event" href="{{ .url }}" style="--start: {{ .start }};--end: {{ .end }}" target="_blank"> <a class="schedule-event" href="{{ .url }}" style="--start: {{ .start }};--end: {{ .end }}" target="_blank">
<div class="schedule-event-time"> <div class="schedule-event-time">
<span>{{ .start_time }}</span> <span>{{ .start_time }}</span>