Skip to content
Snippets Groups Projects
Commit cde4f61f authored by Andreas Valder's avatar Andreas Valder Committed by Andreas Valder
Browse files

made "nächste aufnahmen" show the next week only

parent 0de13221
No related branches found
No related tags found
No related merge requests found
......@@ -127,12 +127,14 @@ def fixnl(s):
@app.route('/')
@register_navbar('Home', icon='home')
def index():
start = date.today() - timedelta(days=1)
end = start + timedelta(days=7)
upcomming = query ('''
SELECT lectures.*,courses.short, courses.title AS course_title
FROM lectures
JOIN courses ON (lectures.course_id = courses.id)
WHERE (time > ?)
ORDER BY time ASC LIMIT 7''',datetime.today())
WHERE (time > ?) AND (time < ?) and lectures.visible and courses.visible and courses.listed
ORDER BY time ASC LIMIT 30''',start,end)
for i in upcomming:
i['date'] = i['time'].date()
latestvideos=query('''
......
......@@ -69,6 +69,7 @@
<div class="panel-heading">
<h1 class="panel-title">Nächste Aufnahmen</h1">
</div>
{% if upcomming|length > 0 %}
<ul class="list-group">
{% for g in upcomming|groupby('date') %}
<li class="list-group-item">
......@@ -84,6 +85,9 @@
</li>
{% endfor %}
</ul>
{% else %}
<p>In den nächsten 7 Tagen wird noch nichts aufgenommen oder gestreamt.</p>
{% endif %}
</div>
<div class="panel panel-default">
<div class="panel-heading">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment