Note location or time change on events page
This commit is contained in:
parent
f2bd247e21
commit
9f20eaa2e1
@ -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, ,
|
||||
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, ,
|
||||
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,
|
||||
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,
|
||||
|
|
21
prep.py
21
prep.py
@ -30,16 +30,15 @@ def load_events(csv_path:str) -> list[dict]:
|
||||
event_location = event[2]
|
||||
event_title = event[3]
|
||||
types = event[4].split()
|
||||
try:
|
||||
link = event[5]
|
||||
except IndexError:
|
||||
link = ""
|
||||
changed = event[6]
|
||||
current_event = {"date":event_date_parsed,
|
||||
"time":event_time,
|
||||
"location": event_location,
|
||||
"title":event_title.strip(),
|
||||
"types": types,
|
||||
"link": link}
|
||||
"link": link,
|
||||
"changed": changed.strip()}
|
||||
events.append(current_event)
|
||||
return events
|
||||
|
||||
@ -51,17 +50,25 @@ def build_html(events: list[dict], dayNames: list[str], typesNames: dict) -> str
|
||||
date = event["date"]
|
||||
date = dayNames[date.weekday()]+", "+str(date.day)+". "+str(date.month)+". "+str(date.year)+", "
|
||||
time = event["time"]+"h"
|
||||
changed = event["changed"]
|
||||
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"] != "":
|
||||
event_html.append(f"<div class='title'><a href=\"{event['link']}\">{title}</a></div>")
|
||||
else:
|
||||
event_html.append(f"<div class='title'>{title}</div>")
|
||||
if "https://" in location:
|
||||
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:
|
||||
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:
|
||||
types_list = "<div class='types'>"
|
||||
|
@ -41,6 +41,10 @@
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.changed, .changed a {
|
||||
color: #965959;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1160px) {
|
||||
.event {
|
||||
flex-direction: column;
|
||||
|
Loading…
Reference in New Issue
Block a user