From 75c2077e50f43a40b1b7b4da114cb68e3d914d06 Mon Sep 17 00:00:00 2001 From: Jonas Havelka Date: Fri, 17 Sep 2021 01:28:38 +0200 Subject: [PATCH] =?UTF-8?q?Pokus=20o=20opravu=20(zv=C3=ADraz=C5=88ov=C3=A1?= =?UTF-8?q?n=C3=AD=20a=20zobrazov=C3=A1n=C3=AD)=20men=C3=AD=C4=8Dka?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/sitetree.json | 122 +++++++++++++++++++++++++++++++++- seminar/views/odevzdavatko.py | 5 ++ 2 files changed, 126 insertions(+), 1 deletion(-) diff --git a/data/sitetree.json b/data/sitetree.json index 3c4bbe97..fe6ab3e9 100644 --- a/data/sitetree.json +++ b/data/sitetree.json @@ -729,7 +729,7 @@ "sort_order": 40, "title": "Řešitelské články", "tree": 1, - "url": "/archiv/clanky", + "url": "/archiv/clanky/", "urlaspattern": false }, "model": "sitetree.treeitem", @@ -857,5 +857,125 @@ }, "model": "sitetree.treeitem", "pk": 45 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": false, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 35, + "sort_order": 46, + "title": "Ročník {{rocnik.rocnik}}", + "tree": 1, + "url": "seminar_rocnik rocnik.rocnik", + "urlaspattern": true + }, + "model": "sitetree.treeitem", + "pk": 46 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": false, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 35, + "sort_order": 47, + "title": "Číslo {{ cislo.rocnik.rocnik }}.{{ cislo.poradi }}", + "tree": 1, + "url": "seminar_cislo cislo.rocnik.rocnik cislo.poradi", + "urlaspattern": true + }, + "model": "sitetree.treeitem", + "pk": 47 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": false, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 37, + "sort_order": 48, + "title": "Došlá řešení {{ rocnik }}", + "tree": 1, + "url": "odevzdavatko_tabulka rocnik", + "urlaspattern": false + }, + "model": "sitetree.treeitem", + "pk": 48 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": false, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 37, + "sort_order": 49, + "title": "Řešení p. {{ problem_id }} od ř. {{ resitel_id }}", + "tree": 1, + "url": "odevzdavatko_reseni_resitele_k_problemu problem_id resitel_id", + "urlaspattern": false + }, + "model": "sitetree.treeitem", + "pk": 49 + }, + { + "fields": { + "access_guest": false, + "access_loggedin": false, + "access_perm_type": 1, + "access_permissions": [], + "access_restricted": false, + "alias": null, + "description": "", + "hidden": false, + "hint": "", + "inbreadcrumbs": true, + "inmenu": true, + "insitetree": true, + "parent": 37, + "sort_order": 50, + "title": "Detail řešení {{ reseni_id }}", + "tree": 1, + "url": "odevzdavatko_detail_reseni reseni_id", + "urlaspattern": false + }, + "model": "sitetree.treeitem", + "pk": 50 } ] diff --git a/seminar/views/odevzdavatko.py b/seminar/views/odevzdavatko.py index 46eb602d..e3a94110 100644 --- a/seminar/views/odevzdavatko.py +++ b/seminar/views/odevzdavatko.py @@ -188,6 +188,10 @@ class ReseniProblemuView(MultipleObjectTemplateResponseMixin, MultipleObjectMixi jedine_reseni = self.object_list.first() return redirect(reverse("odevzdavatko_detail_reseni", kwargs={"pk": jedine_reseni.id})) context = self.get_context_data() + + context["resitel_id"] = self.kwargs['resitel'] + context["problem_id"] = self.kwargs['problem'] + return self.render_to_response(context) def get_context_data(self, *args, **kwargs): @@ -219,6 +223,7 @@ class DetailReseniView(DetailView): ctx['form'] = f.OhodnoceniReseniFormSet( initial = self.aktualni_hodnoceni() ) + ctx['reseni_id'] = self.object.id return ctx