diff --git a/fedireads/templates/feed.html b/fedireads/templates/feed.html index 01f7acda4..475b966e7 100644 --- a/fedireads/templates/feed.html +++ b/fedireads/templates/feed.html @@ -14,7 +14,7 @@ {% endfor %} {% if shelf.size > shelf.books.count %} - See all {{ shelf.size }} + See all {{ shelf.size }} {% endif %} {% endfor %} diff --git a/fedireads/templates/shelf.html b/fedireads/templates/shelf.html new file mode 100644 index 000000000..afb6d52c1 --- /dev/null +++ b/fedireads/templates/shelf.html @@ -0,0 +1,10 @@ +{% extends 'layout.html' %} +{% block content %} + +
+
+

{% include 'snippets/username.html' %} > {{ shelf.name }}

+ {% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %} +
+
+{% endblock %} diff --git a/fedireads/templates/snippets/shelf.html b/fedireads/templates/snippets/shelf.html new file mode 100644 index 000000000..651a4808e --- /dev/null +++ b/fedireads/templates/snippets/shelf.html @@ -0,0 +1,61 @@ +{% load humanize %} +{% load fr_display %} +{% if shelf.books %} + + + + + + + + + {% if ratings %} + + {% endif %} + +{% for book in shelf.books.all %} + + + + + + + + {% if ratings %} + + {% endif %} + +{% endfor %} +
+ Cover + + Title + + Author + + Published + + Shelved + + External links + + Rating +
+ {% include 'snippets/book_cover.html' with book=book %} + + {{ book.data.title }} + + {{ book.authors.first.data.name }} + + {{ book.data.first_publish_date }} + + {{ book.added_date | naturalday }} + + OpenLibrary + + {{ ratings | dict_key:book.id | stars}} +
+{% else %} +

This shelf is empty.

+{% endif %} + diff --git a/fedireads/templates/snippets/username.html b/fedireads/templates/snippets/username.html index ff270fa32..16505c86a 100644 --- a/fedireads/templates/snippets/username.html +++ b/fedireads/templates/snippets/username.html @@ -1,2 +1,2 @@ -{% if user.name %}{{ user.name }}{% elif user.localname %}{{ user.localname }}{% else %}{{ user.username }}{% endif %} - +{% load fr_display %} +{% if user.name %}{{ user.name }}{% else %}{{ user | username }}{% endif %} diff --git a/fedireads/templates/user.html b/fedireads/templates/user.html index ff3f06ba2..9f095e462 100644 --- a/fedireads/templates/user.html +++ b/fedireads/templates/user.html @@ -1,6 +1,4 @@ {% extends 'layout.html' %} -{% load humanize %} -{% load fr_display %} {% block content %}