mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Add Announce support for the lookup
This commit is contained in:
parent
45bfcc2502
commit
6cc30f622a
2 changed files with 17 additions and 1 deletions
11
app.py
11
app.py
|
@ -1303,11 +1303,20 @@ def admin():
|
|||
@login_required
|
||||
def admin_lookup():
|
||||
data = None
|
||||
meta = None
|
||||
if request.method == "POST":
|
||||
if request.form.get("url"):
|
||||
data = lookup(request.form.get("url"))
|
||||
if data.has_type(ActivityType.ANNOUNCE):
|
||||
meta = dict(
|
||||
object=data.get_object().to_dict(),
|
||||
object_actor=data.get_object().get_actor().to_dict(),
|
||||
actor=data.get_actor().to_dict(),
|
||||
)
|
||||
|
||||
return render_template("lookup.html", data=data, url=request.form.get("url"))
|
||||
return render_template(
|
||||
"lookup.html", data=data, meta=meta, url=request.form.get("url")
|
||||
)
|
||||
|
||||
|
||||
@app.route("/admin/thread")
|
||||
|
|
|
@ -31,6 +31,13 @@
|
|||
{{ utils.display_note(data.object, ui=True) }}
|
||||
{% elif data | has_type('Note') %}
|
||||
{{ utils.display_note(data, ui=True) }}
|
||||
{% elif data | has_type('Announce') %}
|
||||
{% set boost_actor = meta.actor %}
|
||||
<p style="margin-left:65px;padding-bottom:5px;">
|
||||
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name }}</a> boosted</span>
|
||||
</p>
|
||||
{{ utils.display_note(meta.object, ui=False, meta={'actor': meta.object_actor}) }}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue