diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index 67eb1eba..a8a29fa2 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -256,3 +256,41 @@ body { opacity: 0.5; cursor: not-allowed; } + +/* Book preview table + ******************************************************************************/ + +@media only screen and (max-width: 768px) { + table.is-mobile, table.is-mobile tbody { + display: block; + } + table.is-mobile tr { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + border-top: 1px solid #dbdbdb; + } + table.is-mobile td { + display: block; + box-sizing: border-box; + flex: 1 0 100%; + order: 2; + border-bottom: 0; + } + table.is-mobile td.book-preview-top-row { + order: 1; + flex-basis: auto; + } + table.is-mobile td[data-title]:not(:empty)::before { + content: attr(data-title); + display: block; + font-size: .75em; + font-weight: bold; + } + table.is-mobile td:empty { + padding: 0; + } + table.is-mobile th, table.is-mobile thead { + display: none; + } +} diff --git a/bookwyrm/templates/user/shelf.html b/bookwyrm/templates/user/shelf.html index 0732327b..947e9f70 100644 --- a/bookwyrm/templates/user/shelf.html +++ b/bookwyrm/templates/user/shelf.html @@ -68,63 +68,66 @@
{% trans "Cover" %} | -{% trans "Title" %} | -{% trans "Author" %} | -{% trans "Shelved" %} | -{% trans "Started" %} | -{% trans "Finished" %} | - {% if ratings %}{% trans "Rating" %} | {% endif %} - {% if shelf.user == request.user %} - - {% endif %} -|
---|---|---|---|---|---|---|---|
- {% include 'snippets/book_cover.html' with book=book size="small" %} - | -- {{ book.title }} - | -- {% include 'snippets/authors.html' %} - | -- {{ book.created_date | naturalday }} - | - {% latest_read_through book user as read_through %} -- {{ read_through.start_date | naturalday |default_if_none:""}} - | -- {{ read_through.finish_date | naturalday |default_if_none:""}} - | - {% if ratings %} -- {% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %} - | - {% endif %} - {% if shelf.user == request.user %} -- {% with right=True %} - {% if not shelf.id %} - {% active_shelf book as current %} - {% include 'snippets/shelf_selector.html' with current=current.shelf class="is-small" %} - {% else %} - {% include 'snippets/shelf_selector.html' with current=shelf class="is-small" %} - {% endif %} - {% endwith %} - | - {% endif %} -
{% trans "Cover" %} | +{% trans "Title" %} | +{% trans "Author" %} | +{% trans "Shelved" %} | +{% trans "Started" %} | +{% trans "Finished" %} | + {% if ratings %}{% trans "Rating" %} | {% endif %} + {% if shelf.user == request.user %} + + {% endif %} +|
---|---|---|---|---|---|---|---|
+ {% include 'snippets/book_cover.html' with book=book size="small" %} + | ++ {{ book.title }} + | ++ {% include 'snippets/authors.html' %} + | ++ {{ book.created_date | naturalday }} + | + {% latest_read_through book user as read_through %} ++ {{ read_through.start_date | naturalday |default_if_none:""}} + | ++ {{ read_through.finish_date | naturalday |default_if_none:""}} + | + {% if ratings %} ++ {% include 'snippets/stars.html' with rating=ratings|dict_key:book.id %} + | + {% endif %} + {% if shelf.user == request.user %} ++ {% with right=True %} + {% if not shelf.id %} + {% active_shelf book as current %} + {% include 'snippets/shelf_selector.html' with current=current.shelf class="is-small" %} + {% else %} + {% include 'snippets/shelf_selector.html' with current=shelf class="is-small" %} + {% endif %} + {% endwith %} + | + {% endif %} +
{% trans "This shelf is empty." %}
{% if shelf.id and shelf.editable %}