Hijax block button
This commit is contained in:
parent
3e7c81fc02
commit
1dd8b1a316
|
@ -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,6 +652,13 @@ def block(request, id):
|
||||||
mastodon.account_unblock(id)
|
mastodon.account_unblock(id)
|
||||||
else:
|
else:
|
||||||
mastodon.account_block(id)
|
mastodon.account_block(id)
|
||||||
|
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)
|
return redirect(user, user_dict.acct)
|
||||||
else:
|
else:
|
||||||
return render(request, 'main/block.html',
|
return render(request, 'main/block.html',
|
||||||
|
|
Loading…
Reference in New Issue