Added a page for upcoming events by establishing a second flat-pages instance. Added css styling and first contents.

pull/42/head
Markus Steinlein 4 years ago
parent 9cd5859052
commit 2df0002432

@ -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:
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,13 @@ 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 +90,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)

@ -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, 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,13 @@
title: Growl-Workshop mit Britta
date: n/a
author: Markus
event: Workshop
fdglevent: ja
location: Halle96
link: /growl-workshop.html
pic:
description: Lernt Growlen, Screamen, Grunten wie die Großen!
attending: Britta Görtz
Lernt Growlen, Screamen, Grunten wie die Großen!
Im FdgL-Growl-Workshop mit Britta Görz von Critical Mess.

@ -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: 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: n/a
Auf dem W:O:A könnt ihr auch Freund:innen des geordneten Lärms antreffen.

@ -0,0 +1,57 @@
/*
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: 3px;
border-color: black;
border-radius: 9px;
margin: 4px 4px 4px 1px;
padding-left: 8px;
padding-right: 8px;
}
.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 (min-width: 54rem) {
.event-card {
max-width: 40%;
}
}

@ -161,12 +161,12 @@ 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";
display: inline-block;
display: inline-block;e
font: normal 16px/1 'Font Awesome 5 Free';
margin-left: 4px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

@ -0,0 +1,34 @@
{% extends "template.html" %}
{% block title %}
Was liegt an?
{% endblock %}
{% block content %}
<div class="event-container">
{% for event in events %}
<div class="event-card"
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>
<span class="event-type">{{ event.event }}</span>
{% if event.fdglevent == 'ja' %}
<span class="event-type-fdgl"><i class="fas fa-certificate">&nbsp;</i>FdgL Event</span>
{% endif %}
<p> {{ event.html|safe }} </p>
<p class="attending">vor Ort:
{% for a in event.attending.split(',') %}
<span class="attendee">{{ a }}{% if a != event.attending.split(',')[-1] %},{% endif %}</span>
{% endfor %}
</p>
</div>
{% endfor %}
</div>
{% endblock %}

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

@ -5,6 +5,7 @@
{{ fontawesome_html() }}
<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="event cards stylesheet" href="{{ url_for('static', filename='css/events.css') }}">
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
<title>FdgL - Freunde des geordneten Lärms</title>
</head>
@ -23,8 +24,9 @@
</div>
</header>
<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('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('datenschutz') }}">Datenschutz</a>
<a class="page-link" href="{{ url_for('impressum') }}">Impressum</a>
@ -37,13 +39,7 @@
<div class="content">
<div class="post-body">
{% 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 %}
</div>
</div>

Loading…
Cancel
Save