diff --git a/seminar/templates/seminar/odevzdavatko/detail_resitele.html b/seminar/templates/seminar/odevzdavatko/detail_resitele.html
new file mode 100644
index 00000000..4e5d7848
--- /dev/null
+++ b/seminar/templates/seminar/odevzdavatko/detail_resitele.html
@@ -0,0 +1,50 @@
+{% extends "base.html" %}
+{% load static %}
+{% load deadliny %}
+
+{% block content %}
+
+
Řešené problémy: {{ object.problem.all | join:", " }}
+
+Řešitelé: {% for r in object.resitele.all %} {{ r }}
+ {% if forloop.revcounter0 != 0 %}, {% endif %} {% endfor %}
+
+{# https://docs.djangoproject.com/en/3.1/ref/models/instances/#django.db.models.Model.get_FOO_display #}
+Forma: {{ object.get_forma_display }}
+
+Doručeno {{ object.cas_doruceni }}, deadline: {{object.cas_doruceni | deadline_html }}
+
+{# Soubory: #}
+Přílohy:
+{% if object.prilohy.all %}
+
+Soubor | Řešitelova poznámka | Datum |
+{% for priloha in object.prilohy.all %}
+
+ {{ priloha.split | last }} |
+ {{ priloha.res_poznamka }} |
+ {{ priloha.vytvoreno }} |
+ {# TODO: Orgo-poznámka, ideálně jako formulář #}
+{% endfor %}
+
+{% else %}
+Žádné přílohy
+{% endif %}
+
+{#Poznámka:
#}
+{#{{ poznamka }}
#}
+
+{# Hodnocení: #}
+Hodnocení:
+
+
+{% endblock %}
diff --git a/seminar/urls.py b/seminar/urls.py
index 8a6aacf4..5b71d2b3 100644
--- a/seminar/urls.py
+++ b/seminar/urls.py
@@ -142,4 +142,6 @@ urlpatterns = [
path('org/reseni/', org_required(viewMethodSwitch(get=views.DetailReseniView.as_view(), post=views.hodnoceniReseniView)), name='odevzdavatko_detail_reseni'),
path('org/reseni/all', org_required(views.SeznamReseniView.as_view())),
path('org/reseni/akt', org_required(views.SeznamAktualnichReseniView.as_view())),
+
+ path('resitel/reseni/', resitel_or_org_required(views.ResitelReseniView.as_view()), name='odevzdavatko_resitel_reseni'),
]
diff --git a/seminar/views/odevzdavatko.py b/seminar/views/odevzdavatko.py
index ecbef01e..786d263c 100644
--- a/seminar/views/odevzdavatko.py
+++ b/seminar/views/odevzdavatko.py
@@ -1,3 +1,4 @@
+from django.core.exceptions import PermissionDenied
from django.views.generic import ListView, DetailView, FormView
from django.views.generic.list import MultipleObjectTemplateResponseMixin,MultipleObjectMixin
from django.views.generic.base import View
@@ -268,6 +269,34 @@ def hodnoceniReseniView(request, pk, *args, **kwargs):
return redirect(success_url)
+class ResitelReseniView(DetailView):
+ model = m.Reseni
+ template_name = 'seminar/odevzdavatko/detail_resitele.html'
+
+ def aktualni_hodnoceni(self):
+ self.reseni = get_object_or_404(m.Reseni, id=self.kwargs['pk'])
+ result = []
+ for hodn in m.Hodnoceni.objects.filter(reseni=self.reseni):
+ result.append(
+ {
+ "problem": hodn.problem,
+ "body": hodn.body,
+ # "cislo_body": hodn.cislo_body,
+ }
+ )
+ return result
+
+ def get_context_data(self, **kw):
+ ctx = super().get_context_data(**kw)
+ hodnoceni = self.aktualni_hodnoceni()
+ if self.request.user not in self.reseni.resitele.all():
+ raise PermissionDenied()
+ # ctx['poznamka'] = f.PoznamkaReseniForm(instance=self.reseni)
+ ctx["hodnoceni"] = hodnoceni
+ return ctx
+
+
+
class PrehledOdevzdanychReseni(ListView):
model = m.Hodnoceni
template_name = 'seminar/odevzdavatko/resitel_prehled.html'