mirror of
https://github.com/jfmcbrayer/brutaldon
synced 2025-02-03 17:27:31 +01:00
Hijax block button
This commit is contained in:
parent
3e7c81fc02
commit
1dd8b1a316
15
brutaldon/templates/intercooler/block.html
Normal file
15
brutaldon/templates/intercooler/block.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{% if not relationship.blocking %}
|
||||||
|
<a class="level-item fa fa-ban" title="block"
|
||||||
|
href="{% url 'block' user.id %}"
|
||||||
|
ic-post-to="{% url 'block' user.id %}"
|
||||||
|
ic-indicator="#user-spinner" ic-replace-target="true">
|
||||||
|
<span class="is-hidden">Block</span>
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
<a class="level-item fa fa-circle-o" title="unblock"
|
||||||
|
href="{% url 'block' user.id %}"
|
||||||
|
ic-post-to="{% url 'block' user.id %}"
|
||||||
|
ic-indicator="#user-spinner" ic-replace-target="true">
|
||||||
|
<span class="is-hidden">Unblock</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
@ -652,7 +652,14 @@ def block(request, id):
|
|||||||
mastodon.account_unblock(id)
|
mastodon.account_unblock(id)
|
||||||
else:
|
else:
|
||||||
mastodon.account_block(id)
|
mastodon.account_block(id)
|
||||||
return redirect(user, user_dict.acct)
|
if request.POST.get('ic-request'):
|
||||||
|
relationship['blocking'] = not relationship['blocking']
|
||||||
|
return render(request, 'intercooler/block.html',
|
||||||
|
{"user": user_dict,
|
||||||
|
"relationship": relationship,
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
return redirect(user, user_dict.acct)
|
||||||
else:
|
else:
|
||||||
return render(request, 'main/block.html',
|
return render(request, 'main/block.html',
|
||||||
{"user": user_dict, "relationship": relationship,
|
{"user": user_dict, "relationship": relationship,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user