X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/2e7bf0fd9796ec992d1d9dfde2e6824961429723..fb08d6c6a6dca486303ca69b5c47dd29e548fd11:/src/catalogue/views.py?ds=inline diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 44a17b412..fd98dee23 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -628,6 +628,7 @@ class CustomPDFFormView(AjaxableFormView): form_class = forms.CustomPDFForm title = ugettext_lazy('Download custom PDF') submit = ugettext_lazy('Download') + template = 'catalogue/custom_pdf_form.html' honeypot = True def __call__(self, *args, **kwargs): @@ -784,3 +785,17 @@ def collections(request): 'objects': objects, 'best': best, }) + + +def ridero_cover(request, slug): + from librarian.cover import DefaultEbookCover + wldoc = Book.objects.get(slug=slug).wldocument() + cover = DefaultEbookCover(wldoc.book_info, width=980, bleed=20, format='PNG') + response = HttpResponse(content_type="image/png") + cover.save(response) + return response + + +def get_isbn(request, book_format, slug): + book = Book.objects.get(slug=slug) + return HttpResponse(book.extra_info.get('isbn_%s' % book_format))