diff --git a/src/core/models.py b/src/core/models.py index 5dfff2d..4715b42 100644 --- a/src/core/models.py +++ b/src/core/models.py @@ -130,7 +130,8 @@ class Post(models.Model): recipients = models.ManyToManyField( User, blank=True, - related_name='subscriptions' + related_name='subscriptions', + help_text='will be notified when creating or commenting on a post' ) tags = GenericRelation(Tag) diff --git a/src/core/templates/core/post_detail.html b/src/core/templates/core/post_detail.html index 855a5c5..c601d76 100644 --- a/src/core/templates/core/post_detail.html +++ b/src/core/templates/core/post_detail.html @@ -51,6 +51,20 @@
{% csrf_token %} {{ comment_create_form.as_p }} +

+ {% for recipient in post.recipients.all %} + {% if post.recipients.all|length > 2 %} + {% if not forloop.last %}{{ recipient }},{% else %}and {{ recipient }}{% endif %} + {% elif post.recipients.all|length is 2 %} + {% if forloop.last %}and {{ recipient }} {% else %} {{ recipient }}{% endif %} + {% else %} + {{ recipient }} + {% endif %} + {% empty %} + No one + {% endfor %} + will be notified when you post your comment. +