|
|
@ -477,17 +477,35 @@ class OdmenyView(generic.TemplateView): |
|
|
|
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')) |
|
|
|
resitele = aktivniResitele(tocislo) |
|
|
|
frombody = body_resitelu(resitele, fromcislo) |
|
|
|
tobody = body_resitelu(resitele, tocislo) |
|
|
|
outlist = [] |
|
|
|
for (aid, tbody) in tobody.items(): |
|
|
|
fbody = frombody.get(aid,0) |
|
|
|
resitel = Resitel.objects.get(pk=aid) |
|
|
|
ftitul = resitel.get_titul(fbody) |
|
|
|
ttitul = resitel.get_titul(tbody) |
|
|
|
if ftitul != ttitul: |
|
|
|
outlist.append({'jmeno': resitel.osoba.plne_jmeno(), 'ftitul': ftitul, 'ttitul': ttitul}) |
|
|
|
context['zmeny'] = outlist |
|
|
|
|
|
|
|
def get_diff(from_deadline: Deadline, to_deadline: Deadline): |
|
|
|
frombody = body_resitelu(resitele=resitele, jen_verejne=False, do=from_deadline) |
|
|
|
tobody = body_resitelu(resitele=resitele, jen_verejne=False, do=to_deadline) |
|
|
|
outlist = [] |
|
|
|
for (aid, tbody) in tobody.items(): |
|
|
|
fbody = frombody.get(aid,0) |
|
|
|
resitel = Resitel.objects.get(pk=aid) |
|
|
|
ftitul = resitel.get_titul(fbody) |
|
|
|
ttitul = resitel.get_titul(tbody) |
|
|
|
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 |
|
|
|
|
|
|
|
|
|
|
|