diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index b4abd690..71947aea 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -117,14 +117,14 @@ body { } /** Book covers + * + * The book cover takes the full width of its ancestor’s layout. ******************************************************************************/ - .cover-container { - height: 250px; - width: max-content; - max-width: 250px; + position: relative; } +/* .cover-container.is-large { height: max-content; max-width: 330px; @@ -153,26 +153,25 @@ body { height: 100px; } } +*/ .book-cover { - height: 100%; - object-fit: scale-down; + display: block; + width: 100%; + + /* Usweful when stretching under-sized images. */ + image-rendering: optimizeQuality; } -.no-cover { - position: relative; - white-space: normal; -} - -.no-cover div { +.no-cover .cover_caption { position: absolute; padding: 1em; color: white; top: 0; left: 0; - text-align: center; } +/* .cover-container.is-medium .no-cover div { font-size: 0.9em; padding: 0.3em; @@ -182,6 +181,7 @@ body { font-size: 0.7em; padding: 0.1em; } +*/ /** Avatars ******************************************************************************/ diff --git a/bookwyrm/templates/discover/large-book.html b/bookwyrm/templates/discover/large-book.html index 44b91b94..303d7318 100644 --- a/bookwyrm/templates/discover/large-book.html +++ b/bookwyrm/templates/discover/large-book.html @@ -1,19 +1,36 @@ + {% load bookwyrm_tags %} {% load i18n %} + {% if book %} -
-
- {% include 'snippets/book_cover.html' with book=book size="large" %} - {% include 'snippets/stars.html' with rating=book|rating:request.user %} -
-
-

{{ book.title }}

- {% if book.authors %} -

{% trans "by" %} {% include 'snippets/authors.html' with book=book %}

- {% endif %} - {% if book|book_description %} -
{{ book|book_description|to_markdown|safe|truncatewords_html:50 }}
- {% endif %} -
-
+ {% with book=book %} +
+
+ {% include 'snippets/book_cover.html' with size="large" %} + + {% include 'snippets/stars.html' with rating=book|rating:request.user %} +
+ +
+

+ {{ book.title }} +

+ + {% if book.authors %} +

+ {% trans "by" %} + {% include 'snippets/authors.html' %} +

+ {% endif %} + + {% if book|book_description %} +
+ {{ book|book_description|to_markdown|safe|truncatewords_html:50 }} +
+ {% endif %} +
+
+ {% endwith %} {% endif %} diff --git a/bookwyrm/templates/discover/small-book.html b/bookwyrm/templates/discover/small-book.html index 6df27746..f80a2690 100644 --- a/bookwyrm/templates/discover/small-book.html +++ b/bookwyrm/templates/discover/small-book.html @@ -1,12 +1,24 @@ + {% load bookwyrm_tags %} {% load i18n %} + {% if book %} -{% include 'snippets/book_cover.html' with book=book %} -{% include 'snippets/stars.html' with rating=book|rating:request.user %} + {% with book=book %} + {% include 'snippets/book_cover.html' with size="small" %} -

{{ book.title }}

-{% if book.authors %} -

{% trans "by" %} {% include 'snippets/authors.html' with book=book %}

-{% endif %} + {% include 'snippets/stars.html' with rating=book|rating:request.user %} +

+ {{ book.title }} +

+ + {% if book.authors %} +

+ {% trans "by" %} + {% include 'snippets/authors.html' %} +

+ {% endif %} + {% endwith %} {% endif %} diff --git a/bookwyrm/templates/snippets/book_cover.html b/bookwyrm/templates/snippets/book_cover.html index ce47819e..f26974d2 100644 --- a/bookwyrm/templates/snippets/book_cover.html +++ b/bookwyrm/templates/snippets/book_cover.html @@ -3,27 +3,48 @@ {% load bookwyrm_tags %} {% load i18n %} -
- {% if book.cover %} - {{ book.alt_text }} - {% else %} -
- {% trans +
+ {% endspaceless %}