diff --git a/fedireads/static/js/feed.js b/fedireads/static/js/feed.js deleted file mode 100644 index dd6b186f1..000000000 --- a/fedireads/static/js/feed.js +++ /dev/null @@ -1,11 +0,0 @@ -function show_compose(element) { - var visible_compose_boxes = document.getElementsByClassName('visible'); - for (var i = 0; i < visible_compose_boxes.length; i++) { - visible_compose_boxes[i].className = 'compose-suggestion'; - } - - var target_id = 'compose-' + element.id; - var target = document.getElementById(target_id); - target.className += ' visible'; -} - diff --git a/fedireads/static/js/shared.js b/fedireads/static/js/shared.js index 87c3a1239..c63e44ca4 100644 --- a/fedireads/static/js/shared.js +++ b/fedireads/static/js/shared.js @@ -1,3 +1,14 @@ +function show_compose(element) { + var visible_compose_boxes = document.getElementsByClassName('visible'); + for (var i = 0; i < visible_compose_boxes.length; i++) { + visible_compose_boxes[i].className = 'compose-suggestion'; + } + + var target_id = 'compose-' + element.id; + var target = document.getElementById(target_id); + target.className += ' visible'; +} + function hide_element(element) { var classes = element.parentElement.className; element.parentElement.className = classes.replace('visible', ''); diff --git a/fedireads/templates/feed.html b/fedireads/templates/feed.html index 87e7fc2a1..f77865eab 100644 --- a/fedireads/templates/feed.html +++ b/fedireads/templates/feed.html @@ -2,22 +2,8 @@ {% load fr_display %} {% block content %} -
- {% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %} -
+{% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %} -{% for shelf in shelves %} - {% for book in shelf.books %} -
- - Close - -
- {% include 'snippets/create_status.html' with book=book user=request.user %} -
-
- {% endfor %} -{% endfor %}
@@ -31,5 +17,4 @@ {% endfor %}
- {% endblock %} diff --git a/fedireads/templates/snippets/covers_shelf.html b/fedireads/templates/snippets/covers_shelf.html index 74c59341b..feddbfa75 100644 --- a/fedireads/templates/snippets/covers_shelf.html +++ b/fedireads/templates/snippets/covers_shelf.html @@ -1,20 +1,36 @@ {% load fr_display %} -{% for shelf in shelves %} -{% if shelf.books %} -
-

{{ shelf.name }} - {% if shelf.size > shelf.books|length %} - (See all {{ shelf.size }}) - {% endif %} -

-
- {% for book in shelf.books %} -
- {% include 'snippets/book_cover.html' with book=book %} - {% include 'snippets/shelve_button.html' with book=book %} + +
+ {% for shelf in shelves %} + {% if shelf.books %} +
+

{{ shelf.name }} + {% if shelf.size > shelf.books|length %} + (See all {{ shelf.size }}) + {% endif %} +

+
+ {% for book in shelf.books %} +
+ {% include 'snippets/book_cover.html' with book=book %} + {% include 'snippets/shelve_button.html' with book=book %} +
+ {% endfor %}
- {% endfor %} +
+ {% endif %} + {% endfor %} +
+ +{% for shelf in shelves %} + {% for book in shelf.books %} +
+ + Close + +
+ {% include 'snippets/create_status.html' with book=book user=request.user %}
-{% endif %} + {% endfor %} {% endfor %} diff --git a/fedireads/templates/user.html b/fedireads/templates/user.html index ca67750a8..bfb16fc7a 100644 --- a/fedireads/templates/user.html +++ b/fedireads/templates/user.html @@ -2,9 +2,7 @@ {% block content %} {% include 'user_header.html' with user=user %} -
- {% include 'snippets/covers_shelf.html' with shelves=shelves user=user %} -
+{% include 'snippets/covers_shelf.html' with shelves=shelves user=user %}

User Activity