X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7c22547b97790b80fff2b0ddfe760925f98bc199..35ccafef8a83575ac0bf5901b58630033aa95d1e:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index 5c0f209a3..90ef8c2c1 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -768,6 +768,21 @@ def book_info(request, id, lang='pl'): return render_to_response('catalogue/book_info.html', locals(), context_instance=RequestContext(request)) + def tag_info(request, id): tag = get_object_or_404(models.Tag, id=id) return HttpResponse(tag.description) + + +def download_zip(request, format, slug): + url = None + if format == 'pdf': + url = models.Book.zip_pdf() + elif format == 'epub': + url = models.Book.zip_epub() + elif format == 'audiobook' and slug is not None: + book = models.Book.objects.get(slug=slug) + url = book.zip_audiobooks() + else: + raise Http404('No format specified for zip package') + return HttpResponseRedirect(urlquote_plus(settings.MEDIA_URL + url, safe='/?='))