diff --git a/app.py b/app.py index 0add273..b5e7b2d 100755 --- a/app.py +++ b/app.py @@ -25,17 +25,30 @@ def format_date_string(date_string): return date.strftime("%d. %B %Y") +def sort_date_from_string(date_string): + try: + return datetime.strptime(date_string.split('-')[0].strip(), "%d.%m.%Y") + except Exception: + return datetime.now() + + # create app app = Flask(__name__) -app.config['FLATPAGES_EXTENSION'] = '.md' -app.config['FLATPAGES_HTML_RENDERER'] = markdown_with_jinja_renderer +app.config['FLATPAGES_PAGES_EXTENSION'] = '.md' +app.config['FLATPAGES_PAGES_HTML_RENDERER'] = markdown_with_jinja_renderer + +app.config['FLATPAGES_EVENTS_EXTENSION'] = '.md' +app.config['FLATPAGES_EVENTS_HTML_RENDERER'] = markdown_with_jinja_renderer +app.config['FLATPAGES_EVENTS_ROOT'] = 'events' + app.config['FONTAWESOME_STYLES'] = ['solid', 'brands'] # register fotogrid with jinja app.jinja_env.globals.update(fotogrid=fotogrid) app.jinja_env.globals.update(format_date_string=format_date_string) -pages = FlatPages(app) +pages = FlatPages(app, name="pages") +events = FlatPages(app, name="events") fa = FontAwesome(app) @@ -50,6 +63,14 @@ def verein(): return render_template('verein.html') +@app.route('/events.html') +def view_events(): + posts = [p for p in events if "date" in p.meta] + sorted_events = sorted(posts, reverse=False, key=lambda event: + sort_date_from_string(event.meta["date"])) + return render_template('events.html', events=sorted_events) + + @app.route('/kontakt.html') def kontakt(): return render_template('kontakt.html') @@ -70,7 +91,7 @@ def impressum(): def index(): posts = [p for p in pages if "date" in p.meta] sorted_pages = sorted(posts, reverse=True, key=lambda page: - datetime.strptime(page.meta["date"], "%d.%m.%Y")) + sort_date_from_string(page.meta["date"])) return render_template('index.html', pages=sorted_pages) diff --git a/events/breeze2021.md b/events/breeze2021.md new file mode 100644 index 0000000..33dfe63 --- /dev/null +++ b/events/breeze2021.md @@ -0,0 +1,11 @@ +title: Summerbreeze +date: 18.08.2021 - 21.08.2021 +author: Markus +event: Festival +location: Dinkelsbühl +link: https://www.summer-breeze.de +pic: https://www.summer-breeze.de/wp-content/themes/summer-breeze-2021/assets/year-600.jpg +description: Summerbreeze +attending: Merry, Dieter, Ramona, Johannes, Loki, Skeletor, Anja, Markus + +Das Summerbreeze in Dinkelsbühl ist schon eine richtige FdgL-Institution \ No newline at end of file diff --git a/events/christmasbash2021.md b/events/christmasbash2021.md new file mode 100644 index 0000000..a1317f0 --- /dev/null +++ b/events/christmasbash2021.md @@ -0,0 +1,11 @@ +title: Christmas Bash +date: 03.12.2021 - 04.12.2021 +author: Markus +event: Festival +location: Eventzentrum Strohofer, Geiselwind +link: https://www.christmasbash.de +pic: https://www.christmasbash.de/images/2020/CMB21_Logo_600.png +description: The Return of the Bashman +attending: Anja, Markus + +Das Winterfestival in Franken, jedes Jahr im Dezember. \ No newline at end of file diff --git a/events/growl2021.md b/events/growl2021.md new file mode 100644 index 0000000..f8236f5 --- /dev/null +++ b/events/growl2021.md @@ -0,0 +1,14 @@ +title: Growl-Workshop mit Britta +date: sobald es wieder geht +author: Markus +event: Workshop +fdglevent: ja +location: +link: +pic: +description: Lernt Growlen, Screamen, Grunten wie die Großen! +attending: Britta Görtz + +Der erste [Growl-Workshop](/growl-workshop.html) war ein voller Erfolg und wir +werden dies auf jeden Fall zusammen mit Britta wiederholen, sobald es möglich +wird. \ No newline at end of file diff --git a/events/mff2022.md b/events/mff2022.md new file mode 100644 index 0000000..c0282fd --- /dev/null +++ b/events/mff2022.md @@ -0,0 +1,11 @@ +title: Metal Franconia +date: 08.04.2022 - 09.04.2022 +author: Markus +event: Festival +location: Frankenhalle Dettelbach +link: https://sw.metal-franconia.de +pic: +description: Das fraenggische Fesdivael in Dettelbach. Ehrensache für die FdgL. +attending: Skeletor, Dieter, Merry + +Das fränggische Fesdiväl in Dettelbach. Ehrensache für die FdgL. \ No newline at end of file diff --git a/events/muf2022.md b/events/muf2022.md new file mode 100644 index 0000000..b157e37 --- /dev/null +++ b/events/muf2022.md @@ -0,0 +1,12 @@ +title: Metal United Festival +date: 06.08.2022 - 07.08.2022 +author: Markus +event: Festival +location: Eventhalle Airport Obertraubling +link: http://www.metalunited.de +pic: +description: Das Metal United Festival in Regensburg in familiärer Athmosphäre. +attending: + +Auch das Metal United in Obertraubling bei Regensburg musste auf 2022 +verschoben werden. \ No newline at end of file diff --git a/events/muflight2021.md b/events/muflight2021.md new file mode 100644 index 0000000..a23255b --- /dev/null +++ b/events/muflight2021.md @@ -0,0 +1,13 @@ +title: Metal United Festival — Light +date: 06.08.2021 - 07.08.2021 +author: Markus +event: Festival +location: Eventhalle Airport Obertraubling +link: http://www.metalunited.de +pic: +description: Leider müssen wir das Hauptfestival aufgrund der anhaltenden Corona-Pandemie erneut um ein Jahr verschieben. +attending: + +Da das Hauptfestival erneut um ein Jahr verschoben werden muss, findet dieses +Jahr eine "Light" Version unter Coronabedingungen statt, damit der +Festivalsommer nicht ganz entfallen muss. \ No newline at end of file diff --git a/events/paradise2021.md b/events/paradise2021.md new file mode 100644 index 0000000..b280a9f --- /dev/null +++ b/events/paradise2021.md @@ -0,0 +1,12 @@ +title: Metal Hammer Paradise +date: 12.11.2021 - 13.11.2021 +author: Markus +event: Festival +location: Ferienpark Weissenhäuser Strand +link: https://www.metal-hammer-paradise.de +pic: /static/img/events/mhp_2021.jpg +description: Indoor-Festival im Ferienpark +attending: Anja, Markus, Claudia, Dieter + +Das Metal Hammer Paradise ist ein familiäres Indoor-Festival, +das im Ferienpark Weissenhäuser Strand an der Ostsee stattfindet. \ No newline at end of file diff --git a/events/ragnaroek2022.md b/events/ragnaroek2022.md new file mode 100644 index 0000000..8d0ca83 --- /dev/null +++ b/events/ragnaroek2022.md @@ -0,0 +1,11 @@ +title: Ragnarök +date: 22.04.2022 - 23.04.2022 +author: Markus +event: Festival +location: Lichtenfels +link: https://ragnaroek-festival.com +pic: https://ragnaroek-festival.com/wp-content/uploads/2018/09/ragnaroek-festival-logo-gross-800px.png +description: Hört zu, wenn euch von Wald und Nebel gesungen wird! Hört zu, wenn euch von Kälte und Zorn gesungen wird! Hört zu, wenn euch von Heldenmut und Göttersagen gesungen wird. +attending: Ramona, Sebas + +Hört zu, wenn euch von Wald und Nebel gesungen wird! Hört zu, wenn euch von Kälte und Zorn gesungen wird! Hört zu, wenn euch von Heldenmut und Göttersagen gesungen wird. \ No newline at end of file diff --git a/events/rockharz2021.md b/events/rockharz2021.md new file mode 100644 index 0000000..5a6b1ba --- /dev/null +++ b/events/rockharz2021.md @@ -0,0 +1,11 @@ +title: Rockharz +date: 07.07.2022 - 10.07.2022 +author: Markus +event: Festival +location: Ballenstedt +link: https://www.rockharz-festival.com +pic: /static/img/events/rh_2021.jpg +description: Die FdgL hat das Rockharz in's Herz geschlossen und wird auch beim nächsten Mal mit am Start sein. +attending: + +Die FdgL hat das Rockharz in's Herz geschlossen und wird auch beim nächsten Mal mit am Start sein. \ No newline at end of file diff --git a/events/surprise.md b/events/surprise.md new file mode 100644 index 0000000..8c4c021 --- /dev/null +++ b/events/surprise.md @@ -0,0 +1,12 @@ +title: ??? +date: noch offen +author: Markus +event: ??? +fdglevent: ja +location: +link: +pic: +description: Wir haben ein Überraschung in der Planung... seid gespannt. +attending: alle + +Wir haben eine Überraschung für Euch in der Planung... seid gespannt. \ No newline at end of file diff --git a/events/wacken2021.md b/events/wacken2021.md new file mode 100644 index 0000000..823205b --- /dev/null +++ b/events/wacken2021.md @@ -0,0 +1,11 @@ +title: Wacken +date: 29.07.2021 - 31.07.2021 +author: Markus +event: Festival +location: Wacken +link: https://www.wacken.com +pic: https://www.wacken.com/typo3conf/ext/tnt_template_bs4/Resources/Public/2021/Images/logo_1x-min.png +description: Das größte Metal-Festival in Deutschland +attending: + +Auf dem W:O:A könnt ihr auch Freund:innen des geordneten Lärms antreffen. \ No newline at end of file diff --git a/events/wallesau2021.md b/events/wallesau2021.md new file mode 100644 index 0000000..a8e03a7 --- /dev/null +++ b/events/wallesau2021.md @@ -0,0 +1,13 @@ +title: Wallesau ist Blau! +date: 27.08.2021 - 28.08.2021 +author: Markus +event: Festival +location: Wallesau +link: https://www.wallesau-ist-blau.de +pic: https://www.wallesau-ist-blau.de/typo3temp/assets/_processed_/0/f/csm_Logo_WiB_17tesOA2021_mS_Datum_schwarz_47de565b5c.png +description: Rock, Metal, Punk, Ska auf einer Waldlichtung bei Wallesaus. Klein, aber fein. Mit Herzblut organisiert und veranstaltet. +attending: Anja, Markus + +Rock, Metal, Punk, Ska auf einer Waldlichtung bei Wallesau im Landkreis Roth. +Klein, aber fein. Mit Herzblut organisiert und veranstaltet von der +Musikinitiative Wallesau e.V. \ No newline at end of file diff --git a/static/css/events.css b/static/css/events.css new file mode 100644 index 0000000..3ac6479 --- /dev/null +++ b/static/css/events.css @@ -0,0 +1,65 @@ +/* + The event container uses flex layout to arrange the different events as cards. + */ +.event-container { + display: flex; + flex-wrap: wrap; +} + +/* + Each event card displays an event in a nice way as a card. + */ +.event-card { + border-style: solid; + border-width: 0.2rem; + border-image-source: linear-gradient(to bottom, rgba(191, 191, 191, 1.0), rgba(255, 255, 255, 1.0)); + border-image-slice: 1; + margin: 0.2rem 0.2rem 0.2rem 0.2rem; + padding-left: 0.8rem; + padding-right: 0.8rem; + width: 16rem; +} + +.event-card-fdgl { + border-width: 0.4rem; + border-color: #c11012; + border-image-source: none; + border-image-sice: none; +} + +.event-card img { + width: 100%; +} + +.attending { + font-size: 0.8rem; + color: #c11012; +} + +.attendee { + color: #515151; +} + +.event-type { + text-transform: uppercase; + color: white; + background: #c11012; + padding-left: 2px; + padding-right: 2px; +} + +.event-type-fdgl { + color: #c11012; + background: white; + border-style: dotted; + border-color: #c11012; + border-width: 1px; + padding-left: 2px; + padding-right: 2px; +} + +@media screen and (max-width: 783px), (orientation: portrait) { + .event-card { + width: 100%; + } +} diff --git a/static/css/style.css b/static/css/style.css index def409b..ae090d0 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -161,8 +161,8 @@ img[src $= "#illustration"] { /* Display an external icon after each link that leads away from our site. */ -.content a[href^="http://"]:not([href*="fdgl.rocks"]):not([href*="youtu.be"]):not([href*="youtube.com"]):after, -.content a[href^="https://"]:not([href*="fdgl.rocks"]):not([href*="youtu.be"]):not([href*="youtube.com"]):after { +.content a[href^="http://"]:not([href*="fdgl.rocks"]):not([href*="youtu.be"]):not([href*="youtube.com"]):not([href*="#hideextern"]):after, +.content a[href^="https://"]:not([href*="fdgl.rocks"]):not([href*="youtu.be"]):not([href*="youtube.com"]):not([href*="#hideextern"]):after { font-family: 'Font Awesome 5 Free'; content: "\f35d"; diff --git a/static/img/events/mhp_2021.jpg b/static/img/events/mhp_2021.jpg new file mode 100644 index 0000000..f7cb2c3 Binary files /dev/null and b/static/img/events/mhp_2021.jpg differ diff --git a/static/img/events/rh_2021.jpg b/static/img/events/rh_2021.jpg new file mode 100644 index 0000000..e4a8a21 Binary files /dev/null and b/static/img/events/rh_2021.jpg differ diff --git a/templates/events.html b/templates/events.html new file mode 100644 index 0000000..5b8e2b4 --- /dev/null +++ b/templates/events.html @@ -0,0 +1,49 @@ +{% extends "template.html" %} + {% block additional_style %} + .container > * { + max-width: 50rem; + padding:0 + } + {% endblock additional_style %} +{% block title %} + Events +{% endblock %} +{% block content %} +

Was liegt an?

+

Neben unseren eigenen Veranstaltungen trefft ihr FdgLer:innen auch auf + Konzerten und Festivals an. Haltet nach unserem Patch Ausschau und sprecht + uns an! +

+
+ + {% for event in events %} +
+

{{ event.title }}

+ +

 {{ event.date }}

+ {% if event.fdglevent == 'ja' %} +  FdgL + {% endif %} + {{ event.event }} + +

{{ event.html|safe }}

+ +

+ {% if event.attending != None %} + vor Ort: + {% for a in event.attending.split(',') %} + {{ a }}{% if a != event.attending.split(',')[-1] %},{% endif %} + {% endfor %} + {% endif %} +

+
+ {% endfor %} + +
+{% endblock %} diff --git a/templates/index.html b/templates/index.html index e799d43..baa59f6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -7,6 +7,6 @@

{{ page.title }}

{{ page.description }}

{{ format_date_string(page.date) }}

-
+
{% endfor %} {% endblock %} diff --git a/templates/template.html b/templates/template.html index be33889..5d1207b 100644 --- a/templates/template.html +++ b/templates/template.html @@ -5,7 +5,11 @@ {{ fontawesome_html() }} + + FdgL - Freunde des geordneten Lärms @@ -23,8 +27,9 @@