diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index d0702a3e..0c81f059 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -74,6 +74,10 @@ class Book(ActivitypubMixin, BookWyrmModel): ''' reference the work via local id not remote ''' return self.parent_work.remote_id + @property + def latest_readthrough(self): + return self.readthrough_set.order_by('-updated_date').first() + activity_mappings = [ ActivityMapping('id', 'remote_id'), diff --git a/bookwyrm/templates/feed.html b/bookwyrm/templates/feed.html index ed1fea0f..474f4fbc 100644 --- a/bookwyrm/templates/feed.html +++ b/bookwyrm/templates/feed.html @@ -46,7 +46,17 @@ diff --git a/bookwyrm/templates/snippets/progress_update.html b/bookwyrm/templates/snippets/progress_update.html index a93ac839..51385b97 100644 --- a/bookwyrm/templates/snippets/progress_update.html +++ b/bookwyrm/templates/snippets/progress_update.html @@ -1,7 +1,14 @@ -
+
+ {% csrf_token %} +
on page
- +
-
of 100
-
+ {% if book.pages %} +
of {{ book.pages }}
+ {% endif %} +
+ +
+ diff --git a/bookwyrm/templates/snippets/shelve_button.html b/bookwyrm/templates/snippets/shelve_button.html index d8ed438f..3b924324 100644 --- a/bookwyrm/templates/snippets/shelve_button.html +++ b/bookwyrm/templates/snippets/shelve_button.html @@ -63,10 +63,6 @@ {% endwith %} - - {% if active_shelf.identifier == 'reading' %} - {% include 'snippets/progress_update.html' %} - {% endif %} {% endif %}