a mini social media app for small communities
1@include 'partial/header.html'
2
3@if ctx.is_logged_in()
4<script src="/static/js/render_body.js"></script>
5
6<h1>inbox</h1>
7
8<div>
9 @if notifications.len == 0
10 <p>your inbox is empty!</p>
11 @else
12 <form action="/api/user/notification/clear_all" method="post" beep-redirect="/inbox">
13 <button>clear all</button>
14 </form>
15 <hr>
16 @for notification in notifications.reverse()
17 <div class="notification">
18 <div style="display: flex; flex-direction: row; align-items: center; gap: 12px;">
19 <p><strong>@notification.summary</strong></p>
20 <form action="/api/user/notification/clear" method="post" beep-redirect="/inbox" class="form-inline" style="display: inline;">
21 <input type="number" value="@{notification.id}" name="id" required aria-required hidden aria-hidden readonly aria-readonly />
22 <button style="display: inline;">clear</button>
23 </form>
24 </div>
25 <pre id="notif-@{notification.id}">@notification.body</pre>
26 <script>
27 render_body('notif-@{notification.id}')
28 </script>
29 </div>
30 @end
31 @end
32</div>
33@else
34<p>uh oh, you need to be logged in to view this page</p>
35@end
36
37@include 'partial/footer.html'