From a46193a37bac9882a52ee5f8e10c801f602b2491 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 23 Feb 2020 14:26:03 -0800 Subject: [PATCH] Differentiate friends/local/federated reviews --- fedireads/models/status.py | 2 + fedireads/static/format.css | 4 +- fedireads/templates/book.html | 48 +++++++++++++++++------ fedireads/templates/feed.html | 12 ++---- fedireads/templates/snippets/authors.html | 1 + fedireads/templates/snippets/book.html | 6 ++- fedireads/templates/snippets/review.html | 8 ++++ fedireads/templates/snippets/tabs.html | 8 ++++ fedireads/templates/snippets/tag.html | 2 +- fedireads/templatetags/fr_display.py | 13 ++++++ fedireads/urls.py | 1 + fedireads/views.py | 43 +++++++++++++++++--- 12 files changed, 118 insertions(+), 30 deletions(-) create mode 100644 fedireads/templates/snippets/authors.html create mode 100644 fedireads/templates/snippets/review.html create mode 100644 fedireads/templates/snippets/tabs.html diff --git a/fedireads/models/status.py b/fedireads/models/status.py index 4e3daf045..809c08f3f 100644 --- a/fedireads/models/status.py +++ b/fedireads/models/status.py @@ -7,6 +7,8 @@ import re from fedireads.utils.models import FedireadsModel +# TODO: quote, comment, poll, recommendation, content warning, image + class Status(FedireadsModel): ''' any post, like a reply to a review, etc ''' diff --git a/fedireads/static/format.css b/fedireads/static/format.css index a30c5181e..94e01dbd1 100644 --- a/fedireads/static/format.css +++ b/fedireads/static/format.css @@ -87,11 +87,11 @@ h2 { margin-right: 0; } -#feed-tabs { +.tabs { display: flex; flex-direction: row; } -.active { +.tab.active { background-color: #FF1654; } diff --git a/fedireads/templates/book.html b/fedireads/templates/book.html index 110a7f841..dbfe7e338 100644 --- a/fedireads/templates/book.html +++ b/fedireads/templates/book.html @@ -1,14 +1,15 @@ {% extends 'layout.html' %} {% load fr_display %} {% block content %} -
+ + +
+
+

{{ book.data.title }} by + {% include 'snippets/authors.html' with book=book %}

+
+ {% include 'snippets/book_cover.html' with book=book size=large %} +

{{ active_tab }} rating: {{ rating | stars }}

+ {% if description %} +
{{ book.data.description | description }}
+ {% endif %} + {% for review in user_reviews %} + {% include 'snippets/review.html' with review=review %} + {% endfor %} +
+
+ {% for tag in tags %} + {% include 'snippets/tag.html' with tag=tag user=request.user user_tags=user_tag_names %} + {% endfor %} +
+
+ +
+
+ + {% include 'snippets/tabs.html' with tabs=feed_tabs active_tab=active_tab path=path %}

Reviews

{% if not reviews %} @@ -29,13 +57,9 @@ {{ review_form.as_p }} +

Average rating: {{ rating | stars }}

{% for review in reviews %} -
-

{{ review.name }} - {{ review.rating | stars }} stars, by {% include 'snippets/username.html' with user=review.user %} -

-
{{ review.content }}
-
+ {% include 'snippets/review.html' with review=review %} {% endfor %}
diff --git a/fedireads/templates/feed.html b/fedireads/templates/feed.html index f0edc8210..a0d952af4 100644 --- a/fedireads/templates/feed.html +++ b/fedireads/templates/feed.html @@ -1,8 +1,8 @@ {% extends 'layout.html' %} {% load fr_display %} {% block content %} -