Massive UI/UX Overhaul

This commit is contained in:
Raelon Masters
2020-06-19 02:00:01 -04:00
parent 6a28660e95
commit 4a85b21631
163 changed files with 1504 additions and 591 deletions

View File

@@ -187,7 +187,29 @@ def download(request, pk):
response["Content-Disposition"] = "attachment; filename=%s" % _fn
return response
def favorite(request, pk):
"""
Favorite 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 share(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