Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
website
Commits
cde4f61f
Commit
cde4f61f
authored
Sep 08, 2016
by
Andreas Valder
Committed by
Andreas Valder
Sep 08, 2016
Browse files
made "nächste aufnahmen" show the next week only
parent
0de13221
Changes
2
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
cde4f61f
...
...
@@ -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
(
'''
...
...
templates/index.html
View file @
cde4f61f
...
...
@@ -69,21 +69,25 @@
<div
class=
"panel-heading"
>
<h1
class=
"panel-title"
>
Nächste Aufnahmen
</h1
"
>
</div>
<ul
class=
"list-group"
>
{% for g in upcomming|groupby('date') %}
<li
class=
"list-group-item"
>
<ul
class=
"list-group"
style=
"margin: 0px;"
>
<strong>
{{ g.grouper|date }}
</strong>
{% for i in g.list %}
<li
class=
"list-group-item list-group-item-condensed"
>
{{i.time|time}} {{i.place}}
<a
href=
"{{url_for('course', id=i.course_id)}}"
>
{{i.course_title}}
</a>
:
<a
href=
"{{url_for('course', id=i.course_id)}}#lecture-{{i.id}}"
>
{{i.title}}
</a>
{% if upcomming|length > 0 %}
<ul
class=
"list-group"
>
{% for g in upcomming|groupby('date') %}
<li
class=
"list-group-item"
>
<ul
class=
"list-group"
style=
"margin: 0px;"
>
<strong>
{{ g.grouper|date }}
</strong>
{% for i in g.list %}
<li
class=
"list-group-item list-group-item-condensed"
>
{{i.time|time}} {{i.place}}
<a
href=
"{{url_for('course', id=i.course_id)}}"
>
{{i.course_title}}
</a>
:
<a
href=
"{{url_for('course', id=i.course_id)}}#lecture-{{i.id}}"
>
{{i.title}}
</a>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</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"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment