From: Radek Czajka Date: Fri, 12 Dec 2025 14:01:33 +0000 (+0100) Subject: Shelf lists X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/29b00497f9103bb31f9e236bdf5844b9a6fa79ea?ds=sidebyside Shelf lists --- diff --git a/src/social/templates/social/my_shelf.html b/src/social/templates/social/my_shelf.html index c23eeaf44..9e3a21f54 100644 --- a/src/social/templates/social/my_shelf.html +++ b/src/social/templates/social/my_shelf.html @@ -10,9 +10,10 @@ {% endblock %} {% block main %} +{% for list in favs %}
-

{% trans "Półka" %}

+

{% trans "Ulubione" %}

@@ -20,45 +21,50 @@
- -
-
- {% trans "Sortuj:" %} -
- - - -
+
- -
- -
-

 

- {% if suggest %} -
- {% with list_type='book' %} - {% for tag in suggest %} - - {{ tag }} - - {% endfor %} - {% endwith %} -
+
+
+ {% for item in list.userlistitem_set.all %} + {% with book=item.book %} + {% if book %} + {% include "catalogue/book_box.html" %} {% endif %} + {% endwith %} + {% endfor %}
+{% endfor %} +{% for list in others %} +
+
+

{{ list.name }}

+
+
+
+
+
+ + +
+
+
-
- {% for book in books %} - {% include "catalogue/book_box.html" %} +
+ {% for item in list.userlistitem_set.all %} + {% with book=item.book %} + {% if book %} + {% include "catalogue/book_box.html" %} + {% endif %} + {% endwith %} {% endfor %}
+{% endfor %} {% endblock %} diff --git a/src/social/views.py b/src/social/views.py index 0ff077104..df944b393 100644 --- a/src/social/views.py +++ b/src/social/views.py @@ -68,13 +68,15 @@ def unlike_book(request, slug): @login_required def my_shelf(request): template_name = 'social/my_shelf.html' + favs = request.user.userlist_set.filter(favorites=True) + others = request.user.userlist_set.filter(favorites=False) ulists = list(request.user.userlist_set.all()) suggest = [t for t in ulists if t.name] return render(request, template_name, { - 'tags': ulists, - 'books': Book.objects_filter(userlistitem__list__user=request.user), - 'suggest': suggest, + 'favs': favs, + 'others': others, + #'books': Book.objects.filter(userlistitem__list__user=request.user), })