improve DMs + add rebuild script

main
Dominik Madarász 2023-01-12 14:49:37 +00:00
parent 869ed215a3
commit 7cb1f8196e
3 changed files with 13 additions and 2 deletions

View File

@ -587,9 +587,11 @@ async def admin_direct_messages(
) )
).scalars() ).scalars()
) )
has_actors = True
# If this message from outbox starts a thread with no replies, look # If this message from outbox starts a thread with no replies, look
# at the mentions # at the mentions
if not actors and anybox_object.is_from_outbox: if not actors and anybox_object.is_from_outbox:
has_actors = False
actors = ( # type: ignore actors = ( # type: ignore
await db_session.execute( await db_session.execute(
select(models.Actor).where( select(models.Actor).where(
@ -601,7 +603,7 @@ async def admin_direct_messages(
) )
) )
).scalars() ).scalars()
threads.append((anybox_object, convo, actors)) threads.append((anybox_object, convo, actors, has_actors))
return await templates.render_template( return await templates.render_template(
db_session, db_session,

View File

@ -7,13 +7,15 @@
{% block content %} {% block content %}
{% for anybox_object, convo, actors in threads %} {% for anybox_object, convo, actors, has_actors in threads %}
<div class="actor-action"> <div class="actor-action">
{% if has_actors %}
With {% for actor in actors %} With {% for actor in actors %}
<a href="{{ url_for("admin_profile") }}?actor_id={{ actor.ap_id }}"> <a href="{{ url_for("admin_profile") }}?actor_id={{ actor.ap_id }}">
{{ actor.handle }} {{ actor.handle }}
</a> </a>
{% endfor %} {% endfor %}
{% endif %}
</div> </div>
{{ utils.display_object(anybox_object) }} {{ utils.display_object(anybox_object) }}
{% endfor %} {% endfor %}

7
rebuild.sh 100755
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -xe
sudo docker compose build
sudo docker compose down
sudo docker compose up -d