From 25643faf7213a8346d051d525c5996dab8d763c8 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 18 Jan 2021 12:22:11 -0800 Subject: [PATCH 1/4] Fixes misplaced close diff causing cascading nesting on editions page --- bookwyrm/templates/snippets/shelve_button.html | 2 +- bookwyrm/templates/snippets/switch_edition_button.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/snippets/shelve_button.html b/bookwyrm/templates/snippets/shelve_button.html index 0dfabe04..6630ed53 100644 --- a/bookwyrm/templates/snippets/shelve_button.html +++ b/bookwyrm/templates/snippets/shelve_button.html @@ -25,9 +25,9 @@ {% endif %} - {% include 'snippets/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%} {% endif %} + {% include 'snippets/start_reading_modal.html' with book=active_shelf.book controls_text="start-reading" controls_uid=uuid %} diff --git a/bookwyrm/templates/snippets/switch_edition_button.html b/bookwyrm/templates/snippets/switch_edition_button.html index 685aed7c..86c438b1 100644 --- a/bookwyrm/templates/snippets/switch_edition_button.html +++ b/bookwyrm/templates/snippets/switch_edition_button.html @@ -1,5 +1,5 @@
{% csrf_token %} - +
From 69b38bfe91e0b1af3e02820b4e23333e9950a35c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 18 Jan 2021 12:22:36 -0800 Subject: [PATCH 2/4] Show latest read books first in goals page --- bookwyrm/models/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 3b827077..1e9db401 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -247,7 +247,7 @@ class AnnualGoal(BookWyrmModel): ''' the books you've read this year ''' return self.user.readthrough_set.filter( finish_date__year__gte=self.year - ).order_by('finish_date').all() + ).order_by('-finish_date').all() @property From 2a6c67c4275a1c6edeb0191d6eb7cd0ee6d26c03 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 18 Jan 2021 12:25:26 -0800 Subject: [PATCH 3/4] Correct placement of shelve pulldown --- bookwyrm/templates/snippets/shelve_button.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bookwyrm/templates/snippets/shelve_button.html b/bookwyrm/templates/snippets/shelve_button.html index 6630ed53..f69ab525 100644 --- a/bookwyrm/templates/snippets/shelve_button.html +++ b/bookwyrm/templates/snippets/shelve_button.html @@ -4,11 +4,12 @@ {% with book.id|uuid as uuid %} {% active_shelf book as active_shelf %}
+ {% if switch_mode and active_shelf.book != book %}
- {% if switch_mode and active_shelf.book != book %} {% include 'snippets/switch_edition_button.html' with edition=book size='is-small' %} - {% else %} - +
+ {% else %} +
{% if active_shelf.shelf.identifier == 'read' %} {% endif %} +
{% include 'snippets/shelve_button_dropdown.html' with class="is-small" button_uuid=uuid%} {% endif %} -
{% include 'snippets/start_reading_modal.html' with book=active_shelf.book controls_text="start-reading" controls_uid=uuid %} From 7a153a99420703bd1dbc671ce864d03f4b921686 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 18 Jan 2021 12:36:34 -0800 Subject: [PATCH 4/4] Collapse status content box for empty status (like goal) this is janky... oh well --- bookwyrm/templates/snippets/components/card.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bookwyrm/templates/snippets/components/card.html b/bookwyrm/templates/snippets/components/card.html index 3c2cf9f1..f1104893 100644 --- a/bookwyrm/templates/snippets/components/card.html +++ b/bookwyrm/templates/snippets/components/card.html @@ -4,10 +4,12 @@ {% endblock %} + {% if not status or status.status_type != 'GeneratedNote' or status.book or status.mention_books.exists or status.mention_users.exists %}
{% block card-content %} {% endblock %}
+ {% endif %}