diff --git a/app/main.py b/app/main.py index c228d4c..998103c 100644 --- a/app/main.py +++ b/app/main.py @@ -685,10 +685,10 @@ async def tag_by_name( .join(models.TaggedOutboxObject) .where(*where) ) - if not tagged_count: - raise HTTPException(status_code=404) - if is_activitypub_requested(request): + if not tagged_count: + raise HTTPException(status_code=404) + outbox_object_ids = await db_session.execute( select(models.OutboxObject.ap_id) .join( @@ -736,6 +736,7 @@ async def tag_by_name( "request": request, "objects": outbox_objects, }, + status_code=200 if len(outbox_objects) else 404, ) diff --git a/app/templates/index.html b/app/templates/index.html index 8f7b091..3510c1e 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -21,26 +21,34 @@ {% block content %} {% include "header.html" %} -
- -{% for outbox_object in objects %} -{% if outbox_object.ap_type in ["Note", "Article", "Video", "Question"] %} -{{ utils.display_object(outbox_object) }} -{% elif outbox_object.ap_type == "Announce" %} -
{{ local_actor.display_name }} shared
-{{ utils.display_object(outbox_object.relates_to_anybox_object) }} +{% if objects %} + +
+ + {% for outbox_object in objects %} + {% if outbox_object.ap_type in ["Note", "Article", "Video", "Question"] %} + {{ utils.display_object(outbox_object) }} + {% elif outbox_object.ap_type == "Announce" %} +
{{ local_actor.display_name }} shared
+ {{ utils.display_object(outbox_object.relates_to_anybox_object) }} + {% endif %} + {% endfor %} +
+ +
+ {% if has_previous_page %} + Previous + {% endif %} + + {% if has_next_page %} + Next + {% endif %} +
+ +{% else %} +
+

Nothing to see here yet!

+
{% endif %} -{% endfor %} -
- -
- {% if has_previous_page %} - Previous - {% endif %} - - {% if has_next_page %} - Next - {% endif %} -
{% endblock %}