mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 13:14:28 +00:00
Improve notifications page
This commit is contained in:
parent
cc18e94a81
commit
2fba922e03
2 changed files with 17 additions and 28 deletions
|
@ -5,6 +5,13 @@
|
||||||
<title>{{ local_actor.display_name }} - Notifications</title>
|
<title>{{ local_actor.display_name }} - Notifications</title>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% macro notif_actor_action(notif, text) %}
|
||||||
|
<div class="actor-action">
|
||||||
|
<a href="{{ url_for("admin_profile") }}?actor_id={{ notif.actor.ap_id }}">{{ notif.actor.display_name | clean_html(notif.actor) | safe }}</a> {{ text }}
|
||||||
|
<span title="{{ notif.created_at.isoformat() }}">{{ notif.created_at | timeago }}</span>
|
||||||
|
</div>
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h2>Notifications</h2>
|
<h2>Notifications</h2>
|
||||||
|
@ -13,49 +20,31 @@
|
||||||
{%- for notif in notifications %}
|
{%- for notif in notifications %}
|
||||||
<div>
|
<div>
|
||||||
{%- if notif.notification_type.value == "new_follower" %}
|
{%- if notif.notification_type.value == "new_follower" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "followed you") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> followed you
|
|
||||||
</div>
|
|
||||||
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
||||||
{% elif notif.notification_type.value == "unfollow" %}
|
{% elif notif.notification_type.value == "unfollow" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "unfollowed you") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> unfollowed you
|
|
||||||
</div>
|
|
||||||
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
||||||
{%- elif notif.notification_type.value == "follow_request_accepted" %}
|
{%- elif notif.notification_type.value == "follow_request_accepted" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "accepted your follow request") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> accepted your follow request
|
|
||||||
</div>
|
|
||||||
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
||||||
{%- elif notif.notification_type.value == "follow_request_rejected" %}
|
{%- elif notif.notification_type.value == "follow_request_rejected" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "rejected your follow request") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> rejected your follow request
|
|
||||||
</div>
|
|
||||||
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
{{ utils.display_actor(notif.actor, actors_metadata) }}
|
||||||
{% elif notif.notification_type.value == "like" %}
|
{% elif notif.notification_type.value == "like" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "liked a post") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> liked a post
|
|
||||||
</div>
|
|
||||||
{{ utils.display_object(notif.outbox_object) }}
|
{{ utils.display_object(notif.outbox_object) }}
|
||||||
{% elif notif.notification_type.value == "undo_like" %}
|
{% elif notif.notification_type.value == "undo_like" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "unliked a post") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> un-liked a post
|
|
||||||
</div>
|
|
||||||
{{ utils.display_object(notif.outbox_object) }}
|
{{ utils.display_object(notif.outbox_object) }}
|
||||||
{% elif notif.notification_type.value == "announce" %}
|
{% elif notif.notification_type.value == "announce" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "shared a post") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> boosted a post
|
|
||||||
</div>
|
|
||||||
{{ utils.display_object(notif.outbox_object) }}
|
{{ utils.display_object(notif.outbox_object) }}
|
||||||
{% elif notif.notification_type.value == "undo_announce" %}
|
{% elif notif.notification_type.value == "undo_announce" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "unshared a post") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> un-boosted a post
|
|
||||||
</div>
|
|
||||||
{{ utils.display_object(notif.outbox_object) }}
|
{{ utils.display_object(notif.outbox_object) }}
|
||||||
{% elif notif.notification_type.value == "mention" %}
|
{% elif notif.notification_type.value == "mention" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
{{ notif_actor_action(notif, "mentioned you") }}
|
||||||
<a style="font-weight:bold;" href="{{ notif.actor.url }}">{{ notif.actor.display_name }}</a> mentioned you
|
|
||||||
</div>
|
|
||||||
{{ utils.display_object(notif.inbox_object) }}
|
{{ utils.display_object(notif.inbox_object) }}
|
||||||
{% elif notif.notification_type.value == "new_webmention" %}
|
{% elif notif.notification_type.value == "new_webmention" %}
|
||||||
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
<div class="actor-action" title="{{ notif.created_at.isoformat() }}">
|
||||||
|
|
|
@ -192,7 +192,7 @@
|
||||||
{% macro actor_action(inbox_object, text) %}
|
{% macro actor_action(inbox_object, text) %}
|
||||||
<div class="actor-action">
|
<div class="actor-action">
|
||||||
<a href="{{ url_for("admin_profile") }}?actor_id={{ inbox_object.actor.ap_id }}">{{ inbox_object.actor.display_name | clean_html(inbox_object.actor) | safe }}</a> {{ text }}
|
<a href="{{ url_for("admin_profile") }}?actor_id={{ inbox_object.actor.ap_id }}">{{ inbox_object.actor.display_name | clean_html(inbox_object.actor) | safe }}</a> {{ text }}
|
||||||
<span>{{ inbox_object.ap_published_at | timeago }}</span>
|
<span title="{{ inbox_object.ap_published_at.isoformat() }}">{{ inbox_object.ap_published_at | timeago }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
Loading…
Reference in a new issue