Updated to show collections in navigation.

This commit is contained in:
th3r00t
2023-11-10 00:53:32 -05:00
parent 551feb9e0e
commit 4e0997df06
6 changed files with 105 additions and 47 deletions

View File

@@ -2,7 +2,7 @@
{% block javascript %}
<script type="text/javascript" src=static/script/pako.min.js>
<script type="text/javascript">
var books = {{ books|books_tojson }};
const books = {{ books|books_tojson }};
let inflatedJSON = {};
const pako = require('pako');
inflatedJSON = JSON.parse(pako.inflate(books, { to: 'string'}));
@@ -10,26 +10,31 @@
{% endblock %}
{% include 'header.html' %}
{% include 'navigation.html' %}
<section id="master">
<div class="container is-dark">
{% for book in books %}
{% set cover = book[0].cover|b64decode %}
{% if cover != 'None' %}
<div class="box is-dark book" id="{{book[0].id}}">
<div class="image book-thumbnail">
<figure class="image is-4by3">
<img src="data:;base64,{{ book[0].cover|b64decode }}" alt="{{ book[0].title }}">
</figure>
</div>
</div>
{% else %}
<div class="box is-dark book" id="{{book[0].id}}">
<h3 class="title is-3">{{ book[0].title }}</h3>
<h4 class="subtitle is-4">{{ book[0].author }}</h4>
<p class="content">{{ book[0].description|summarize }}</p>
</div>
{% endif %}
{% endfor %}
</div>
</section>
<section id="master-container">
<div id="book-shelf" class="container is-dark">
{% for book in books %}
{% set cover = book[0].cover|b64decode %}
{% if cover != 'None' %}
<div class="is-dark book" id="{{book[0].id}}">
<div class="image book-thumbnail">
<figure class="image is-4by3">
<img src="data:;base64,{{ book[0].cover|b64decode }}" alt="{{ book[0].title }}">
</figure>
</div>
</div>
{% else %}
<div class="is-dark book" id="{{book[0].id}}">
<div class="image book-thumbnail">
<figure class="image is-4by3">
<img src="static/images/no-cover.jpg" alt="{{ book[0].title }}">
</figure>
</div>
<h3 class="title is-3">{{ book[0].title }}</h3>
<h4 class="subtitle is-4">{{ book[0].author }}</h4>
<p class="content">{{ book[0].description|summarize }}</p>
</div>
{% endif %}
{% endfor %}
</div>
</section>
{% include 'footer.html' %}