mirror of
https://github.com/jfmcbrayer/brutaldon
synced 2025-02-16 03:20:44 +01:00
commit 0a80206abb8fae7785a59aab88043b2b1974756b Author: Jason McBrayer <jmcbray@carcosa.net> Date: Tue Nov 5 19:22:00 2019 -0500 Fix oxford comma in bundled notifications, remove unused dependency commit e96bd22bdce996734aaaf1d5625e08add3c8fcf7 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Tue Nov 5 19:19:42 2019 -0500 Now template works with bundled or un-bundled notifications commit 6f46bef7fdd0defe2f02e09e28558de882ce4456 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Tue Nov 5 19:02:51 2019 -0500 Bundled toots work; now fix unbundled case commit 07d9de49f943d019d04a5a5203081e57dc0741d8 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Tue Nov 5 14:09:14 2019 -0500 Notifications are now sorted by groups, but not collapsed commit f62666929f12cf0c7db4c68a1468f7e138318a5c Author: Jason McBrayer <jmcbray@carcosa.net> Date: Tue Nov 5 13:58:41 2019 -0500 Fix saving of bundle_notifications setting commit 335d5f985c968bb84e4b459dabf77d1d7ecad646 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Mon Nov 4 18:57:54 2019 -0500 Forgot to include migration for bundle notifications preference commit 0e8232591c4f1bb972e9694433c546c9f66b5419 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Mon Nov 4 18:57:35 2019 -0500 Bundle notifications setting front-end commit 6e945f1ceb2ff19470e164a946a6a48de4142812 Author: Jason McBrayer <jmcbray@carcosa.net> Date: Mon Nov 4 18:54:49 2019 -0500 Backend code to group notifications
120 lines
5.2 KiB
HTML
120 lines
5.2 KiB
HTML
{% extends "base.html" %}
|
|
{% load humanetime %}
|
|
{% load taglinks %}
|
|
|
|
{% block title %}
|
|
Brutaldon ({{ own_acct.username }}) - Notifications timelime
|
|
{% endblock %}
|
|
|
|
{% comment %}
|
|
mastodon.notifications()[0]
|
|
# Returns the following dictionary:
|
|
{
|
|
'id': # id of the notification
|
|
'type': # "mention", "reblog", "favourite" or "follow"
|
|
'created_at': # The time the notification was created
|
|
'account': # User dict of the user from whom the notification originates
|
|
'status': # In case of "mention", the mentioning status
|
|
# In case of reblog / favourite, the reblogged / favourited status
|
|
}
|
|
{% endcomment %}
|
|
|
|
|
|
{% block content %}
|
|
<h1 class="title">Your notifications timeline</h1>
|
|
{% for group in groups %}
|
|
{% if bundle_notifications and group.0.type in bundleable %}
|
|
{% if group.0.type == 'favourite' %}
|
|
<p>
|
|
{% for account in group.accounts %}
|
|
{% include "comma.html" %}{{ account.display_name }}
|
|
(<a href="{{ account.url | localuser}}">{{ account.acct }}</a>)
|
|
{% endfor %}
|
|
favorited your toot.
|
|
</p>
|
|
{% include "main/toot_partial.html" with toot=group.0.status %}
|
|
<hr class="is-hidden">
|
|
{% elif group.0.type == 'reblog' %}
|
|
<p>
|
|
{% for account in group.accounts %}
|
|
{% include "comma.html" %}{{ account.display_name }}
|
|
(<a href="{{ account.url | localuser }}">{{ account.acct }}</a>)
|
|
{% endfor %}
|
|
boosted your toot.
|
|
</p>
|
|
{% include "main/toot_partial.html" with toot=group.0.status reblog=True reblog_by=group.0.account.acct reblog_icon=group.0.account.avatar_static %}
|
|
<hr class="is-hidden">
|
|
{% endif %}
|
|
{% else %}
|
|
{% for note in group %}
|
|
{% if note.type == 'mention' %}
|
|
<p>
|
|
<strong>{{ note.account.display_name }}</strong>
|
|
(<a href="{{ note.account.url | localuser }}">{{ note.account.acct }}</a>)
|
|
mentioned you.
|
|
</p>
|
|
<br>
|
|
{% include "main/toot_partial.html" with toot=note.status reblog=False %}
|
|
<hr class="is-hidden">
|
|
{% elif note.type == 'reblog' %}
|
|
<p>
|
|
{{ note.account.display_name }}
|
|
(<a href="{{ note.account.url | localuser }}">{{ note.account.acct }}</a>)
|
|
boosted your toot.
|
|
(<span>
|
|
<small>{{ note.created_at |humane_time }}</small>
|
|
</span>)
|
|
</p>
|
|
{% include "main/toot_partial.html" with toot=note.status reblog=True reblog_by=note.account.acct reblog_icon=note.account.avatar_static %}
|
|
<hr class="is-hidden">
|
|
{% elif note.type == 'favourite' %}
|
|
<p>
|
|
{{ note.account.display_name }}
|
|
(<a href="{{ note.account.url | localuser}}">{{ note.account.acct }}</a>)
|
|
favorited your toot.
|
|
(<span>
|
|
<small>{{ note.created_at |humane_time }}</small>
|
|
</span>)
|
|
</p>
|
|
{% include "main/toot_partial.html" with toot=note.status %}
|
|
<hr class="is-hidden">
|
|
{% elif note.type == 'follow' %}
|
|
<article class="media">
|
|
<figure class="media-left">
|
|
<p class="image is-64x64">
|
|
<img src="{{ note.account.avatar_static }}" alt="">
|
|
</p>
|
|
</figure>
|
|
<div class="media-content" >
|
|
<div class="content">
|
|
<strong>{{ note.account.display_name }}</strong>
|
|
(<a href="{{ note.account.url |localuser }}">{{ note.account.acct }}</a>)
|
|
followed you.
|
|
(<a href="{{ note.url }}">
|
|
<small>{{ note.created_at |humane_time }}</small>
|
|
</a>)
|
|
</div>
|
|
</div>
|
|
</article>
|
|
<hr class="is-hidden">
|
|
{% elif note.type == 'poll' %}
|
|
<p>A poll you created or voted in has ended.</p>
|
|
{% include "main/toot_partial.html" with toot=note.status %}
|
|
<hr class="is-hidden">
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
|
|
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
|
{% if prev %}
|
|
<a class="pagination-next" href="{% url 'note_prev' prev.min_id %}">Newer</a>
|
|
{% endif %}
|
|
{% if next %}
|
|
<a class="pagination-previous" href="{% url 'note_next' next.max_id %}">Older</a>
|
|
{% endif %}
|
|
</nav>
|
|
|
|
|
|
{% endblock %}
|