Start on download system

This commit is contained in:
Mike Young
2019-11-18 12:46:58 -05:00
parent 9cd352c319
commit 765a93a2c8
8 changed files with 26 additions and 10 deletions

View File

@@ -44,6 +44,8 @@ body{
}
.app_footer{
grid-area: app_footer;
position: fixed;
bottom: 0px;
}
.left_col{
grid-area: left_col
@@ -73,11 +75,20 @@ body{
display: grid;
grid-template-columns: 25% 25% 25% 25%;
list-style-type: none;
font-family: 'Audiowide', cursive;
font-size: 25px;
}
.shelf_item{
background-color: burlywood;
margin: 10px 0px;
max-width: 300px;
max-height: 375px;
text-align: center;
}
.book_thumb{
width: 300px;
height: 375px;
}
a.book_link{
text-decoration: none;
}

View File

@@ -17,13 +17,13 @@
</div>
<div class="app_body" >
<div class="left_col">
left_col
Navigation and page controls will go here
</div>
<div class="shelf">
<div class="shelf_contents" >
<ul id="book_shelf">
{% for book in Books %}
<li class="shelf_item"><img alt="{{ book.title }}" src="data:image;base64,{{ book.cover | bin_2_img }}" class="book_thumb"/> </li>
<a href="{% url 'download' book.file_name %}" class="book_link"><li class="shelf_item"><img alt="{{ book.title }}" src="data:image;base64,{{ book.cover | bin_2_img }}" class="book_thumb"/> </li></a>
{% endfor %}
</ul>
</div>

View File

@@ -1,4 +1,5 @@
from django.shortcuts import render
from xsendfile import XSendfileApplication
from .models import Books
@@ -7,6 +8,10 @@ def index(request):
return render(request, "index.html", {"Books": Books.objects.all()})
def download(request):
return XSendfileApplication(file_name)
def book_set(_set):
r = 20
x = _set * r