1
0
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:
Jason McBrayer 2018-09-02 19:47:21 -04:00
parent fbce60f456
commit 3e7c81fc02
2 changed files with 23 additions and 1 deletions

View 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 %}

View File

@ -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,