Makes covers clickable on discover page

This commit is contained in:
Mouse Reeve 2021-02-23 14:06:08 -08:00
parent fdbd3688f4
commit 31c9c07e38
4 changed files with 9 additions and 9 deletions

View file

@ -63,18 +63,18 @@
<div class="tile is-vertical"> <div class="tile is-vertical">
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/large-book.html' with book=books.0 %} {% include 'discover/large-book.html' with book=books.0 %}
</div> </div>
</div> </div>
<div class="tile"> <div class="tile">
<div class="tile is-parent is-6"> <div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/small-book.html' with book=books.1 %} {% include 'discover/small-book.html' with book=books.1 %}
</div> </div>
</div> </div>
<div class="tile is-parent is-6"> <div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/small-book.html' with book=books.2 %} {% include 'discover/small-book.html' with book=books.2 %}
</div> </div>
</div> </div>
</div> </div>
@ -83,18 +83,18 @@
<div class="tile"> <div class="tile">
<div class="tile is-parent is-6"> <div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/small-book.html' with book=books.3 %} {% include 'discover/small-book.html' with book=books.3 %}
</div> </div>
</div> </div>
<div class="tile is-parent is-6"> <div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/small-book.html' with book=books.4 %} {% include 'discover/small-book.html' with book=books.4 %}
</div> </div>
</div> </div>
</div> </div>
<div class="tile is-parent"> <div class="tile is-parent">
<div class="tile is-child box has-background-white-ter"> <div class="tile is-child box has-background-white-ter">
{% include 'snippets/discover/large-book.html' with book=books.5 %} {% include 'discover/large-book.html' with book=books.5 %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -2,7 +2,7 @@
{% if book %} {% if book %}
<div class="columns"> <div class="columns">
<div class="column is-narrow"> <div class="column is-narrow">
{% include 'snippets/book_cover.html' with book=book size="large" %} <a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book size="large" %}</a>
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %} {% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
</div> </div>
<div class="column"> <div class="column">

View file

@ -1,6 +1,6 @@
{% load bookwyrm_tags %} {% load bookwyrm_tags %}
{% if book %} {% if book %}
{% include 'snippets/book_cover.html' with book=book %} <a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book %}</a>
{% if ratings %} {% if ratings %}
{% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %} {% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %}
{% endif %} {% endif %}

View file

@ -56,4 +56,4 @@ class Discover(View):
'books': list(set(books)), 'books': list(set(books)),
'ratings': ratings 'ratings': ratings
} }
return TemplateResponse(request, 'discover.html', data) return TemplateResponse(request, 'discover/discover.html', data)