Include accept/delete buttons in notifications list.

This commit is contained in:
Adam Kelly 2020-03-13 14:58:30 +00:00
parent 0e34c74647
commit fa57d6cfc7
3 changed files with 12 additions and 10 deletions

View file

@ -29,6 +29,7 @@
{% elif notification.notification_type == 'FOLLOW_REQUEST' %}
{% include 'snippets/username.html' with user=notification.related_user %}
sent you a follow request
{% include 'snippets/follow_request_buttons.html' with user=notification.related_user %}
{% endif %}
<small>{{ notification.created_date | naturaltime }}</small>
</p>

View file

@ -0,0 +1,10 @@
<form action="/accept_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ user.username }}">
<input type=submit value="Accept">
</form>
<form action="/delete_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ user.username }}">
<input type=submit value="Delete">
</form>

View file

@ -27,16 +27,7 @@
{% for requester in user.follower_requests.all %}
<div>
{% include 'snippets/username.html' with user=requester show_full=True %}
<form action="/accept_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ requester.username }}">
<input type=submit value="Accept">
</form>
<form action="/delete_follow_request/" method="POST">
{% csrf_token %}
<input type=hidden name="user" value="{{ requester.username }}">
<input type=submit value="Delete">
</form>
{% include 'snippets/follow_request_buttons.html' with user=requester %}
</div>
{% endfor %}
</div>