mirror of
https://github.com/jfmcbrayer/brutaldon
synced 2024-12-23 13:49:48 +01:00
AJAX-ify the delete link on a toot
This commit is contained in:
parent
8c847f0452
commit
8ab83275f6
@ -124,7 +124,12 @@
|
|||||||
<a class="level-item" href="{% url "redraft" toot.id %}">
|
<a class="level-item" href="{% url "redraft" toot.id %}">
|
||||||
redraft
|
redraft
|
||||||
</a>
|
</a>
|
||||||
<a class="level-item" href="{% url "delete" toot.id %}">
|
<a class="level-item" href="{% url "delete" toot.id %}"
|
||||||
|
ic-delete-from="{% url "delete" toot.id %}"
|
||||||
|
ic-indicator="#toot-spinner-{{toot.id}}"
|
||||||
|
ic-confirm="Really delete that toot?"
|
||||||
|
ic-target="#main"
|
||||||
|
ic-select-from-response="#main">
|
||||||
delete
|
delete
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -614,7 +614,7 @@ def boost(request, id):
|
|||||||
def delete(request, id):
|
def delete(request, id):
|
||||||
account, mastodon = get_usercontext(request)
|
account, mastodon = get_usercontext(request)
|
||||||
toot = mastodon.status(id)
|
toot = mastodon.status(id)
|
||||||
if request.method == 'POST':
|
if request.method == 'POST' or request.method == 'DELETE':
|
||||||
if toot.account.acct != request.session['user'].acct:
|
if toot.account.acct != request.session['user'].acct:
|
||||||
return redirect('home')
|
return redirect('home')
|
||||||
if not request.POST.get('cancel', None):
|
if not request.POST.get('cancel', None):
|
||||||
|
Loading…
Reference in New Issue
Block a user