Force specific room sequence
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
9544af57f3
commit
38af4168f1
|
@ -7,6 +7,7 @@ from urllib.request import urlopen
|
|||
from zoneinfo import ZoneInfo
|
||||
|
||||
GRANULARITY = 30
|
||||
ROOM_SEQUENCE = ('Sondermaschinenbau', 'Smart City Schmiede', 'Sofaecke', 'CTF')
|
||||
SCHEDULE_URL = 'https://cfp.fairydust.reisen/iger-2022/schedule/export/schedule.json'
|
||||
TIMEZONE = 'Europe/Berlin'
|
||||
|
||||
|
@ -18,6 +19,12 @@ def parse_duration(s, num_parts):
|
|||
|
||||
return duration
|
||||
|
||||
def room_sequence_key(room):
|
||||
try:
|
||||
return ROOM_SEQUENCE.index(room)
|
||||
except ValueError:
|
||||
return len(ROOM_SEQUENCE)
|
||||
|
||||
def main():
|
||||
with urlopen(SCHEDULE_URL) as f:
|
||||
data = loads(f.read())
|
||||
|
@ -71,6 +78,7 @@ def main():
|
|||
'title': event['title'],
|
||||
'url': event['url'],
|
||||
} for event in events] for name, events in rooms.items()},
|
||||
'room_sequence': sorted(rooms.keys(), key=room_sequence_key),
|
||||
'span': GRANULARITY // timeslot,
|
||||
'start_date': start_date.isoformat(timespec='seconds'),
|
||||
'timeline': timeline,
|
||||
|
|
|
@ -26,10 +26,11 @@
|
|||
{{ $lastDate = .date }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ range $name, $events := .rooms }}
|
||||
{{ $rooms := .rooms }}
|
||||
{{ range .room_sequence }}
|
||||
<div class="schedule-grid schedule-room">
|
||||
<h3 class="schedule-title">{{ $name }}</h3>
|
||||
{{ range $events }}
|
||||
<h3 class="schedule-title">{{ . }}</h3>
|
||||
{{ range index $rooms . }}
|
||||
<a class="schedule-event" href="{{ .url }}" style="--start: {{ .start }};--end: {{ .end }}" target="_blank">
|
||||
<div class="schedule-event-time">
|
||||
<span>{{ .start_time }}</span>
|
||||
|
|
Loading…
Reference in New Issue