Skip to content
Snippets Groups Projects
Verified Commit 6c208952 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Change overview view to quick launch variant and show only full groups (without parents)

parent 61989488
No related branches found
No related tags found
1 merge request!31Biscuit merge. Closes #53.
{% extends 'core/base.html' %}
{% load i18n %}
{% block content %}
<h3>{% blocktrans %}All timetables{% endblocktrans %}</h3>
<div class="row">
<div class="col s12 m4">
<h4>{% blocktrans %}Teachers{% endblocktrans %}</h4>
<ul class="collection">
{% for teacher in teachers %}
<li class="collection-item avatar">
<i class="circle">{{ teacher. }}</i>
<a href="{% url 'timetable_smart_plan' 'teacher' teacher.id %}">{{ teacher.first_name }}
<strong>{{ teacher.name }}</strong></a>
</li>
{% endfor %}
</ul>
</div>
<div class="col s12 m4">
<h4>{% blocktrans%}Groups{% endblocktrans %}</h4>
<ul class="collection">
{% for group in groups %}
<li class="collection-item avatar">
<i class="circle">{{ group.name }}</i>
<a href="{% url 'timetable_smart_plan' 'group' group.id %}"><strong>{{ group.name }}</strong></a>
<p>
{{ group.text1|default:"" }} – {{ class.text2|default:"" }} <br>
Raum: {{ class.room.name|default:"---" }}
</p>
</li>
{% endfor %}
</ul>
</div>
<div class="col s12 m4">
<h4>{% blocktrans %}Rooms{% endblocktrans %}</h4>
<ul class="collection">
{% for room in rooms %}
<li class="collection-item avatar">
<i class="circle">{{ room.shortcode }}</i>
<a href="{% url 'timetable_smart_plan' 'room' room.id %}"><strong>{{ room.name }}</strong></a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<div class="col s12 m4"> <div class="col s12 m4">
<h5>Lehrkräfte</h5> <h5>Lehrkräfte</h5>
{% for teacher in teachers %} {% for teacher in teachers %}
<a class="waves-effect waves-light btn btn-timetable-quicklaunch" {# <a class="waves-effect waves-light btn btn-timetable-quicklaunch"#}
href="{% url 'timetable_smart_plan' 'teacher' teacher.id %}"> {# href="{% url 'timetable_smart_plan' 'teacher' teacher.id %}">#}
{{ teacher.shortcode }} {{ teacher.short_name }}
</a><!-- Shortcode --> {# </a><!-- Shortcode -->#}
{% endfor %} {% endfor %}
</div> </div>
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
<h5>Klassen</h5> <h5>Klassen</h5>
{% for class in classes %} {% for class in classes %}
<a class="waves-effect waves-light btn btn-timetable-quicklaunch" {# <a class="waves-effect waves-light btn btn-timetable-quicklaunch"#}
href="{% url 'timetable_smart_plan' 'class' class.id %}"> {# href="{% url 'timetable_smart_plan' 'class' class.id %}">#}
{{ class.name }} {{ class.short_name }}
</a> {# </a>#}
{% endfor %} {% endfor %}
</div> </div>
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
<div class="col s12 m4"> <div class="col s12 m4">
<h5>Räume</h5> <h5>Räume</h5>
{% for room in rooms %} {% for room in rooms %}
<a class="waves-effect waves-light btn btn-timetable-quicklaunch" {# <a class="waves-effect waves-light btn btn-timetable-quicklaunch"#}
href="{% url 'timetable_smart_plan' 'room' room.id %}"> {# href="{% url 'timetable_smart_plan' 'room' room.id %}">#}
{{ room.shortcode }} {{ room.short_name }}
</a> {# </a>#}
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -27,14 +27,14 @@ def all(request: HttpRequest) -> HttpResponse: ...@@ -27,14 +27,14 @@ def all(request: HttpRequest) -> HttpResponse:
context = {} context = {}
teachers = Person.objects.annotate(lessons_count=Count("lessons_as_teacher")).filter(lessons_count__gt=0) teachers = Person.objects.annotate(lessons_count=Count("lessons_as_teacher")).filter(lessons_count__gt=0)
groups = Group.objects.annotate(lessons_count=Count("lessons")).filter(lessons_count__gt=0) classes = Group.objects.annotate(lessons_count=Count("lessons")).filter(lessons_count__gt=0, parent_groups=None)
rooms = Room.objects.annotate(lessons_count=Count("lesson_periods")).filter(lessons_count__gt=0) rooms = Room.objects.annotate(lessons_count=Count("lesson_periods")).filter(lessons_count__gt=0)
context['teachers'] = teachers context['teachers'] = teachers
context['groups'] = groups context['classes'] = classes
context['rooms'] = rooms context['rooms'] = rooms
return render(request, 'chronos/all.html', context) return render(request, 'chronos/quicklaunch.html', context)
@login_required @login_required
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment