course.html 1.51 KB
Newer Older
1
{% from 'macros.html' import course_list_item %}
Andreas Valder's avatar
Andreas Valder committed
2
3
{% extends "base.html" %}
{% block content %}
4
5
6
<div class="row">
	<div class="col-xs-12 dropdown" style="margin-bottom: 10px;">
		<span class="pull-right">
7
			 <a class="fa fa-rss-square pull-right btn btn-default" aria-hidden="true" href="{{url_for('feed_courses')}}"></a>
8
			{% if ismod() %} <a class="btn btn-default" style="margin-right: 5px;" href="{{ url_for('newcourse', ref=request.url) }}">Neue Veranstaltung</a> {% endif %}
9
10
11
12
13
14
15
16
17
		
		<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>
Andreas Valder's avatar
Andreas Valder committed
18
	</div>
Andreas Valder's avatar
Andreas Valder committed
19
</div>
20
21
22
23
{% 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">
24
25
26
			{% if groupedby == 'semester' %}
			<h1 class="panel-title">{{g.grouper|semester(long=True)}}</h1>
			{% else %}
27
			<h1 class="panel-title">{{g.grouper}}</h1>
28
			{% endif %}
29
30
31
32
33
34
35
36
37
38
39
		</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>
Andreas Valder's avatar
Andreas Valder committed
40
</div>
41
42
{% endfor %}

Andreas Valder's avatar
Andreas Valder committed
43
{% endblock %}