mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Added Font-Awesome, and more UI/UX tweaks
This commit is contained in:
@@ -210,6 +210,19 @@ def share(request, pk):
|
||||
)
|
||||
response["Content-Disposition"] = "attachment; filename=%s" % _fn
|
||||
return response
|
||||
|
||||
def info(request, pk):
|
||||
"""
|
||||
Share book by primary key
|
||||
"""
|
||||
_book = Books.objects.all().filter(pk=pk)[0]
|
||||
_fn = hr_name(_book)
|
||||
response = HttpResponse(
|
||||
open(os.path.abspath(_book.file_name), "rb"), content_type="application/zip"
|
||||
)
|
||||
response["Content-Disposition"] = "attachment; filename=%s" % _fn
|
||||
return response
|
||||
|
||||
def hr_name(book):
|
||||
"""
|
||||
Nicer file names
|
||||
|
||||
Reference in New Issue
Block a user