Creates snippets for discover preview boxes

This commit is contained in:
Mouse Reeve 2021-01-03 11:24:26 -08:00
parent ef42d29bd9
commit 721d20efab
4 changed files with 32 additions and 34 deletions

View file

@ -68,9 +68,12 @@ input.toggle-control:checked ~ .modal.toggle-content {
max-width: 250px;
}
.cover-container.is-large {
height: 500px;
height: max-content;
max-width: 500px;
}
.cover-container.is-large img {
max-height: 500px;
}
.cover-container.is-medium {
height: 200px;
}

View file

@ -1,5 +1,4 @@
{% extends 'layout.html' %}
{% load bookwyrm_tags %}
{% block content %}
<div class="block">
@ -31,31 +30,18 @@
<div class="tile is-vertical">
<div class="tile is-parent">
<div class="tile is-child box has-background-white-ter">
<div class="columns">
<div class="column is-narrow">
{% include 'snippets/book_cover.html' with book=books.2 size="large" %}
{% include 'snippets/stars.html' with rating=books.2.review__rating__avg %}
</div>
<div class="column">
{% include 'snippets/book_titleby.html' with book=books.2 %}
<blockquote class="content">{{ books.2|book_description|to_markdown|safe|truncatewords_html:50 }}</blockquote>
</div>
</div>
{% include 'snippets/discover/large-book.html' with book=books.0 %}
</div>
</div>
<div class="tile">
<div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter">
{% include 'snippets/book_cover.html' with book=books.0 %}
{% include 'snippets/book_titleby.html' with book=books.0 %}
{% include 'snippets/stars.html' with rating=books.0.review__rating__avg %}
{% include 'snippets/discover/small-book.html' with book=books.1 %}
</div>
</div>
<div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter">
{% include 'snippets/book_cover.html' with book=books.1 %}
{% include 'snippets/book_titleby.html' with book=books.1 %}
{% include 'snippets/stars.html' with rating=books.1.review__rating__avg %}
{% include 'snippets/discover/small-book.html' with book=books.2 %}
</div>
</div>
</div>
@ -64,31 +50,18 @@
<div class="tile">
<div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter">
{% include 'snippets/book_cover.html' with book=books.4 %}
{% include 'snippets/book_titleby.html' with book=books.4 %}
{% include 'snippets/stars.html' with rating=books.4.review__rating__avg %}
{% include 'snippets/discover/small-book.html' with book=books.3 %}
</div>
</div>
<div class="tile is-parent is-6">
<div class="tile is-child box has-background-white-ter">
{% include 'snippets/book_cover.html' with book=books.5 %}
{% include 'snippets/book_titleby.html' with book=books.5 %}
{% include 'snippets/stars.html' with rating=books.5.review__rating__avg %}
{% include 'snippets/discover/small-book.html' with book=books.4 %}
</div>
</div>
</div>
<div class="tile is-parent">
<div class="tile is-child box has-background-white-ter">
<div class="columns">
<div class="column is-narrow">
{% include 'snippets/book_cover.html' with book=books.3 size="large" %}
{% include 'snippets/stars.html' with rating=books.3.review__rating__avg %}
</div>
<div class="column">
{% include 'snippets/book_titleby.html' with book=books.3 %}
<blockquote class="content">{{ books.3|book_description|to_markdown|safe|truncatewords_html:50 }}</blockquote>
</div>
</div>
{% include 'snippets/discover/large-book.html' with book=books.5 %}
</div>
</div>
</div>

View file

@ -0,0 +1,14 @@
{% load bookwyrm_tags %}
<div class="columns">
<div class="column is-narrow">
{% include 'snippets/book_cover.html' with book=book size="large" %}
{% include 'snippets/stars.html' with rating=book.review__rating__avg %}
</div>
<div class="column">
<h3 class="title is-5"><a href="/book/{{ book.id }}">{{ book.title }}</a></h3>
{% if book.authors %}
<p class="subtitle is-5">by {% include 'snippets/authors.html' with book=book %}</p>
{% endif %}
<blockquote class="content">{{ book|book_description|to_markdown|safe|truncatewords_html:50 }}</blockquote>
</div>
</div>

View file

@ -0,0 +1,8 @@
{% include 'snippets/book_cover.html' with book=book %}
{% include 'snippets/stars.html' with rating=book.review__rating__avg %}
<h3 class="title is-6"><a href="/book/{{ book.id }}">{{ book.title }}</a></h3>
{% if book.authors %}
<p class="subtitle is-6">by {% include 'snippets/authors.html' with book=book %}</p>
{% endif %}