diff --git a/personalni/templates/personalni/profil/orgorozcestnik.html b/personalni/templates/personalni/profil/orgorozcestnik.html index 4d5b6c4f..a14f5bb4 100644 --- a/personalni/templates/personalni/profil/orgorozcestnik.html +++ b/personalni/templates/personalni/profil/orgorozcestnik.html @@ -94,6 +94,19 @@
Nemůžeš najít, co hledáš? Může to být v administračním rozhraní webu.
{% endblock content %} diff --git a/personalni/views.py b/personalni/views.py index 03cbf6bf..2ad1ea79 100644 --- a/personalni/views.py +++ b/personalni/views.py @@ -1,7 +1,7 @@ from django.shortcuts import render from django.urls import reverse from django.views import generic -from django.db.models import Q +from django.db.models import Q, Count from django.views.decorators.debug import sensitive_post_parameters from django.views.generic.base import TemplateView from django.contrib.auth.models import User, Permission, Group @@ -51,6 +51,10 @@ class OrgoRozcestnikView(TemplateView): context['muj_pocet_neobodovanych_reseni'] = neobodovana_reseni.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).distinct().count() context['muj_pocet_reseni_mimo_cislo'] = reseni_mimo_cislo.filter(Q(problem__garant=organizator) | Q(problem__autor=organizator) | Q(problem__opravovatele__in=[organizator])).count() + # Termínářský přehled + pocty_neopravenych_reseni = neobodovana_reseni.select_related('problem').values('problem__nazev').annotate(count=Count('problem')).order_by() + context["pocty_neopravenych_reseni"] = [(it['problem__nazev'], it['count']) for it in pocty_neopravenych_reseni.all()] + #FIXME: přidat stav='STAV_ZADANY' temata = s.Tema.objects.filter(Q(garant=organizator) | Q(autor=organizator) | Q(opravovatele__in=[organizator]), rocnik=aktualni_rocnik).distinct()