diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index 71947aea..5ef6e61a 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -124,6 +124,14 @@ body { position: relative; } +.cover-container.is-small { + height: 100px; +} + +.cover-container.is-medium { + height: 150px; +} + /* .cover-container.is-large { height: max-content; @@ -135,14 +143,6 @@ body { height: auto; } -.cover-container.is-medium { - height: 150px; -} - -.cover-container.is-small { - height: 100px; -} - @media only screen and (max-width: 768px) { .cover-container { height: 200px; @@ -163,6 +163,11 @@ body { image-rendering: optimizeQuality; } +[class~="has-height"] .book-cover { + width: auto; + height: 100%; +} + .no-cover .cover_caption { position: absolute; padding: 1em; diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index f1aaaf51..28850673 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -49,7 +49,7 @@
- {% include 'snippets/book_cover.html' with book=book size=large %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-large' %} {% include 'snippets/rate_action.html' with user=request.user book=book %}
diff --git a/bookwyrm/templates/book/edit_book.html b/bookwyrm/templates/book/edit_book.html index 1702cf5d..7f8644b4 100644 --- a/bookwyrm/templates/book/edit_book.html +++ b/bookwyrm/templates/book/edit_book.html @@ -170,7 +170,7 @@

{% trans "Cover" %}

- {% include 'snippets/book_cover.html' with book=book size="small" %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-small' %}
diff --git a/bookwyrm/templates/book/editions.html b/bookwyrm/templates/book/editions.html index 70f067f7..4ec39218 100644 --- a/bookwyrm/templates/book/editions.html +++ b/bookwyrm/templates/book/editions.html @@ -16,7 +16,7 @@
diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html index 303d7318..408e20c0 100644 --- a/bookwyrm/templates/discover/large-book.html +++ b/bookwyrm/templates/discover/large-book.html @@ -8,7 +8,7 @@
{% include 'snippets/book_cover.html' with size="large" %} + >{% include 'snippets/book_cover.html' with cover_class='is-large' %} {% include 'snippets/stars.html' with rating=book|rating:request.user %}
diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html index f80a2690..048e5a71 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/discover/small-book.html @@ -6,7 +6,7 @@ {% with book=book %} {% include 'snippets/book_cover.html' with size="small" %} + >{% include 'snippets/book_cover.html' with cover_class='is-small' %} {% include 'snippets/stars.html' with rating=book|rating:request.user %} diff --git a/bookwyrm/templates/feed/feed_layout.html b/bookwyrm/templates/feed/feed_layout.html index edbab016..15e84a59 100644 --- a/bookwyrm/templates/feed/feed_layout.html +++ b/bookwyrm/templates/feed/feed_layout.html @@ -37,7 +37,7 @@ aria-label="{{ book.title }}" aria-selected="{% if active_book == book.id|stringformat:'d' %}true{% elif shelf_counter == 1 and forloop.first %}true{% else %}false{% endif %}" aria-controls="book-{{ book.id }}"> - {% include 'snippets/book_cover.html' with book=book size="medium" %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-medium' %} {% endfor %} diff --git a/bookwyrm/templates/import_status.html b/bookwyrm/templates/import_status.html index c2985c12..d85bb7fb 100644 --- a/bookwyrm/templates/import_status.html +++ b/bookwyrm/templates/import_status.html @@ -125,7 +125,7 @@ {% if item.book %} - {% include 'snippets/book_cover.html' with book=item.book size='small' %} + {% include 'snippets/book_cover.html' with book=item.book cover_class='is-small' %} {% endif %} diff --git a/bookwyrm/templates/lists/curate.html b/bookwyrm/templates/lists/curate.html index 995ba161..fa6a8fb9 100644 --- a/bookwyrm/templates/lists/curate.html +++ b/bookwyrm/templates/lists/curate.html @@ -32,7 +32,7 @@ href="{{ book.local_path }}" aria-hidden="true" > - {% include 'snippets/book_cover.html' with size="small" %} + {% include 'snippets/book_cover.html' with cover_class='is-small' %}
diff --git a/bookwyrm/templates/lists/list_items.html b/bookwyrm/templates/lists/list_items.html index 3e3e8bf4..ddc2fff0 100644 --- a/bookwyrm/templates/lists/list_items.html +++ b/bookwyrm/templates/lists/list_items.html @@ -8,11 +8,19 @@ {{ list.name }} {% include 'snippets/privacy-icons.html' with item=list %} -
- {% for book in list.listitem_set.all|slice:5 %} - {% include 'snippets/book_cover.html' with book=book.book size="small" %} - {% endfor %} -
+ + {% with list_books=list.listitem_set.all|slice:5 %} + {% if list_books %} + + {% endif %} + {% endwith %} +
{% if list.description %} diff --git a/bookwyrm/templates/lists/lists.html b/bookwyrm/templates/lists/lists.html index c7d789d0..a7a54811 100644 --- a/bookwyrm/templates/lists/lists.html +++ b/bookwyrm/templates/lists/lists.html @@ -28,7 +28,7 @@
{% if lists %} -
+
{% include 'lists/list_items.html' with lists=lists %}
diff --git a/bookwyrm/templates/snippets/book_cover.html b/bookwyrm/templates/snippets/book_cover.html index b1166f7f..b994343e 100644 --- a/bookwyrm/templates/snippets/book_cover.html +++ b/bookwyrm/templates/snippets/book_cover.html @@ -9,21 +9,20 @@ is-clipped is-flex is-align-items-center + {{ cover_class }} {% if not book.cover %} no-cover {% endif %} - - {% if size %} - is-{{ size }} - {% endif %} - - {% if container_class %} - {{ container_class }} - {% endif %} " - aria-hidden="true" + {% if aria != "show" %} + aria-hidden="true" + {% endif %} + + {% if book.alt_text %} + title="{{ book.alt_text }}" + {% endif %} > {{ book.alt_text }} - {% include 'snippets/book_cover.html' with book=result container_class='column' img_path=false %} + {% include 'snippets/book_cover.html' with book=result cover_class='column' img_path=false %}

diff --git a/bookwyrm/templates/snippets/status/generated_status.html b/bookwyrm/templates/snippets/status/generated_status.html index cb65a6f2..0b673037 100644 --- a/bookwyrm/templates/snippets/status/generated_status.html +++ b/bookwyrm/templates/snippets/status/generated_status.html @@ -8,7 +8,7 @@

diff --git a/bookwyrm/templates/user/shelf.html b/bookwyrm/templates/user/shelf.html index 0732327b..d9f264ea 100644 --- a/bookwyrm/templates/user/shelf.html +++ b/bookwyrm/templates/user/shelf.html @@ -86,7 +86,7 @@ {% for book in books %} - {% include 'snippets/book_cover.html' with book=book size="small" %} + {% include 'snippets/book_cover.html' with book=book cover_class='is-small' %} {{ book.title }} diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index a54664ce..9b0c6991 100644 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -36,7 +36,7 @@ {% for book in shelf.books %} {% endfor %}