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

Fix error in courses.html

parent bf628dd2
......@@ -31,8 +31,9 @@
</div>
</div>
<div class="visible-xs" id="xs-check"></div>
{% if groupedby == 'semester' %}
{% 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 () {
......@@ -42,19 +43,20 @@
}
});
</script>
{% else %}
{% 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 %}
{% endif %}
{% for g in grouped_courses %}
<div class="row panel-group" id="accordion-{{ g.grouper|tagid }}">
{% 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;">
......@@ -76,6 +78,7 @@
{% endfor %}
</ul>
</div></div>
</div>
{% endfor %}
</div>
{% endfor %}
{% endif %}
{% 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