2018-05-18 18:41:41 +00:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% import 'utils.html' as utils %}
|
2018-07-20 08:56:39 +00:00
|
|
|
{% block title %}{% if request.path == url_for('admin_stream') %}Stream{% else %}Notifications{% endif %} - {{ config.NAME }}{% endblock %}
|
2018-05-18 18:41:41 +00:00
|
|
|
{% block content %}
|
|
|
|
<div class="h-feed" id="container">
|
|
|
|
{% include "header.html" %}
|
|
|
|
<div id="admin">
|
|
|
|
|
2019-07-29 17:36:22 +00:00
|
|
|
{% if request.path == url_for('admin_notifications') and unread_notifications_count %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<div style="clear:both;padding-bottom:60px;">
|
2019-07-29 17:36:22 +00:00
|
|
|
<form action="/api/mark_notifications_as_read" method="POST">
|
|
|
|
<input type="hidden" name="redirect" value="{{ request.path }}"/>
|
|
|
|
<input type="hidden" name="nid" value="{{ nid }}"/>
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<button type="submit" class="bar-item" style="text-transform:uppercase">Mark as read</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div id="notes" style="clear:both;">
|
2018-05-18 18:41:41 +00:00
|
|
|
{% for item in inbox_data %}
|
2019-02-24 20:04:09 +00:00
|
|
|
{% if 'actor' in item.meta %}
|
2018-06-29 20:16:26 +00:00
|
|
|
{% if item | has_type('Create') %}
|
2018-07-07 10:10:25 +00:00
|
|
|
{{ utils.display_note(item.activity.object, ui=True, meta=item.meta) }}
|
2018-05-18 18:41:41 +00:00
|
|
|
{% else %}
|
2018-06-29 20:16:26 +00:00
|
|
|
{% if item | has_type('Announce') %}
|
2018-07-20 08:56:39 +00:00
|
|
|
{% set boost_actor = item.meta.actor %}
|
2018-08-28 20:14:48 +00:00
|
|
|
{% if boost_actor %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
|
|
|
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> boosted</span>
|
|
|
|
{% if request.path == url_for('admin_notifications') %}
|
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
</div>
|
2018-08-28 20:14:48 +00:00
|
|
|
{% endif %}
|
2018-06-29 20:16:26 +00:00
|
|
|
{% if item.meta.object %}
|
2019-07-15 21:08:12 +00:00
|
|
|
{{ utils.display_note(item.meta.object, ui=True, meta=item.meta) }}
|
2018-05-18 18:41:41 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-07-30 16:12:27 +00:00
|
|
|
|
|
|
|
{% if item | has_type('Like') %}
|
|
|
|
{% set boost_actor = item.meta.actor %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
|
|
|
<span class="bar-item-no-hover"><a style="color:#808080;" href="{{ boost_actor.url | get_url }}">{{ boost_actor.name or boost_actor.preferredUsername }}</a> liked</span>
|
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
|
|
|
</div>
|
2018-07-30 16:12:27 +00:00
|
|
|
{% if item.meta.object %}
|
2019-07-15 21:08:12 +00:00
|
|
|
{{ utils.display_note(item.meta.object, ui=False, meta=item.meta) }}
|
2018-07-30 16:12:27 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-05-18 18:41:41 +00:00
|
|
|
|
2018-06-29 20:16:26 +00:00
|
|
|
{% if item | has_type('Follow') %}
|
2019-07-29 17:36:22 +00:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
2019-07-29 20:20:13 +00:00
|
|
|
<span class="bar-item-no-hover">new follower</span>
|
2019-07-29 17:36:22 +00:00
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
2019-07-29 17:36:22 +00:00
|
|
|
{% if item.meta.notification_follows_back %}<span class="bar-item-no-hover">already following</span>
|
|
|
|
{% else %}
|
|
|
|
<form action="/api/follow" class="action-form" method="POST">
|
|
|
|
<input type="hidden" name="redirect" value="{{ request.path }}"/>
|
|
|
|
<input type="hidden" name="actor" value="{{ item.meta.actor_id }}"/>
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<button type="submit" class="bar-item">follow back</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
2018-06-29 20:16:26 +00:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 08:56:39 +00:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-06-29 20:16:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif item | has_type('Accept') %}
|
2019-07-29 17:36:22 +00:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
2019-07-29 20:20:13 +00:00
|
|
|
<span class="bar-item-no-hover">you started following</span>
|
2019-07-29 17:36:22 +00:00
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
2019-07-29 17:36:22 +00:00
|
|
|
{% if item.meta.notification_follows_back %}<span class="bar-item-no-hover">follows you back</span>{% endif %}
|
|
|
|
</div>
|
|
|
|
|
2018-07-01 19:32:12 +00:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 08:56:39 +00:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-07-01 19:32:12 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif item | has_type('Undo') %}
|
2019-07-29 20:20:13 +00:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
|
|
|
<span class="bar-item-no-hover">unfollowed you</span>
|
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
|
|
|
</div>
|
2018-06-29 20:16:26 +00:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 08:56:39 +00:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-06-29 20:16:26 +00:00
|
|
|
</div>
|
|
|
|
|
2018-05-18 18:41:41 +00:00
|
|
|
{% else %}
|
2018-06-29 20:16:26 +00:00
|
|
|
|
2018-05-18 18:41:41 +00:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2019-02-24 20:04:09 +00:00
|
|
|
{% endif %}
|
2019-07-04 21:22:38 +00:00
|
|
|
{% else %}
|
|
|
|
|
|
|
|
{% if item | has_type('question_ended') %}
|
2019-07-05 20:05:28 +00:00
|
|
|
<p style="margin-left:70px;padding-bottom:5px;display:inline-block;"><span class="bar-item-no-hover">poll ended</span></p>
|
2019-07-15 21:08:12 +00:00
|
|
|
{{ utils.display_note(item.activity, meta={"object_visibility": "PUBLIC"}) }}
|
2019-07-04 21:22:38 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2018-05-18 18:41:41 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2018-07-06 21:53:33 +00:00
|
|
|
|
|
|
|
{{ utils.display_pagination(older_than, newer_than) }}
|
2018-05-18 18:41:41 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|