Commit 7d19efc2 authored by Magnus Giesbert's avatar Magnus Giesbert Committed by Andreas Valder
Browse files

Fix error in courses.html

parent bf628dd2
......@@ -31,51 +31,54 @@
</div>
</div>
<div class="visible-xs" id="xs-check"></div>
{% if groupedby == 'semester' %}
{% set grouped_courses = courses|groupby(groupedby)|reverse|list %}
<script>
$(function () {
if($("#xs-check").is(":visible")) {
/* Only expand current semester */
$(".collapse[id!='{{grouped_courses[1].grouper|tagid}}']").removeClass('in');
}
});
</script>
{% else %}
{% set grouped_courses = courses|groupby(groupedby)|list %}
<script>
$(function () {
if($("#xs-check").is(":visible")) {
$(".collapse[id!='{{grouped_courses[0].grouper|tagid}}']").removeClass('in');
}
});
</script>
{% endif %}
{% if courses %}
<div class="visible-xs" id="xs-check"></div>
{% if groupedby == 'semester' and courses|groupby(groupedby)|length > 1%}
{% set grouped_courses = courses|groupby(groupedby)|reverse|list %}
<script>
$(function () {
if($("#xs-check").is(":visible")) {
/* Only expand current semester */
$(".collapse[id!='{{grouped_courses[1].grouper|tagid}}']").removeClass('in');
}
});
</script>
{% else %}
{% set grouped_courses = courses|groupby(groupedby)|list %}
<script>
$(function () {
if($("#xs-check").is(":visible")) {
/* Only expand first group */
$(".collapse[id!='{{grouped_courses[0].grouper|tagid}}']").removeClass('in');
}
});
</script>
{% endif %}
{% for g in grouped_courses %}
<div class="row panel-group" id="accordion-{{ g.grouper|tagid }}">
<div class="col-xs-12"><div class="panel panel-default">
<div class="panel-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-{{ g.grouper|tagid }}" href="#{{g.grouper|tagid}}" style="color: #222;">
{% if groupedby == 'semester' %}
<h1 class="panel-title">{{g.grouper|semester(long=True)}} ({{g.list|length}} Veranstaltungen)
</h1>
{% else %}
<h1 class="panel-title">{{g.grouper}}</h1>
{% endif %}
</a>
</div>
<ul class="{% if not ismod() %}courses-list {% endif %}list-group panel-collapse collapse in" id="{{g.grouper|tagid}}">
{% 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 %}
{% for g in grouped_courses %}
<div class="row panel-group" id="accordion-{{ g.grouper|tagid }}">
<div class="col-xs-12"><div class="panel panel-default">
<div class="panel-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion-{{ g.grouper|tagid }}" href="#{{g.grouper|tagid}}" style="color: #222;">
{% if groupedby == 'semester' %}
<h1 class="panel-title">{{g.grouper|semester(long=True)}} ({{g.list|length}} Veranstaltungen)
</h1>
{% else %}
<h1 class="panel-title">{{g.grouper}}</h1>
{% endif %}
</a>
</div>
<ul class="{% if not ismod() %}courses-list {% endif %}list-group panel-collapse collapse in" id="{{g.grouper|tagid}}">
{% 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 %}
{% endif %}
{% endblock %}
Markdown is supported
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