Commit c1838d3e authored by Andreas Valder's avatar Andreas Valder
Browse files

renamed videos template to course

parent 11af9c35
......@@ -74,7 +74,7 @@ def videos():
groupedby = request.args.get('groupedby')
if groupedby not in ['title','semester','organizer']:
groupedby = 'semester'
return render_template('videos.html', courses=courses, groupedby=groupedby)
return render_template('course.html', courses=courses, groupedby=groupedby)
@app.route('/faq')
@register_navbar('FAQ', icon='question-sign')
......@@ -123,9 +123,9 @@ def course(id):
JOIN formats ON (videos.video_format = formats.id)
JOIN courses ON (lectures.course_id = courses.id)
WHERE lectures.course_id= ? AND (? OR videos.visible)
ORDER BY formats.prio DESC
ORDER BY lectures.time, formats.prio DESC
''', courses[0]['id'], ismod())
return render_template('course.html', course=courses[0], lectures=lectures, videos=videos)
return render_template('course_id.html', course=courses[0], lectures=lectures, videos=videos)
@app.route('/login', methods=['GET', 'POST'])
def login():
......
{% from 'macros.html' import lecture_list_item %}
{% from 'macros.html' import valueeditor %}
{% from 'macros.html' import valuecheckbox %}
{% from 'macros.html' import preview %}
{% from 'macros.html' import course_list_item %}
{% extends "base.html" %}
{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">{{ valueeditor(['courses',course.id,'title'], course.title)}}</h1>
</div>
<div class="row panel-body">
<div class="col-xs-12">
<table class="table-condensed">
<tbody>
<tr><td>Semester:</td><td>{{ valueeditor(['courses',course.id,'semester'], course.semester) }}</td></tr>
<tr><td>Veranstalter:</td><td>{{ valueeditor(['courses',course.id,'organizer'], course.organizer) }}</td></tr>
<tr><td>Bemerkungen:</td><td>{{ valueeditor(['courses',course.id,'description'], course.description) }}</td></tr>
{% if ismod() %}
<tr><td>Sichtbar:</td><td>{{ valuecheckbox(['courses',course.id,'visible'], course.visible) }}</td></tr>
<tr><td>Gelistet:</td><td>{{ valuecheckbox(['courses',course.id,'listed'], course.listed) }}</td></tr>
<tr><td>Short:</td><td>{{ valueeditor(['courses',course.id,'short'], course.short) }}</td></tr>
<tr><td>Handle:</td><td>{{ valueeditor(['courses',course.id,'handle'], course.handle) }}</td></tr>
<tr><td>Downloadable:</td><td>{{ valuecheckbox(['courses',course.id,'downloadable'], course.downloadable) }}</td></tr>
<tr><td>Thema:</td><td>{{ valueeditor(['courses',course.id,'subject'], course.subject) }}</td></tr>
<tr><td>Zuständig:</td><td>{{ valueeditor(['courses',course.id,'responsible'], course.responsible) }}</td></tr>
{% endif %}
</tbody>
</table>
</div>
<div class="row">
<div class="col-xs-12 dropdown" style="margin-bottom: 10px;">
<span class="pull-right">
{% if ismod() %} <a class="btn btn-default" style="margin-right: 5px;" href="todo">Neue Veranstaltung</a> {% endif %}
<button class="btn btn-primary dropdown-toggle pull-right" type="button" data-toggle="dropdown">Gruppierung
<span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="?groupedby=semester">Semester</a></li>
<li><a href="?groupedby=title">Veranstaltungen</a></li>
<li><a href="?groupedby=organizer">Dozenten</a></li>
</ul>
</span>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Videos</h1>
{% if ismod() %}
<a class="btn btn-default" style="margin-right: 5px;" href="todo">Neuer Termin</a>
{% endif %}
</div>
<ul class="list-group lectureslist">
{% for l in lectures %}
{{ lecture_list_item(l,videos|selectattr('lecture_id','equalto',l.id)|list) }}
{% endfor %}
</ul>
{% for g in courses|groupby(groupedby)|reverse %}
<div class="row panel-group">
<div class="col-xs-12"><div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">{{g.grouper}}</h1>
</div>
<ul class="{% if not ismod() %}courses-list {% endif %}list-group">
{% for i in g.list %}
{% if groupedby == 'semester' %}
{{ course_list_item(i) }}
{% else %}
{{ course_list_item(i,true) }}
{% endif %}
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
{% endblock %}
{% from 'macros.html' import lecture_list_item %}
{% from 'macros.html' import valueeditor %}
{% from 'macros.html' import valuecheckbox %}
{% from 'macros.html' import preview %}
{% extends "base.html" %}
{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">{{ valueeditor(['courses',course.id,'title'], course.title)}}</h1>
</div>
<div class="row panel-body">
<div class="col-xs-12">
<table class="table-condensed">
<tbody>
<tr><td>Semester:</td><td>{{ valueeditor(['courses',course.id,'semester'], course.semester) }}</td></tr>
<tr><td>Veranstalter:</td><td>{{ valueeditor(['courses',course.id,'organizer'], course.organizer) }}</td></tr>
<tr><td>Bemerkungen:</td><td>{{ valueeditor(['courses',course.id,'description'], course.description) }}</td></tr>
{% if ismod() %}
<tr><td>Sichtbar:</td><td>{{ valuecheckbox(['courses',course.id,'visible'], course.visible) }}</td></tr>
<tr><td>Gelistet:</td><td>{{ valuecheckbox(['courses',course.id,'listed'], course.listed) }}</td></tr>
<tr><td>Short:</td><td>{{ valueeditor(['courses',course.id,'short'], course.short) }}</td></tr>
<tr><td>Handle:</td><td>{{ valueeditor(['courses',course.id,'handle'], course.handle) }}</td></tr>
<tr><td>Downloadable:</td><td>{{ valuecheckbox(['courses',course.id,'downloadable'], course.downloadable) }}</td></tr>
<tr><td>Thema:</td><td>{{ valueeditor(['courses',course.id,'subject'], course.subject) }}</td></tr>
<tr><td>Zuständig:</td><td>{{ valueeditor(['courses',course.id,'responsible'], course.responsible) }}</td></tr>
{% endif %}
</tbody>
</table>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">Videos</h1>
{% if ismod() %}
<a class="btn btn-default" style="margin-right: 5px;" href="todo">Neuer Termin</a>
{% endif %}
</div>
<ul class="list-group lectureslist">
{% for l in lectures %}
{{ lecture_list_item(l,videos|selectattr('lecture_id','equalto',l.id)|list) }}
{% endfor %}
</ul>
</div>
{% endblock %}
{% from 'macros.html' import course_list_item %}
{% extends "base.html" %}
{% block content %}
<div class="row">
<div class="col-xs-12 dropdown" style="margin-bottom: 10px;">
<span class="pull-right">
{% if ismod() %} <a class="btn btn-default" style="margin-right: 5px;" href="todo">Neue Veranstaltung</a> {% endif %}
<button class="btn btn-primary dropdown-toggle pull-right" type="button" data-toggle="dropdown">Gruppierung
<span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="?groupedby=semester">Semester</a></li>
<li><a href="?groupedby=title">Veranstaltungen</a></li>
<li><a href="?groupedby=organizer">Dozenten</a></li>
</ul>
</span>
</div>
</div>
{% for g in courses|groupby(groupedby)|reverse %}
<div class="row panel-group">
<div class="col-xs-12"><div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">{{g.grouper}}</h1>
</div>
<ul class="{% if not ismod() %}courses-list {% endif %}list-group">
{% for i in g.list %}
{% if groupedby == 'semester' %}
{{ course_list_item(i) }}
{% else %}
{{ course_list_item(i,true) }}
{% endif %}
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
{% endblock %}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment