diff --git a/bookwyrm/models/base_model.py b/bookwyrm/models/base_model.py index 469a69720..d82334e1a 100644 --- a/bookwyrm/models/base_model.py +++ b/bookwyrm/models/base_model.py @@ -35,6 +35,11 @@ class BookWyrmModel(models.Model): ''' this is just here to provide default fields for other models ''' abstract = True + @property + def local_path(self): + ''' how to link to this object in the local app ''' + return self.get_remote_id().replace('https://%s' % DOMAIN, '') + @receiver(models.signals.post_save) #pylint: disable=unused-argument diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index e70309a72..686af24da 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -179,6 +179,11 @@ class User(OrderedCollectionPageMixin, AbstractUser): return super().save(*args, **kwargs) + @property + def local_path(self): + ''' this model doesn't inherit bookwyrm model, so here we are ''' + return '/user/%s' % (self.localname or self.username) + class KeyPair(ActivitypubMixin, BookWyrmModel): ''' public and private keys for a user ''' diff --git a/bookwyrm/templates/author.html b/bookwyrm/templates/author.html index e51ef3021..4235b266a 100644 --- a/bookwyrm/templates/author.html +++ b/bookwyrm/templates/author.html @@ -8,7 +8,7 @@ {% if request.user.is_authenticated and perms.bookwyrm.edit_book %}
- + Edit Author diff --git a/bookwyrm/templates/book.html b/bookwyrm/templates/book.html index 506ee3db0..4bbc8d103 100644 --- a/bookwyrm/templates/book.html +++ b/bookwyrm/templates/book.html @@ -166,10 +166,10 @@ {% for rating in ratings %}
{% elif notification.notification_type == 'BOOST' %} - boosted your status + boosted your status {% endif %} {% else %} your import completed. @@ -54,7 +54,7 @@
{{ notification.related_status.published_date | post_date }} diff --git a/bookwyrm/templates/shelf.html b/bookwyrm/templates/shelf.html index 390b9fc66..4b27e3a49 100644 --- a/bookwyrm/templates/shelf.html +++ b/bookwyrm/templates/shelf.html @@ -122,7 +122,7 @@
- {% include 'snippets/shelf.html' with shelf=shelf ratings=ratings %} + {% include 'snippets/shelf.html' with shelf=shelf books=books ratings=ratings %}
{% endblock %} diff --git a/bookwyrm/templates/snippets/follow_request_buttons.html b/bookwyrm/templates/snippets/follow_request_buttons.html index 17b3484b6..a6f585c74 100644 --- a/bookwyrm/templates/snippets/follow_request_buttons.html +++ b/bookwyrm/templates/snippets/follow_request_buttons.html @@ -1,13 +1,15 @@ {% load bookwyrm_tags %} {% if request.user|follow_request_exists:user %} -
- {% csrf_token %} - - -
-
- {% csrf_token %} - - -
+
+
+ {% csrf_token %} + + +
+
+ {% csrf_token %} + + +
+
{% endif %} diff --git a/bookwyrm/templates/snippets/reply_form.html b/bookwyrm/templates/snippets/reply_form.html index 787a3ac54..9834545ef 100644 --- a/bookwyrm/templates/snippets/reply_form.html +++ b/bookwyrm/templates/snippets/reply_form.html @@ -1,20 +1,21 @@ {% load bookwyrm_tags %} -{% with activity.id|uuid as uuid %} +{% with status.id|uuid as uuid %}
{% csrf_token %} - +
- {% include 'snippets/content_warning_field.html' with parent_status=activity %} + {% include 'snippets/content_warning_field.html' with parent_status=status %} +
- +
- {% include 'snippets/privacy_select.html' with current=activity.privacy %} + {% include 'snippets/privacy_select.html' with current=status.privacy %}