Hijax the muting button
This commit is contained in:
parent
fbce60f456
commit
3e7c81fc02
|
@ -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)
|
mastodon.account_unmute(id)
|
||||||
else:
|
else:
|
||||||
mastodon.account_mute(id)
|
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:
|
else:
|
||||||
return render(request, 'main/mute.html',
|
return render(request, 'main/mute.html',
|
||||||
{"user": user_dict, "relationship": relationship,
|
{"user": user_dict, "relationship": relationship,
|
||||||
|
|
Loading…
Reference in New Issue