From 8f80b6c807058ef30b8e7ce87ee8184d023521fa Mon Sep 17 00:00:00 2001 From: "Tomas \"Jethro\" Pokorny" Date: Wed, 21 Oct 2020 08:41:20 +0200 Subject: [PATCH] =?UTF-8?q?TreeNode=20Editor=20|=20zobrazit=20editor=20v?= =?UTF-8?q?=20aktu=C3=A1ln=C3=ADm=20zad=C3=A1n=C3=AD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/views/views_all.py | 27 ++++++++++++++++----------- vue_frontend/src/router/index.js | 5 +++++ 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/seminar/views/views_all.py b/seminar/views/views_all.py index f769155f..541fc16b 100644 --- a/seminar/views/views_all.py +++ b/seminar/views/views_all.py @@ -111,6 +111,7 @@ class TNLData(object): self.can_podvesit_za = tnltt.canPodvesitZa(self) self.can_podvesit_pred = tnltt.canPodvesitPred(self) self.appendable_children = tnltt.appendableChildren(self) + print("appChld",self.appendable_children) if self.parent: self.appendable_siblings = tnltt.appendableChildren(self.parent) else: @@ -346,18 +347,22 @@ class ProblemView(generic.DetailView): raise ValueError("Obecný problém nejde zobrazit.") return context -# TODO Co chceme vlastně zobrazovat na této stránce? Zatím je zde aktuální číslo, ale může tu být cokoli jiného... -class AktualniZadaniView(TreeNodeView): - def get_object(self): - nastaveni = get_object_or_404(Nastaveni) - return nastaveni.aktualni_cislo.cislonode - def get_context_data(self,**kwargs): - nastaveni = get_object_or_404(Nastaveni) - context = super().get_context_data(**kwargs) - verejne = nastaveni.aktualni_cislo.verejne() - context['verejne'] = verejne - return context +class AktualniZadaniView(generic.TemplateView): + template_name = 'seminar/treenode.html' + +# TODO Co chceme vlastně zobrazovat na této stránce? Zatím je zde aktuální číslo, ale může tu být cokoli jiného... +#class AktualniZadaniView(TreeNodeView): +# def get_object(self): +# nastaveni = get_object_or_404(Nastaveni) +# return nastaveni.aktualni_cislo.cislonode +# +# def get_context_data(self,**kwargs): +# nastaveni = get_object_or_404(Nastaveni) +# context = super().get_context_data(**kwargs) +# verejne = nastaveni.aktualni_cislo.verejne() +# context['verejne'] = verejne +# return context #def AktualniZadaniView(request): # nastaveni = get_object_or_404(Nastaveni) diff --git a/vue_frontend/src/router/index.js b/vue_frontend/src/router/index.js index 711bbc81..2dabdda5 100644 --- a/vue_frontend/src/router/index.js +++ b/vue_frontend/src/router/index.js @@ -17,6 +17,11 @@ export default new Router({ name: 'treenode', props: true, component: TreeNodeRoot + }, { + path: '/zadani/aktualni', + name: 'treenode_zadani', + props: {'tnid': 1}, + component: TreeNodeRoot }, ] })