|
|
@ -43,52 +43,52 @@ class KorekturyView(generic.TemplateView): |
|
|
|
y = int(q.get('y')) |
|
|
|
text = q.get('txt') |
|
|
|
strana = int(q.get('img-id')[4:]) |
|
|
|
pdf = KorekturovanePDF.objects.filter(id=q.get('pdf')).first() |
|
|
|
pdf = KorekturovanePDF.objects.get(id=q.get('pdf')) |
|
|
|
|
|
|
|
op = Oprava(x=x,y=y, autor=autor, text=text, strana=strana,pdf = pdf) |
|
|
|
op.save() |
|
|
|
elif (action == u'del'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
op.delete() |
|
|
|
elif (action == u'update'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
text = q.get('txt') |
|
|
|
op.autor = autor |
|
|
|
op.text = text |
|
|
|
op.save() |
|
|
|
elif (action == u'undone'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
op.status = op.STATUS_K_OPRAVE |
|
|
|
op.save() |
|
|
|
elif (action == u'done'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
op.status = op.STATUS_OPRAVENO |
|
|
|
op.save() |
|
|
|
elif (action == u'wontfix'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
op.status = op.STATUS_NENI_CHYBA |
|
|
|
op.save() |
|
|
|
elif (action == u'comment'): |
|
|
|
id = int(q.get('id')) |
|
|
|
op = Oprava.objects.filter(id=id).first() |
|
|
|
op = Oprava.objects.get(id=id) |
|
|
|
text = q.get('txt') |
|
|
|
kom = Komentar(oprava=op,autor=autor,text=text) |
|
|
|
kom.save() |
|
|
|
elif (action == u'update-comment'): |
|
|
|
id = int(q.get('id')) |
|
|
|
kom = Komentar.objects.filter(id=id).first() |
|
|
|
kom = Komentar.objects.get(id=id) |
|
|
|
text = q.get('txt') |
|
|
|
kom.text = text |
|
|
|
kom.autor = autor |
|
|
|
kom.save() |
|
|
|
elif (action == u'del-comment'): |
|
|
|
id = int(q.get('id')) |
|
|
|
kom = Komentar.objects.filter(id=id).first() |
|
|
|
kom = Komentar.objects.get(id=id) |
|
|
|
kom.delete() |
|
|
|
elif (action == u'delall'): |
|
|
|
pdf = KorekturovanePDF.objects.filter(id=q.get('pdf')) |
|
|
@ -114,7 +114,7 @@ class KorekturyView(generic.TemplateView): |
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
|
context = super(KorekturyView,self).get_context_data(**kwargs) |
|
|
|
pdf = KorekturovanePDF.objects.filter(id=self.kwargs['pdf']).first() |
|
|
|
pdf = KorekturovanePDF.objects.get(id=self.kwargs['pdf']) |
|
|
|
context['pdf'] = pdf |
|
|
|
context['img_name'] = os.path.split(pdf.pdf.path)[1].split('.')[0] |
|
|
|
context['img_path'] = settings.KOREKTURY_IMG_DIR |
|
|
|