1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{% extends "layout.html" %}
{% block title %}notifications — kitgit{% endblock %}
{% block content %}
<section class="kg-section">
<div class="kg-actions" style="justify-content: space-between; align-items: baseline;">
<h1 class="kg-title">notifications</h1>
{% if unread_count > 0 %}
<form method="post" action="/notifications/read-all">
<button class="kg-btn kg-btn--ghost" type="submit">mark all read</button>
</form>
{% endif %}
</div>
{% if notifications.is_empty() %}
<p class="kg-muted">No notifications yet.</p>
{% else %}
<ul class="kg-list kg-notif-list">
{% for n in notifications %}
<li class="{% if n.read_at.is_none() %}kg-notif--unread{% endif %}">
<span class="kg-notif-main">
{% if n.href.is_empty() %}
<strong>{{ n.title }}</strong>
{% else %}
<a href="{{ n.href }}"><strong>{{ n.title }}</strong></a>
{% endif %}
{% if !n.body.is_empty() %}
<span class="kg-muted">{{ n.body }}</span>
{% endif %}
<span class="kg-meta">{{ n.created_at }} · {{ n.kind }}</span>
</span>
<span class="kg-notif-actions">
{% if n.read_at.is_none() %}
<form method="post" action="/notifications/{{ n.id }}/read">
<button class="kg-btn kg-btn--ghost" type="submit">mark read</button>
</form>
{% else %}
<span class="kg-faint">read</span>
{% endif %}
</span>
</li>
{% endfor %}
</ul>
{% endif %}
</section>
{% endblock %}