mirror of
https://gitlab.com/brutaldon/brutaldon.git
synced 2024-12-04 14:46:24 -05:00
Hijax the muting button
This commit is contained in:
parent
fbce60f456
commit
3e7c81fc02
15
brutaldon/templates/intercooler/mute.html
Normal file
15
brutaldon/templates/intercooler/mute.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% if not relationship.muting %}
|
||||
<a class="level-item fa fa-volume-off" title="mute"
|
||||
href="{% url 'mute' user.id %}"
|
||||
ic-post-to="{% url 'mute' user.id %}"
|
||||
ic-indicator="#user-spinner" ic-replace-target="true">
|
||||
<span class="is-hidden">Mute</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<a class="level-item fa fa-volume-up" title="unmute"
|
||||
href="{% url 'mute' user.id %}"
|
||||
ic-post-to="{% url 'mute' user.id %}"
|
||||
ic-indicator="#user-spinner" ic-replace-target="true">
|
||||
<span class="is-hidden">Unmute</span>
|
||||
</a>
|
||||
{% endif %}
|
@ -675,7 +675,14 @@ def mute(request, id):
|
||||
mastodon.account_unmute(id)
|
||||
else:
|
||||
mastodon.account_mute(id)
|
||||
return redirect(user, user_dict.acct)
|
||||
if request.POST.get('ic-request'):
|
||||
relationship['muting'] = not relationship['muting']
|
||||
return render(request, 'intercooler/mute.html',
|
||||
{"user": user_dict,
|
||||
"relationship": relationship,
|
||||
})
|
||||
else:
|
||||
return redirect(user, user_dict.acct)
|
||||
else:
|
||||
return render(request, 'main/mute.html',
|
||||
{"user": user_dict, "relationship": relationship,
|
||||
|
Loading…
Reference in New Issue
Block a user