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 %}">
|
||||
redraft
|
||||
</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
|
||||
</a>
|
||||
{% endif %}
|
||||
|
|
|
@ -614,7 +614,7 @@ def boost(request, id):
|
|||
def delete(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
toot = mastodon.status(id)
|
||||
if request.method == 'POST':
|
||||
if request.method == 'POST' or request.method == 'DELETE':
|
||||
if toot.account.acct != request.session['user'].acct:
|
||||
return redirect('home')
|
||||
if not request.POST.get('cancel', None):
|
||||
|
|
Loading…
Reference in New Issue