Korektury se uz radi spravne pod sebe.

This commit is contained in:
Tomas "Jethro" Pokorny 2015-12-06 11:26:02 +01:00
parent 4aac66006a
commit cdbe5ff5db
2 changed files with 6 additions and 2 deletions

View file

@ -158,8 +158,8 @@
{% endfor %}
<script>
{% for o in opravy %}
place_comments_one_div("img-{{o.strana}}", [["op{{o.id}}",{{o.x}},{{o.y}}]]);
{% for s in opravy_strany %}
place_comments_one_div("img-{{s.strana}}", [{% for o in s.op_id %}["op{{o.id}}",{{o.x}},{{o.y}}],{% endfor %}[]]);
{% endfor %}
{% if scroll %}
window.scrollTo(0,{{scroll}});

View file

@ -136,6 +136,10 @@ class KorekturyView(generic.TemplateView):
else:
zasluhy[k.autor]=1
strany = opravy.values('strana')
opravy_na_stranu = [{'strana':s['strana'],'op_id':opravy.filter(strana=s['strana'])} for s in strany]
context['opravy_strany'] = opravy_na_stranu
context['opravy'] = opravy
context['zasluhy'] = zasluhy
return context