mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 21:24:28 +00:00
Add delete and block in the UI
This commit is contained in:
parent
c17a9a5a0c
commit
d2e62ed5b6
2 changed files with 25 additions and 0 deletions
5
app.py
5
app.py
|
@ -142,6 +142,11 @@ def quote_plus(t):
|
||||||
return urllib.parse.quote_plus(t)
|
return urllib.parse.quote_plus(t)
|
||||||
|
|
||||||
|
|
||||||
|
@app.template_filter()
|
||||||
|
def is_from_outbox(t):
|
||||||
|
return t.startswith(ID)
|
||||||
|
|
||||||
|
|
||||||
@app.template_filter()
|
@app.template_filter()
|
||||||
def clean(html):
|
def clean(html):
|
||||||
return clean_html(html)
|
return clean_html(html)
|
||||||
|
|
|
@ -125,6 +125,26 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if session.logged_in %}
|
||||||
|
{% if item.activity.id | is_from_outbox %}
|
||||||
|
<form action="/api/note/delete" class="action-form" method="POST">
|
||||||
|
<input type="hidden" name="redirect" value="{{ redir }}">
|
||||||
|
<input type="hidden" name="id" value="{{ item.activity.object.id }}">
|
||||||
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
|
<button type="submit" class="bar-item">delete</button>
|
||||||
|
</form>
|
||||||
|
{% else %}
|
||||||
|
<form action="/api/block" class="action-form" method="POST">
|
||||||
|
<input type="hidden" name="redirect" value="{{ redir }}">
|
||||||
|
<input type="hidden" name="actor" value="{{ item.activity.actor }}">
|
||||||
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||||
|
<button type="submit" class="bar-item">block</button>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if likes or shares %}
|
{% if likes or shares %}
|
||||||
|
|
Loading…
Reference in a new issue