mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Now displaying book covers on the interface
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -50,7 +50,9 @@ body{
|
|||||||
}
|
}
|
||||||
.shelf{
|
.shelf{
|
||||||
grid-area: shelf;
|
grid-area: shelf;
|
||||||
margin: 0px auto 0px auto;
|
margin: 0px 0px;
|
||||||
|
padding: 0px;
|
||||||
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
.shelf_contents{
|
.shelf_contents{
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -67,3 +69,15 @@ body{
|
|||||||
height: 50px;
|
height: 50px;
|
||||||
width: 91px;
|
width: 91px;
|
||||||
}
|
}
|
||||||
|
#book_shelf{
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 25% 25% 25% 25%;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
.shelf_item{
|
||||||
|
|
||||||
|
}
|
||||||
|
.book_thumb{
|
||||||
|
width: 300px;
|
||||||
|
height: 375px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="shelf">
|
<div class="shelf">
|
||||||
<div class="shelf_contents" >
|
<div class="shelf_contents" >
|
||||||
<ul>
|
<ul id="book_shelf">
|
||||||
{% for book in Books %}
|
{% for book in Books %}
|
||||||
<li>{{ book.title }} <img alt="Embedded Image" src="data:image;base64,{{ book.cover[2:-2]|bin_2_img }}" style="width:50px;height:50px;"/> </li>
|
<li class="shelf_item"><img alt="{{ book.title }}" src="data:image;base64,{{ book.cover | bin_2_img }}" class="book_thumb"/> </li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ register = template.Library()
|
|||||||
|
|
||||||
@register.filter
|
@register.filter
|
||||||
def bin_2_img(_bin):
|
def bin_2_img(_bin):
|
||||||
if _bin is not None: return b64encode(_bin)
|
if _bin is not None: return b64encode(_bin).decode('utf-8')
|
||||||
|
|||||||
Reference in New Issue
Block a user