2018-05-18 13:41:41 -05:00
|
|
|
{% extends "layout.html" %}
|
|
|
|
{% import 'utils.html' as utils %}
|
2019-08-25 09:08:12 -05:00
|
|
|
{% block title %}{% if request.path == url_for('admin.admin_stream') %}Stream{% elif actor_id %}Profile {{ actor.name }}{% else %}Notifications{% endif %} - {{ config.NAME }}{% endblock %}
|
2018-05-18 13:41:41 -05:00
|
|
|
{% block content %}
|
|
|
|
<div class="h-feed" id="container">
|
|
|
|
{% include "header.html" %}
|
|
|
|
<div id="admin">
|
|
|
|
|
2019-08-01 12:55:30 -05:00
|
|
|
{% if request.path == url_for('admin.admin_notifications') and unread_notifications_count %}
|
2019-07-29 15:20:13 -05:00
|
|
|
<div style="clear:both;padding-bottom:60px;">
|
2019-07-29 12:36:22 -05: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 %}
|
|
|
|
|
2019-08-25 09:02:05 -05:00
|
|
|
{% if actor %}
|
|
|
|
{% set actor_redir = request.path + "?actor_id=" + request.args.get('actor_id') %}
|
|
|
|
|
|
|
|
<div id="profile" style="margin-bottom:80px;">
|
|
|
|
<div style="clear:both;margin-left:100px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
|
|
|
{% if follower %}<span class="bar-item-no-hover">follows you!</span>{% endif %}
|
|
|
|
|
|
|
|
{% if following %}
|
|
|
|
<form action="/api/undo" class="action-form" method="post">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}"/>
|
2019-09-05 16:16:23 -05:00
|
|
|
<input type="hidden" name="id" value="{{ following.remote_id }}"/>
|
2019-08-25 09:02:05 -05:00
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<button type="submit" class="bar-item">unfollow</button>
|
|
|
|
</form>
|
|
|
|
<form action="/api/block" class="action-form" method="POST">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}">
|
|
|
|
<input type="hidden" name="actor" value="{{ actor.id }}">
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
|
|
<button type="submit" class="bar-item" onclick="return confirm('Confirm the block action?');">block</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
{% if lists %}
|
|
|
|
<form action="/api/add_to_list" class="action-form" method="post">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}"/>
|
|
|
|
<input type="hidden" name="actor_id" value="{{ actor.id }}"/>
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<select name="list_name" style="float:left;">
|
|
|
|
<option></option>
|
|
|
|
{% for l in lists %}
|
|
|
|
{% if actor.id not in l.members %}
|
|
|
|
<option value="{{l.name}}">{{l.name}}</option>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
<button type="submit" class="bar-item">add to list</button>
|
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% for l in lists %}
|
|
|
|
{% if actor.id in l.members %}
|
|
|
|
<form action="/api/remove_from_list" class="action-form" method="post">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}"/>
|
|
|
|
<input type="hidden" name="actor_id" value="{{ actor.id }}"/>
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<button type="submit" class="bar-item">remove from {{ l.name }}</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{% else %}
|
|
|
|
<form action="/api/follow" class="action-form" method="POST">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}"/>
|
|
|
|
<input type="hidden" name="actor" value="{{ actor.id }}"/>
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
<button type="submit" class="bar-item">follow</button>
|
|
|
|
</form>
|
|
|
|
<form action="/api/block" class="action-form" method="POST">
|
|
|
|
<input type="hidden" name="redirect" value="{{ actor_redir }}">
|
|
|
|
<input type="hidden" name="actor" value="{{ actor.id }}">
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
|
|
<button type="submit" class="bar-item" onclick="return confirm('Confirm the block action?');">block</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<a class="actor-box" href="{{actor | url_or_id | get_url }}" style="clear:both;">
|
|
|
|
<span style="float:left;padding-right:15px;">
|
|
|
|
{% if not actor.icon %}
|
|
|
|
<img class="actor-icon" src="/static/nopic.png" style="width:80px">
|
|
|
|
{% else %}
|
|
|
|
<img class="actor-icon" src="{{ actor.icon.url | get_actor_icon_url(80) }}" style="width:80px;">{% endif %}
|
|
|
|
</span>
|
|
|
|
<div class="actor-inline">
|
|
|
|
<div style="font-weight:bold">{{ (actor.name or actor.preferredUsername) | clean | replace_custom_emojis(actor) | safe }}</div>
|
|
|
|
<small class="lcolor">@{{ actor.preferredUsername }}@{{ actor | url_or_id | get_url | domain }}</small>
|
2019-09-04 16:17:28 -05:00
|
|
|
{% if actor.manuallyApprovesFollowers %}<p><small>Manually approves followers</small></p>{% endif %}
|
2019-08-25 09:02:05 -05:00
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
{% if actor.summary %}
|
|
|
|
<div style="margin-top:70px;margin-bottom:20px;">
|
|
|
|
{{ actor.summary | clean | replace_custom_emojis(actor) | safe }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
2019-08-25 09:08:12 -05:00
|
|
|
|
|
|
|
{% if actor.attachment %}
|
|
|
|
<ul>
|
|
|
|
{% for item in actor.attachment %}
|
|
|
|
{% if item.type == "PropertyValue" %}
|
|
|
|
<li>{{ item.name }}: {{ item.value | clean | replace_custom_emojis(actor) | safe }}</li>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
{% endif %}
|
2019-08-25 09:02:05 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|
2019-07-29 12:36:22 -05:00
|
|
|
<div id="notes" style="clear:both;">
|
2018-05-18 13:41:41 -05:00
|
|
|
{% for item in inbox_data %}
|
2019-02-24 14:04:09 -06:00
|
|
|
{% if 'actor' in item.meta %}
|
2018-06-29 15:16:26 -05:00
|
|
|
{% if item | has_type('Create') %}
|
2018-07-07 05:10:25 -05:00
|
|
|
{{ utils.display_note(item.activity.object, ui=True, meta=item.meta) }}
|
2018-05-18 13:41:41 -05:00
|
|
|
{% else %}
|
2018-06-29 15:16:26 -05:00
|
|
|
{% if item | has_type('Announce') %}
|
2018-07-20 03:56:39 -05:00
|
|
|
{% set boost_actor = item.meta.actor %}
|
2018-08-28 15:14:48 -05:00
|
|
|
{% if boost_actor %}
|
2019-07-29 15:20:13 -05: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>
|
2019-08-01 12:55:30 -05:00
|
|
|
{% if request.path == url_for('admin.admin_notifications') %}
|
2019-07-29 15:20:13 -05:00
|
|
|
{% 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 15:14:48 -05:00
|
|
|
{% endif %}
|
2018-06-29 15:16:26 -05:00
|
|
|
{% if item.meta.object %}
|
2019-07-15 16:08:12 -05:00
|
|
|
{{ utils.display_note(item.meta.object, ui=True, meta=item.meta) }}
|
2018-05-18 13:41:41 -05:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-07-30 11:12:27 -05:00
|
|
|
|
|
|
|
{% if item | has_type('Like') %}
|
|
|
|
{% set boost_actor = item.meta.actor %}
|
2019-07-29 15:20:13 -05: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 11:12:27 -05:00
|
|
|
{% if item.meta.object %}
|
2019-07-15 16:08:12 -05:00
|
|
|
{{ utils.display_note(item.meta.object, ui=False, meta=item.meta) }}
|
2018-07-30 11:12:27 -05:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2018-05-18 13:41:41 -05:00
|
|
|
|
2018-06-29 15:16:26 -05:00
|
|
|
{% if item | has_type('Follow') %}
|
2019-07-29 12:36:22 -05:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
2019-07-29 15:20:13 -05:00
|
|
|
<span class="bar-item-no-hover">new follower</span>
|
2019-07-29 12:36:22 -05:00
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
2019-07-29 15:20:13 -05:00
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
2019-09-05 16:16:23 -05:00
|
|
|
<a class="bar-item" href="/admin/profile?actor_id={{item.meta.actor_id}}">profile</a>
|
2019-07-29 12:36:22 -05: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 15:16:26 -05:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 03:56:39 -05:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-06-29 15:16:26 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif item | has_type('Accept') %}
|
2019-07-29 12:36:22 -05:00
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
2019-07-29 15:20:13 -05:00
|
|
|
<span class="bar-item-no-hover">you started following</span>
|
2019-07-29 12:36:22 -05:00
|
|
|
{% if item.meta.notification_unread %}<span class="bar-item-no-bg"><span class="pcolor">new</span></span>{% endif %}
|
2019-07-29 15:20:13 -05:00
|
|
|
<span class="bar-item-no-bg">{{ (item.activity.published or item.meta.published) | format_timeago }}</span>
|
2019-09-05 16:16:23 -05:00
|
|
|
<a class="bar-item" href="/admin/profile?actor_id={{item.meta.actor_id}}">profile</a>
|
2019-07-29 12:36:22 -05:00
|
|
|
{% if item.meta.notification_follows_back %}<span class="bar-item-no-hover">follows you back</span>{% endif %}
|
|
|
|
</div>
|
|
|
|
|
2019-09-05 16:16:23 -05:00
|
|
|
<div style="height: 100px;">
|
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif item | has_type('Reject') %}
|
|
|
|
<div style="margin-left:70px;padding-bottom:5px;margin-bottom:15px;display:inline-block;">
|
|
|
|
<span class="bar-item-no-hover">rejected your follow request</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>
|
|
|
|
<a class="bar-item" href="/admin/profile?actor_id={{item.meta.actor_id}}">profile</a>
|
|
|
|
{% if item.meta.notification_follows_back %}<span class="bar-item-no-hover">follows you</span>{% endif %}
|
|
|
|
</div>
|
|
|
|
|
2018-07-01 14:32:12 -05:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 03:56:39 -05:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-07-01 14:32:12 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
{% elif item | has_type('Undo') %}
|
2019-07-29 15:20:13 -05: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 15:16:26 -05:00
|
|
|
<div style="height: 100px;">
|
2018-07-20 03:56:39 -05:00
|
|
|
{{ utils.display_actor_inline(item.meta.actor, size=50) }}
|
2018-06-29 15:16:26 -05:00
|
|
|
</div>
|
|
|
|
|
2018-05-18 13:41:41 -05:00
|
|
|
{% else %}
|
2018-06-29 15:16:26 -05:00
|
|
|
|
2018-05-18 13:41:41 -05:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
2019-02-24 14:04:09 -06:00
|
|
|
{% endif %}
|
2019-07-04 16:22:38 -05:00
|
|
|
{% else %}
|
|
|
|
|
|
|
|
{% if item | has_type('question_ended') %}
|
2019-07-05 15:05:28 -05: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 16:08:12 -05:00
|
|
|
{{ utils.display_note(item.activity, meta={"object_visibility": "PUBLIC"}) }}
|
2019-07-04 16:22:38 -05:00
|
|
|
{% endif %}
|
|
|
|
|
2018-05-18 13:41:41 -05:00
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2018-07-06 16:53:33 -05:00
|
|
|
|
|
|
|
{{ utils.display_pagination(older_than, newer_than) }}
|
2018-05-18 13:41:41 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|