treebird/templates/content_notifs.tt
nekobit 0504203df1 Fix notification read all
FossilOrigin-Name: e2f99021b7def56f6fbe347ecec3c1b5310d4b36c09261298054b462499e591c
2022-08-13 06:55:22 +00:00

58 lines
2.7 KiB
Plaintext

<div class="notification-container">
<h1 class="text-header">Notifications</h1>
<div class="menubar">
[% IF notifs %]
<a class="btn btn-single btn-small" href="/notifications/clear">Clear notifications</a>
<form action="/notifications/read" method="post">
<input type="hidden" name="max_id" value="[% notifs.0.id %]">
<input type="submit" class="btn btn-single btn-small" value="Mark as read">
</form>
[% ELSE %]
<span class="btn btn-single btn-small btn-disabled">Clear notifications</span>
<span class="btn btn-single btn-small btn-disabled">Mark as read</span>
[% END %]
</div>
[% IF notifs %]
[% FOREACH notif IN notifs %]
[%# There are 3 types of "different" notifications to render
- Mention, statuses (just regular statuses)
- Favorites, moves, reblogs, polls (no interaction buttons)
- Follows, follow requests
%]
[% IF notif.type == 'mention' ||
notif.type == 'status' ||
notif.type == 'favourite' ||
notif.type == 'reblog' ||
notif.type == 'emoji reaction' ||
notif.type == 'poll' %]
[% create_status(notif.status, notif) %]
[% ELSIF notif.type == 'follow' || notif.type == 'follow request' %]
<table class="notification notification-regular ui-table">
<tr>
<td class="pfp-td">
<img src="[% notif.account.avatar %]" loading="lazy">
</td>
<td class="notification-info">
<div class="notification-info-format">
<span class="notification-text-group-with-icon">
<span title="[% notif.account.acct %]" class="username">[% notif.account.display_name %]</span>
<span class="action">followed</span>
</span>
[% icon('follow') %]
</div>
<div class="notification-content">
<a href="/@[% notif.account.acct %]">@[% notif.account.acct %]</a>
</div>
</td>
</tr>
</table>
[% END %]
[% END %]
[% ELSE %]
<div class="fancy-error">
<span class="fancy-error-kaomoji">[% random_error_kaomoji() %]</span>
<span class="fancy-error-text">No notifications.</span>
</div>
[% END %]
</div>