From 436afb0ebdd98bd87d36aa073405b14320a969d9 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 28 Jul 2021 13:17:56 -0700 Subject: [PATCH 1/3] Fixes heirarchy and classes in feed layout --- bookwyrm/templates/feed/feed_layout.html | 132 ++++++++++++----------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/bookwyrm/templates/feed/feed_layout.html b/bookwyrm/templates/feed/feed_layout.html index 3c6b65a1b..224fac033 100644 --- a/bookwyrm/templates/feed/feed_layout.html +++ b/bookwyrm/templates/feed/feed_layout.html @@ -7,82 +7,84 @@
{% if user.is_authenticated %}
-

{% trans "Your books" %}

- {% if not suggested_books %} -

{% trans "There are no books here right now! Try searching for a book to get started" %}

- {% else %} - {% with active_book=request.GET.book %} -
-
-
    +
    +

    {% trans "Your books" %}

    + {% if not suggested_books %} +

    {% trans "There are no books here right now! Try searching for a book to get started" %}

    + {% else %} + {% with active_book=request.GET.book %} +
    +
    +
      + {% for shelf in suggested_books %} + {% if shelf.books %} + {% with shelf_counter=forloop.counter %} +
    • +

      + {% if shelf.identifier == 'to-read' %}{% trans "To Read" %} + {% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %} + {% elif shelf.identifier == 'read' %}{% trans "Read" %} + {% else %}{{ shelf.name }}{% endif %} +

      +
      + +
      +
    • + {% endwith %} + {% endif %} + {% endfor %} +
    +
    {% for shelf in suggested_books %} - {% if shelf.books %} {% with shelf_counter=forloop.counter %} -
  • -

    - {% if shelf.identifier == 'to-read' %}{% trans "To Read" %} - {% elif shelf.identifier == 'reading' %}{% trans "Currently Reading" %} - {% elif shelf.identifier == 'read' %}{% trans "Read" %} - {% else %}{{ shelf.name }}{% endif %} -

    -
    - -
    -
  • - {% endwith %} - {% endif %} - {% endfor %} -
-
- {% for shelf in suggested_books %} - {% with shelf_counter=forloop.counter %} - {% for book in shelf.books %} -
+ {% for book in shelf.books %} +
-
-
-
-

{% include 'snippets/book_titleby.html' with book=book %}

- {% include 'snippets/shelve_button/shelve_button.html' with book=book %} +
+
+
+

{% include 'snippets/book_titleby.html' with book=book %}

+ {% include 'snippets/shelve_button/shelve_button.html' with book=book %} +
+
+
+ {% trans "Close" as button_text %} + {% include 'snippets/toggle/toggle_button.html' with label=button_text controls_text="book" controls_uid=book.id class="delete" nonbutton=True pressed=True %}
-
- {% trans "Close" as button_text %} - {% include 'snippets/toggle/toggle_button.html' with label=button_text controls_text="book" controls_uid=book.id class="delete" nonbutton=True pressed=True %} +
+ {% include 'snippets/create_status.html' with book=book %}
-
- {% include 'snippets/create_status.html' with book=book %} -
+ {% endfor %} + {% endwith %} + {% endfor %}
- {% endfor %} {% endwith %} - {% endfor %} -
- {% endwith %} - {% endif %} + {% endif %} + {% if goal %} -
+

{% blocktrans with yar=goal.year %}{{ year }} Reading Goal{% endblocktrans %}

{% include 'snippets/goal_progress.html' with goal=goal %} From c9602e28ce5b997d6b35a8976bcad27aacf3819b Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 28 Jul 2021 13:19:56 -0700 Subject: [PATCH 2/3] Use consistant header size --- bookwyrm/templates/feed/feed_layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/templates/feed/feed_layout.html b/bookwyrm/templates/feed/feed_layout.html index 224fac033..57305df72 100644 --- a/bookwyrm/templates/feed/feed_layout.html +++ b/bookwyrm/templates/feed/feed_layout.html @@ -8,7 +8,7 @@ {% if user.is_authenticated %}
-

{% trans "Your books" %}

+

{% trans "Your books" %}

{% if not suggested_books %}

{% trans "There are no books here right now! Try searching for a book to get started" %}

{% else %} From 7f44693e0c3e4ce0d17b127884839e5cb60b032c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 28 Jul 2021 13:21:42 -0700 Subject: [PATCH 3/3] Renames feed layout file to be more consistent with other templates --- bookwyrm/templates/feed/direct_messages.html | 2 +- bookwyrm/templates/feed/feed.html | 2 +- bookwyrm/templates/feed/{feed_layout.html => layout.html} | 0 bookwyrm/templates/feed/status.html | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename bookwyrm/templates/feed/{feed_layout.html => layout.html} (100%) diff --git a/bookwyrm/templates/feed/direct_messages.html b/bookwyrm/templates/feed/direct_messages.html index 0b7dcd79c..30a50cd0a 100644 --- a/bookwyrm/templates/feed/direct_messages.html +++ b/bookwyrm/templates/feed/direct_messages.html @@ -1,4 +1,4 @@ -{% extends 'feed/feed_layout.html' %} +{% extends 'feed/layout.html' %} {% load i18n %} {% block panel %} diff --git a/bookwyrm/templates/feed/feed.html b/bookwyrm/templates/feed/feed.html index 21e71ae18..44ee5c930 100644 --- a/bookwyrm/templates/feed/feed.html +++ b/bookwyrm/templates/feed/feed.html @@ -1,4 +1,4 @@ -{% extends 'feed/feed_layout.html' %} +{% extends 'feed/layout.html' %} {% load i18n %} {% block panel %} diff --git a/bookwyrm/templates/feed/feed_layout.html b/bookwyrm/templates/feed/layout.html similarity index 100% rename from bookwyrm/templates/feed/feed_layout.html rename to bookwyrm/templates/feed/layout.html diff --git a/bookwyrm/templates/feed/status.html b/bookwyrm/templates/feed/status.html index 9f90f355d..903ca7907 100644 --- a/bookwyrm/templates/feed/status.html +++ b/bookwyrm/templates/feed/status.html @@ -1,4 +1,4 @@ -{% extends 'feed/feed_layout.html' %} +{% extends 'feed/layout.html' %} {% load i18n %} {% block panel %}