diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index c5e69936..0e18dc1b 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -5,6 +5,7 @@ import re from django.apps import apps from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models +from django.template.loader import get_template from django.utils import timezone from model_utils.managers import InheritanceManager @@ -309,7 +310,8 @@ class ReviewRating(Review): @property def pure_content(self): - return 'Rated "{}": {:d} stars'.format(self.book.title, self.rating) + template = get_template("snippets/generated_status/rating.html") + return template.render({"book": self.book, "rating": self.rating}).strip() activity_serializer = activitypub.Rating pure_type = "Note" diff --git a/bookwyrm/templates/snippets/generated_status/rating.html b/bookwyrm/templates/snippets/generated_status/rating.html new file mode 100644 index 00000000..e4e42fca --- /dev/null +++ b/bookwyrm/templates/snippets/generated_status/rating.html @@ -0,0 +1,5 @@ +{% load i18n %}{% load humanize %}{{% spaceless %} + +{% blocktrans with title=book.title path=book.local_path rating=rating %}Rated {{ title }} : {{ rating }} stars{% endblocktrans %} + +{% endspaceless %}