From a4d1985f86724f00aa70cf336795cf36ca5baaa4 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 28 Sep 2020 15:57:31 -0700 Subject: [PATCH] Fixes star rating displays --- bookwyrm/models/status.py | 5 ++ bookwyrm/static/css/format.css | 15 +++++ bookwyrm/templates/feed.html | 57 +++++++++---------- bookwyrm/templates/layout.html | 2 +- bookwyrm/templates/snippets/avatar.html | 2 +- bookwyrm/templates/snippets/covers_shelf.html | 4 +- bookwyrm/templates/snippets/interaction.html | 2 +- bookwyrm/templates/snippets/rate_action.html | 2 +- bookwyrm/templates/snippets/rate_form.html | 2 +- .../templates/snippets/shelve_button.html | 49 ++++++++-------- bookwyrm/templates/snippets/status.html | 5 +- .../templates/snippets/status_content.html | 6 +- .../templates/snippets/status_header.html | 50 +++++++++------- 13 files changed, 111 insertions(+), 90 deletions(-) diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 8ab3f0eb..eb79e43d 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -91,6 +91,11 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): to write this so it's just a property ''' return cls.objects.filter(reply_parent=status).select_subclasses() + @property + def status_type(self): + ''' expose the type of status for the ui using activity type ''' + return self.activity_serializer.__name__ + def to_replies(self, **kwargs): ''' helper function for loading AP serialized replies to a status ''' return self.to_ordered_collection( diff --git a/bookwyrm/static/css/format.css b/bookwyrm/static/css/format.css index 98b560d9..65c5f6f2 100644 --- a/bookwyrm/static/css/format.css +++ b/bookwyrm/static/css/format.css @@ -38,3 +38,18 @@ input.toggle-control { input.toggle-control:checked ~ .toggle-content { display: block; } + +/* --- STARS --- */ +.rate-stars button.icon { + background: none; + border: none; + padding: 0; + margin: 0; + display: inline; +} +.rate-stars:hover .icon:before { + content: '\e9d9'; +} +.rate-stars form:hover ~ form .icon:before{ + content: '\e9d7'; +} diff --git a/bookwyrm/templates/feed.html b/bookwyrm/templates/feed.html index 96731ffe..1cd96cbe 100644 --- a/bookwyrm/templates/feed.html +++ b/bookwyrm/templates/feed.html @@ -2,39 +2,34 @@ {% load fr_display %} {% block content %} -{% include 'snippets/covers_shelf.html' with shelves=shelves user=request.user %} +
+
+ {% for activity in activities %} +
+ {% include 'snippets/status.html' with status=activity %} +
+ {% endfor %} + +
{% endblock %} diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 47deca6c..9b3a068a 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -101,7 +101,7 @@ -
+
{% block content %} {% endblock %}
diff --git a/bookwyrm/templates/snippets/avatar.html b/bookwyrm/templates/snippets/avatar.html index 22cc3fc7..d696e77d 100644 --- a/bookwyrm/templates/snippets/avatar.html +++ b/bookwyrm/templates/snippets/avatar.html @@ -1,2 +1,2 @@ - + diff --git a/bookwyrm/templates/snippets/covers_shelf.html b/bookwyrm/templates/snippets/covers_shelf.html index 0907ed0f..c0b1d650 100644 --- a/bookwyrm/templates/snippets/covers_shelf.html +++ b/bookwyrm/templates/snippets/covers_shelf.html @@ -26,8 +26,8 @@ {% for shelf in shelves %} {% for book in shelf.books %} -
- +