diff --git a/app.py b/app.py index b5e7b2d..518c0d0 100755 --- a/app.py +++ b/app.py @@ -32,6 +32,17 @@ def sort_date_from_string(date_string): return datetime.now() +def is_future_date(date_string): + try: + start_date = datetime.strptime(date_string.split('-')[0].strip(), "%d.%m.%Y") + if start_date < datetime.now(): + return False + except Exception: + pass + + return True + + # create app app = Flask(__name__) app.config['FLATPAGES_PAGES_EXTENSION'] = '.md' @@ -65,7 +76,7 @@ def verein(): @app.route('/events.html') def view_events(): - posts = [p for p in events if "date" in p.meta] + posts = [p for p in events if "date" in p.meta and is_future_date(p.meta["date"])] sorted_events = sorted(posts, reverse=False, key=lambda event: sort_date_from_string(event.meta["date"])) return render_template('events.html', events=sorted_events) diff --git a/events/mff2022.md b/events/mff2022.md index c0282fd..c3ef659 100644 --- a/events/mff2022.md +++ b/events/mff2022.md @@ -2,10 +2,10 @@ title: Metal Franconia date: 08.04.2022 - 09.04.2022 author: Markus event: Festival -location: Frankenhalle Dettelbach +location: Musichall Geiselwind link: https://sw.metal-franconia.de pic: -description: Das fraenggische Fesdivael in Dettelbach. Ehrensache für die FdgL. -attending: Skeletor, Dieter, Merry +description: Das fraenggische Fesdivael, diesmal in der Musichall in Geiselwind. Ehrensache für die FdgL. +attending: Skeletor, Dieter, Merry, Siffi, Frau Dark, Schneebi, Sherman, Markus, Anja, Felix, Elisabeth, Albert, Benni, Janina, Flux, ... -Das fränggische Fesdiväl in Dettelbach. Ehrensache für die FdgL. \ No newline at end of file +Das fränggische Fesdiväl, diesmal in Geiselwind. Ehrensache für die FdgL. \ No newline at end of file diff --git a/events/paradise2021.md b/events/paradise2022.md similarity index 92% rename from events/paradise2021.md rename to events/paradise2022.md index 5ffac3f..0afd058 100644 --- a/events/paradise2021.md +++ b/events/paradise2022.md @@ -1,5 +1,5 @@ title: Metal Hammer Paradise -date: 12.11.2021 - 13.11.2021 +date: 18.11.2022 - 19.11.2022 author: Markus event: Festival location: Ferienpark Weissenhäuser Strand diff --git a/events/partysan2022.md b/events/partysan2022.md new file mode 100644 index 0000000..7914ff4 --- /dev/null +++ b/events/partysan2022.md @@ -0,0 +1,11 @@ +title: PartySan Metal Open Air +date: 11.08.2022 - 13.08.2022 +author: Markus +event: Festival +location: Flugplatz Obermehla +link: https://www.party-san.de/news +pic: /static/img/events/psoa_2022.png +description: Extrem-Metal Festival. Extrem gut. Hier sind auch die Forcler aus Erlangen anzutreffen. +attending: Dieter, Merry, Johannes, Ramona, Michi, Steffi + +Extrem-Metal Festival. Extrem gut. Hier sind auch die Forcler aus Erlangen anzutreffen. \ No newline at end of file diff --git a/static/img/events/psoa_2022.png b/static/img/events/psoa_2022.png new file mode 100644 index 0000000..0fcd8db Binary files /dev/null and b/static/img/events/psoa_2022.png differ