Note location or time change on events page

This commit is contained in:
Hugo 2024-12-06 16:26:14 +01:00
parent f2bd247e21
commit 9f20eaa2e1
3 changed files with 20 additions and 9 deletions

View File

@ -213,7 +213,7 @@ datum, vreme, lokacija, tema, tip, link, changed
04-12-2024, 18:00, Matematički fakultet (Učionica 153) https://www.openstreetmap.org/node/12291697569, OpenGL šejderi #2: SDF renderovanje, lecture, , 04-12-2024, 18:00, Matematički fakultet (Učionica 153) https://www.openstreetmap.org/node/12291697569, OpenGL šejderi #2: SDF renderovanje, lecture, ,
09-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ne treba nam (toliko) Javascript, lecture, , 09-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ne treba nam (toliko) Javascript, lecture, ,
10-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Creating Interactive Fiction with TADS (en), lecture, , 10-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Creating Interactive Fiction with TADS (en), lecture, ,
11-12-2024, 18:00, DC Krov https://www.openstreetmap.org/node/10594728522, OpenGL šejderi #3: Kompleksna analiza, lecture, , 11-12-2024, 18:00, DC Krov https://www.openstreetmap.org/node/10594728522, OpenGL šejderi #3: Kompleksna analiza, lecture, , location
16-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softverski hakaton, hack, https://wiki.dmz.rs/decentrala/dogadjaji/hakaton, 16-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softverski hakaton, hack, https://wiki.dmz.rs/decentrala/dogadjaji/hakaton,
17-12-2024, 18:00, DC Krov https://www.openstreetmap.org/node/10594728522, Verifiable Computing Project - Truly Open Source Hardware (en), lecture, https://forum.dmz.rs/t/plan-za-decembar-2024/815/29, 17-12-2024, 18:00, DC Krov https://www.openstreetmap.org/node/10594728522, Verifiable Computing Project - Truly Open Source Hardware (en), lecture, https://forum.dmz.rs/t/plan-za-decembar-2024/815/29,
17-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack, https://forum.dmz.rs/t/hardware-hackathon-novembar/832, 17-12-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack, https://forum.dmz.rs/t/hardware-hackathon-novembar/832,

1 datum vreme lokacija tema tip link changed
213 04-12-2024 18:00 Matematički fakultet (Učionica 153) https://www.openstreetmap.org/node/12291697569 OpenGL šejderi #2: SDF renderovanje lecture
214 09-12-2024 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Ne treba nam (toliko) Javascript lecture
215 10-12-2024 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Creating Interactive Fiction with TADS (en) lecture
216 11-12-2024 18:00 DC Krov https://www.openstreetmap.org/node/10594728522 OpenGL šejderi #3: Kompleksna analiza lecture location
217 16-12-2024 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Softverski hakaton hack https://wiki.dmz.rs/decentrala/dogadjaji/hakaton
218 17-12-2024 18:00 DC Krov https://www.openstreetmap.org/node/10594728522 Verifiable Computing Project - Truly Open Source Hardware (en) lecture https://forum.dmz.rs/t/plan-za-decembar-2024/815/29
219 17-12-2024 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Hardverski hakaton hack https://forum.dmz.rs/t/hardware-hackathon-novembar/832

21
prep.py
View File

@ -30,16 +30,15 @@ def load_events(csv_path:str) -> list[dict]:
event_location = event[2] event_location = event[2]
event_title = event[3] event_title = event[3]
types = event[4].split() types = event[4].split()
try:
link = event[5] link = event[5]
except IndexError: changed = event[6]
link = ""
current_event = {"date":event_date_parsed, current_event = {"date":event_date_parsed,
"time":event_time, "time":event_time,
"location": event_location, "location": event_location,
"title":event_title.strip(), "title":event_title.strip(),
"types": types, "types": types,
"link": link} "link": link,
"changed": changed.strip()}
events.append(current_event) events.append(current_event)
return events return events
@ -51,17 +50,25 @@ def build_html(events: list[dict], dayNames: list[str], typesNames: dict) -> str
date = event["date"] date = event["date"]
date = dayNames[date.weekday()]+", "+str(date.day)+". "+str(date.month)+". "+str(date.year)+", " date = dayNames[date.weekday()]+", "+str(date.day)+". "+str(date.month)+". "+str(date.year)+", "
time = event["time"]+"h" time = event["time"]+"h"
changed = event["changed"]
event_html = [] event_html = []
event_html.append(f"<div class='date'>{date} {time}</div>")
timeChanged = changed == "time" or changed == "date"
locationChanged = changed == "location"
event_html.append(f"<div class='date {"changed" if timeChanged else ""}'>{date} {time}</div>")
if event["link"] != "": if event["link"] != "":
event_html.append(f"<div class='title'><a href=\"{event['link']}\">{title}</a></div>") event_html.append(f"<div class='title'><a href=\"{event['link']}\">{title}</a></div>")
else: else:
event_html.append(f"<div class='title'>{title}</div>") event_html.append(f"<div class='title'>{title}</div>")
if "https://" in location: if "https://" in location:
place,link = location.split("https://") place,link = location.split("https://")
event_html.append(f"<div class='place'><a href=\"https://{link}\">@{place.strip()}</a></div>") event_html.append(f"<div class='place {"changed" if locationChanged else ""}'><a href=\"https://{link}\">@{place.strip()}</a></div>")
else: else:
event_html.append(f"<div class='place'>@{location.strip()}</div>") event_html.append(f"<div class='place {"changed" if locationChanged else ""}'>@{location.strip()}</div>")
if changed != "":
event_html.append("<div class ='changedMark'></div>")
if len(event["types"]) != 0: if len(event["types"]) != 0:
types_list = "<div class='types'>" types_list = "<div class='types'>"

View File

@ -41,6 +41,10 @@
font-style: italic; font-style: italic;
} }
.changed, .changed a {
color: #965959;
}
@media screen and (max-width: 1160px) { @media screen and (max-width: 1160px) {
.event { .event {
flex-direction: column; flex-direction: column;