diff --git a/dogadjaji.csv b/dogadjaji.csv index c8f3de1b..33f8a59b 100644 --- a/dogadjaji.csv +++ b/dogadjaji.csv @@ -1,4 +1,4 @@ -datum, vreme, lokacija, tema, tip, +datum, vreme, lokacija, tema, tip, link 20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreže, , 03-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hackathon žurka, hack, 16-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Privatnost na internetu, workshop, @@ -162,7 +162,7 @@ datum, vreme, lokacija, tema, tip, 09-07-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton, hack, 12-07-2024, 15:00, KC Gnezdo https://osm.org/go/xftd8rbl2, Uticaj tehnologije na kulturu, lecture, 14-07-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Napadi na vestacku inteligenciju, lecture discussion -29-07-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, OnionShare, lecture +29-07-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, OnionShare, lecture, https://forum.dmz.rs/t/plan-za-jul-2024/612/17?u=mkevac 30-07-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, CryptoPals #1, workshop 15-08-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, GETÖSEFÖHN, music 15-09-2024, 12:00, KC Magacin https://www.openstreetmap.org/node/1226456745#map=19/44.81314/20.45378, Dekonferencija, conference, diff --git a/prep.py b/prep.py index eae1c337..2c4929d0 100755 --- a/prep.py +++ b/prep.py @@ -29,11 +29,16 @@ 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 = "" current_event = {"date":event_date_parsed, "time":event_time, "location": event_location, "title":event_title.strip(), - "types": types } + "types": types, + "link": link} events.append(current_event) return events @@ -47,7 +52,10 @@ def build_html(events: list[dict], dayNames: list[str], typesNames: dict) -> str time = event["time"]+"h" event_html = [] event_html.append(f"
{date} {time}
") - event_html.append(f"
{title}
") + if event["link"] != "": + event_html.append(f"
{title}
") + else: + event_html.append(f"
{title}
") if "https://" in location: place,link = location.split("https://") event_html.append(f"
@{place.strip()}
")