Merge pull request #42 from Ayreonaut/mst-events

Events
pull/53/merge
Johannes Thumshirn 4 years ago committed by GitHub
commit 111e4c23bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,17 +25,30 @@ def format_date_string(date_string):
return date.strftime("%d. %B %Y") 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 # create app
app = Flask(__name__) app = Flask(__name__)
app.config['FLATPAGES_EXTENSION'] = '.md' app.config['FLATPAGES_PAGES_EXTENSION'] = '.md'
app.config['FLATPAGES_HTML_RENDERER'] = markdown_with_jinja_renderer 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'] app.config['FONTAWESOME_STYLES'] = ['solid', 'brands']
# register fotogrid with jinja # register fotogrid with jinja
app.jinja_env.globals.update(fotogrid=fotogrid) app.jinja_env.globals.update(fotogrid=fotogrid)
app.jinja_env.globals.update(format_date_string=format_date_string) 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) fa = FontAwesome(app)
@ -50,6 +63,14 @@ def verein():
return render_template('verein.html') 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') @app.route('/kontakt.html')
def kontakt(): def kontakt():
return render_template('kontakt.html') return render_template('kontakt.html')
@ -70,7 +91,7 @@ def impressum():
def index(): def index():
posts = [p for p in pages if "date" in p.meta] posts = [p for p in pages if "date" in p.meta]
sorted_pages = sorted(posts, reverse=True, key=lambda page: 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) return render_template('index.html', pages=sorted_pages)

@ -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

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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.

@ -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%;
}
}

@ -161,8 +161,8 @@ img[src $= "#illustration"] {
/* /*
Display an external icon after each link that leads away from our site. 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^="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"]):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'; font-family: 'Font Awesome 5 Free';
content: "\f35d"; content: "\f35d";

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

@ -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 %}
<h3>Was liegt an?</h3>
<p>Neben unseren eigenen Veranstaltungen trefft ihr FdgLer:innen auch auf
Konzerten und Festivals an. Haltet nach unserem Patch Ausschau und sprecht
uns an!
</p>
<div class="event-container">
{% for event in events %}
<div class="event-card {% if event.fdglevent == 'ja' %} event-card-fdgl{% endif %}"
style="background-image:
linear-gradient(to bottom, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 1.0)),
url({{ event.pic }});
background-repeat: no-repeat;
background-size: cover;
background-position: center;">
<a href="{{ event.link }}#hideextern"><h2>{{ event.title }}</h2></a>
<!--<img src="{{ event.pic }}"></img>-->
<p><i class="fas fa-calendar-alt">&nbsp;</i>{{ event.date }}</p>
{% if event.fdglevent == 'ja' %}
<span class="event-type"><i class="fas fa-asterisk">&nbsp;</i>FdgL</span>
{% endif %}
<span class="event-type">{{ event.event }}</span>
<p> {{ event.html|safe }} </p>
<p class="attending">
{% if event.attending != None %}
vor Ort:
{% for a in event.attending.split(',') %}
<span class="attendee">{{ a }}{% if a != event.attending.split(',')[-1] %},{% endif %}</span>
{% endfor %}
{% endif %}
</p>
</div>
{% endfor %}
</div>
{% endblock %}

@ -7,6 +7,6 @@
<a href="{{ page.path }}.html"><h2>{{ page.title }}</h2></a> <a href="{{ page.path }}.html"><h2>{{ page.title }}</h2></a>
<p> {{ page.description }} </p> <p> {{ page.description }} </p>
<p><small>{{ format_date_string(page.date) }} </small></p> <p><small>{{ format_date_string(page.date) }} </small></p>
<hr> <hr/>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}

@ -5,7 +5,11 @@
{{ fontawesome_html() }} {{ fontawesome_html() }}
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}"> <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<link rel="fotogrid stylesheet" href="{{ url_for('static', filename='css/fotogrid.css') }}"> <link rel="fotogrid stylesheet" href="{{ url_for('static', filename='css/fotogrid.css') }}">
<link rel="event cards stylesheet" href="{{ url_for('static', filename='css/events.css') }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"> <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<style>
{% block additional_style %}{% endblock additional_style %}
</style>
<title>FdgL - Freunde des geordneten Lärms</title> <title>FdgL - Freunde des geordneten Lärms</title>
</head> </head>
<body class=post> <body class=post>
@ -23,8 +27,9 @@
</div> </div>
</header> </header>
<nav id="sidebar-nav-links"> <nav id="sidebar-nav-links">
<a class="page-link" href="{{ url_for('verein') }}">Verein</a>
<a class="page-link" href="{{ url_for('index') }}">News</a> <a class="page-link" href="{{ url_for('index') }}">News</a>
<a class="page-link" href="{{ url_for('verein') }}">Verein</a>
<a class="page-link" href="{{ url_for('view_events') }}">Events</a>
<a class="page-link" href="{{ url_for('kontakt') }}">Kontakt</a> <a class="page-link" href="{{ url_for('kontakt') }}">Kontakt</a>
<a class="page-link" href="{{ url_for('datenschutz') }}">Datenschutz</a> <a class="page-link" href="{{ url_for('datenschutz') }}">Datenschutz</a>
<a class="page-link" href="{{ url_for('impressum') }}">Impressum</a> <a class="page-link" href="{{ url_for('impressum') }}">Impressum</a>
@ -37,13 +42,7 @@
<div class="content"> <div class="content">
<div class="post-body"> <div class="post-body">
{% block content %} {% block content %}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
{% endblock content %} {% endblock content %}
</div> </div>
</div> </div>

Loading…
Cancel
Save