Browse Source

Pokus o opravu (zvírazňování a zobrazování) meníčka

middleware_test
Jonas Havelka 3 years ago
parent
commit
75c2077e50
  1. 122
      data/sitetree.json
  2. 5
      seminar/views/odevzdavatko.py

122
data/sitetree.json

@ -729,7 +729,7 @@
"sort_order": 40, "sort_order": 40,
"title": "Řešitelské články", "title": "Řešitelské články",
"tree": 1, "tree": 1,
"url": "/archiv/clanky", "url": "/archiv/clanky/",
"urlaspattern": false "urlaspattern": false
}, },
"model": "sitetree.treeitem", "model": "sitetree.treeitem",
@ -857,5 +857,125 @@
}, },
"model": "sitetree.treeitem", "model": "sitetree.treeitem",
"pk": 45 "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
} }
] ]

5
seminar/views/odevzdavatko.py

@ -188,6 +188,10 @@ class ReseniProblemuView(MultipleObjectTemplateResponseMixin, MultipleObjectMixi
jedine_reseni = self.object_list.first() jedine_reseni = self.object_list.first()
return redirect(reverse("odevzdavatko_detail_reseni", kwargs={"pk": jedine_reseni.id})) return redirect(reverse("odevzdavatko_detail_reseni", kwargs={"pk": jedine_reseni.id}))
context = self.get_context_data() context = self.get_context_data()
context["resitel_id"] = self.kwargs['resitel']
context["problem_id"] = self.kwargs['problem']
return self.render_to_response(context) return self.render_to_response(context)
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
@ -219,6 +223,7 @@ class DetailReseniView(DetailView):
ctx['form'] = f.OhodnoceniReseniFormSet( ctx['form'] = f.OhodnoceniReseniFormSet(
initial = self.aktualni_hodnoceni() initial = self.aktualni_hodnoceni()
) )
ctx['reseni_id'] = self.object.id
return ctx return ctx

Loading…
Cancel
Save