diff --git a/AKScheduling/templates/admin/AKScheduling/scheduling.html b/AKScheduling/templates/admin/AKScheduling/scheduling.html index 62b672364187ebce313c6e62654a750f752cbd82..daa19367185fc94f8e38ff7d1112ce2dc4f3cce9 100644 --- a/AKScheduling/templates/admin/AKScheduling/scheduling.html +++ b/AKScheduling/templates/admin/AKScheduling/scheduling.html @@ -184,11 +184,17 @@ <div id="planCalendar"></div> </div> <div class="col-md-2 col-lg-2" id="unscheduled-slots"> - {% for slot in slots_unscheduled %} - <div class="unscheduled-slot badge badge-primary" style='background-color: {{ slot.ak.category.color }}' - data-event='{ "title": "{{ slot.ak.short_name }}", "duration": {"hours": "{{ slot.duration|unlocalize }}"}, "constraint": "roomAvailable", "description": "{{ slot.ak.details | escapejs }}", "slotID": "{{ slot.pk }}", "backgroundColor": "{{ slot.ak.category.color }}"}' data-details="{{ slot.ak.details }}">{{ slot.ak.short_name }} - ({{ slot.duration }} h)<br>{{ slot.ak.owners_list }} - </div> + {% regroup slots_unscheduled by ak.track as slots_unscheduled_by_track_list %} + {% for track_slots in slots_unscheduled_by_track_list %} + {% if track_slots.grouper %} + <h5 class="mt-2">{{ track_slots.grouper }}</h5> + {% endif %} + {% for slot in track_slots.list %} + <div class="unscheduled-slot badge badge-primary" style='background-color: {{ slot.ak.category.color }}' + data-event='{ "title": "{{ slot.ak.short_name }}", "duration": {"hours": "{{ slot.duration|unlocalize }}"}, "constraint": "roomAvailable", "description": "{{ slot.ak.details | escapejs }}", "slotID": "{{ slot.pk }}", "backgroundColor": "{{ slot.ak.category.color }}"}' data-details="{{ slot.ak.details }}">{{ slot.ak.short_name }} + ({{ slot.duration }} h)<br>{{ slot.ak.owners_list }} + </div> + {% endfor %} {% endfor %} </div> </div> diff --git a/AKScheduling/views.py b/AKScheduling/views.py index 73719bd85f3c9dd62dc374e96cebd29b610d953b..86445faccabfb643683794a5e478c1ffaf813fb5 100644 --- a/AKScheduling/views.py +++ b/AKScheduling/views.py @@ -25,7 +25,7 @@ class SchedulingAdminView(AdminViewMixin, FilterByEventSlugMixin, ListView): context_object_name = "slots_unscheduled" def get_queryset(self): - return super().get_queryset().filter(start__isnull=True) + return super().get_queryset().filter(start__isnull=True).order_by('ak__track') def get_context_data(self, *, object_list=None, **kwargs): context = super().get_context_data(object_list=object_list, **kwargs)