|
@ -6,7 +6,6 @@ from django.core.mail import EmailMessage |
|
|
from django.db.models import Count,Q |
|
|
from django.db.models import Count,Q |
|
|
|
|
|
|
|
|
from .models import Oprava,Komentar,KorekturovanePDF, Organizator |
|
|
from .models import Oprava,Komentar,KorekturovanePDF, Organizator |
|
|
from .forms import OpravaForm |
|
|
|
|
|
|
|
|
|
|
|
class KorekturyListView(generic.ListView): |
|
|
class KorekturyListView(generic.ListView): |
|
|
model = KorekturovanePDF |
|
|
model = KorekturovanePDF |
|
@ -54,7 +53,6 @@ class KorekturySeskupeneListView(KorekturyAktualniListView): |
|
|
class KorekturyView(generic.TemplateView): |
|
|
class KorekturyView(generic.TemplateView): |
|
|
model = Oprava |
|
|
model = Oprava |
|
|
template_name = 'korektury/opraf.html' |
|
|
template_name = 'korektury/opraf.html' |
|
|
form_class = OpravaForm |
|
|
|
|
|
|
|
|
|
|
|
def setup(self, request, *args, **kwargs): |
|
|
def setup(self, request, *args, **kwargs): |
|
|
super().setup(request, *args, **kwargs) |
|
|
super().setup(request, *args, **kwargs) |
|
@ -62,7 +60,6 @@ class KorekturyView(generic.TemplateView): |
|
|
self.pdf = get_object_or_404(KorekturovanePDF, id=self.pdf_id) |
|
|
self.pdf = get_object_or_404(KorekturovanePDF, id=self.pdf_id) |
|
|
|
|
|
|
|
|
def post(self, request, *args, **kwargs): |
|
|
def post(self, request, *args, **kwargs): |
|
|
form = self.form_class(request.POST) |
|
|
|
|
|
q = request.POST |
|
|
q = request.POST |
|
|
scroll = q.get('scroll') |
|
|
scroll = q.get('scroll') |
|
|
|
|
|
|
|
@ -200,7 +197,6 @@ class KorekturyView(generic.TemplateView): |
|
|
context['img_prefix'] = self.pdf.get_prefix() |
|
|
context['img_prefix'] = self.pdf.get_prefix() |
|
|
context['img_path'] = settings.KOREKTURY_IMG_DIR |
|
|
context['img_path'] = settings.KOREKTURY_IMG_DIR |
|
|
context['img_indexes'] = range(self.pdf.stran) |
|
|
context['img_indexes'] = range(self.pdf.stran) |
|
|
context['form_oprava'] = OpravaForm() |
|
|
|
|
|
opravy = Oprava.objects.filter(pdf=self.pdf_id) |
|
|
opravy = Oprava.objects.filter(pdf=self.pdf_id) |
|
|
zasluhy = {} |
|
|
zasluhy = {} |
|
|
for o in opravy: |
|
|
for o in opravy: |
|
@ -233,6 +229,3 @@ class KorekturyView(generic.TemplateView): |
|
|
context['zasluhy'] = zasluhy |
|
|
context['zasluhy'] = zasluhy |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
def form_valid(self,form): |
|
|
|
|
|
return super().form_valid(form) |
|
|
|
|
|
|
|
|
|
|
|