mirror of
http://git.carcosa.net/jmcbray/brutaldon.git
synced 2024-11-23 07:13:52 -05:00
Finish adding support for follow requests
This commit is contained in:
parent
d3ed8eef27
commit
67f2ea8149
19
brutaldon/templates/requests/list.html
Normal file
19
brutaldon/templates/requests/list.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
{% load widget_tweaks %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1 class="title">Follow requests</h1>
|
||||
|
||||
{% if not requests %}
|
||||
<p>No follow requests.</p>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% for request in requests %}
|
||||
{% include "requests/request_partial.html" %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
21
brutaldon/templates/requests/request_partial.html
Normal file
21
brutaldon/templates/requests/request_partial.html
Normal file
@ -0,0 +1,21 @@
|
||||
<article class="media box">
|
||||
<figure class="media-left">
|
||||
<p class="image is-64x64">
|
||||
<img src="{{ request.avatar_static }}"
|
||||
alt="{{ request.acct }}">
|
||||
</p>
|
||||
</figure>
|
||||
<div class="media-content">
|
||||
<strong>{{ request.display_name }}</strong> ({{ request.acct }})
|
||||
</div>
|
||||
<div class="media-right">
|
||||
<form method="POST" action="{% url "follow_requests" request.id %}">
|
||||
{% csrf_token %}
|
||||
<button name="accept" class="button is-success" value="Accept">
|
||||
Accept
|
||||
</button>
|
||||
<button name="reject" class="button is-danger" value="Reject">
|
||||
Reject
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
@ -149,8 +149,9 @@
|
||||
value="Save" class="button is-primary" >
|
||||
</div>
|
||||
</form>
|
||||
<h2 class="subtitle">Filters and Lists</h2>
|
||||
<h2 class="subtitle">Filters and More</h2>
|
||||
<p><a href="{% url "list_filters" %}">List filters</a></p>
|
||||
<p><a href="{% url "follow_requests" %}">Follow requests</a></p>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@ -64,5 +64,7 @@ urlpatterns = [
|
||||
path('filters/create', views.create_filter, name='create_filter'),
|
||||
path('filters/delete/<id>', views.delete_filter, name='delete_filter'),
|
||||
path('filters/edit/<id>', views.edit_filter, name='edit_filter'),
|
||||
path('requests/', views.follow_requests, name='follow_requests'),
|
||||
path('requests/<id>', views.follow_requests, name='follow_requests'),
|
||||
path('', views.home, name=''),
|
||||
]
|
||||
|
@ -1091,7 +1091,7 @@ def follow_requests(request, id=None):
|
||||
else:
|
||||
if request.POST.get("accept", None):
|
||||
mastodon.follow_request_authorize(id)
|
||||
elif request.POST.get("rejest", None):
|
||||
elif request.POST.get("reject", None):
|
||||
mastodon.follow_request_reject(id)
|
||||
return redirect(follow_requests)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user