|
@ -477,17 +477,35 @@ class OdmenyView(generic.TemplateView): |
|
|
fromcislo = Cislo.objects.get(rocnik=self.kwargs.get('frocnik'), poradi=self.kwargs.get('fcislo')) |
|
|
fromcislo = Cislo.objects.get(rocnik=self.kwargs.get('frocnik'), poradi=self.kwargs.get('fcislo')) |
|
|
tocislo = Cislo.objects.get(rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) |
|
|
tocislo = Cislo.objects.get(rocnik=self.kwargs.get('trocnik'), poradi=self.kwargs.get('tcislo')) |
|
|
resitele = aktivniResitele(tocislo) |
|
|
resitele = aktivniResitele(tocislo) |
|
|
frombody = body_resitelu(resitele, fromcislo) |
|
|
|
|
|
tobody = body_resitelu(resitele, tocislo) |
|
|
def get_diff(from_deadline: Deadline, to_deadline: Deadline): |
|
|
outlist = [] |
|
|
frombody = body_resitelu(resitele=resitele, jen_verejne=False, do=from_deadline) |
|
|
for (aid, tbody) in tobody.items(): |
|
|
tobody = body_resitelu(resitele=resitele, jen_verejne=False, do=to_deadline) |
|
|
fbody = frombody.get(aid,0) |
|
|
outlist = [] |
|
|
resitel = Resitel.objects.get(pk=aid) |
|
|
for (aid, tbody) in tobody.items(): |
|
|
ftitul = resitel.get_titul(fbody) |
|
|
fbody = frombody.get(aid,0) |
|
|
ttitul = resitel.get_titul(tbody) |
|
|
resitel = Resitel.objects.get(pk=aid) |
|
|
if ftitul != ttitul: |
|
|
ftitul = resitel.get_titul(fbody) |
|
|
outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) |
|
|
ttitul = resitel.get_titul(tbody) |
|
|
context['zmeny'] = outlist |
|
|
if ftitul != ttitul: |
|
|
|
|
|
outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) |
|
|
|
|
|
return outlist |
|
|
|
|
|
|
|
|
|
|
|
context["from_cislo"] = fromcislo |
|
|
|
|
|
context["to_cislo"] = tocislo |
|
|
|
|
|
context["zmeny_prvni_prvni"] = get_diff( |
|
|
|
|
|
fromcislo.zlomovy_deadline_pro_papirove_cislo(), |
|
|
|
|
|
tocislo.zlomovy_deadline_pro_papirove_cislo() |
|
|
|
|
|
) |
|
|
|
|
|
context["zmeny_prvni_posledni"] = get_diff( |
|
|
|
|
|
fromcislo.zlomovy_deadline_pro_papirove_cislo(), |
|
|
|
|
|
tocislo.posledni_deadline |
|
|
|
|
|
) |
|
|
|
|
|
context["zmeny_posledni_prvni"] = get_diff( |
|
|
|
|
|
fromcislo.posledni_deadline, |
|
|
|
|
|
tocislo.zlomovy_deadline_pro_papirove_cislo() |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|