OXYGENHUB
# 1b6536f06132 oxygenhub / templates / notifications.html
4.3 KiB · HTML · last changed Notifications by thread: participating versus watching, filters by kind and repository, read, unread and done per thread, and opening a row marks it read 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% block title %}Notifications{% endblock %}
3
{% block content %}
4
<div class="head"><h1>Notifications <small>{{ unread }} unread</small></h1></div>
5
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
6
<div class="sectioned inbox">
7
<nav class="section-nav inbox-nav" aria-label="Filters">
8
  <a href="{{ q.with("view", "") }}"{% if q.view.is_empty() %} class="on" aria-current="page"{% endif %}>Inbox</a>
9
  <a href="{{ q.with("view", "unread") }}"{% if q.view == "unread" %} class="on" aria-current="page"{% endif %}>Unread{% if unread > 0 %} <span class="count-chip">{{ unread }}</span>{% endif %}</a>
10
  <a href="{{ q.with("view", "done") }}"{% if q.view == "done" %} class="on" aria-current="page"{% endif %}>Done</a>
11
  <h3>Why</h3>
12
  <a href="{{ q.with("reason", "") }}"{% if q.reason.is_empty() %} class="on"{% endif %}>Everything</a>
13
  <a href="{{ q.with("reason", "participating") }}"{% if q.reason == "participating" %} class="on"{% endif %} title="You opened, commented, were assigned, mentioned or asked to review">Participating</a>
14
  <a href="{{ q.with("reason", "watching") }}"{% if q.reason == "watching" %} class="on"{% endif %} title="You only watch the repository">Watching</a>
15
  {% if !kinds.is_empty() %}<h3>Kind</h3>
16
  <a href="{{ q.with("kind", "") }}"{% if q.kind.is_empty() %} class="on"{% endif %}>All kinds</a>
17
  {% for (k, n) in kinds %}<a href="{{ q.with("kind", k) }}"{% if &q.kind == k %} class="on"{% endif %}>{{ k }} <span class="small mute">{{ n }}</span></a>{% endfor %}{% endif %}
18
  {% if !repos.is_empty() %}<h3>Repository</h3>
19
  <a href="{{ q.with("repo", "") }}"{% if q.repo.is_empty() %} class="on"{% endif %}>All repositories</a>
20
  {% for (r, n) in repos %}<a href="{{ q.with("repo", r) }}"{% if &q.repo == r %} class="on"{% endif %}>{{ r }} <span class="small mute">{{ n }}</span></a>{% endfor %}{% endif %}
21
</nav>
22
<div class="sections">
23
<div class="bar">
24
  <form method="post" action="/notifications/read"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><button type="submit" class="small">MARK ALL READ</button></form>
25
  <form method="post" action="/settings/notifications"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><label class="small"><input type="checkbox" name="email" value="1"{% if email_on %} checked{% endif %}> email me too</label> <button type="submit" class="small">SAVE</button></form>
26
</div>
27
{% if threads.is_empty() %}
28
<p class="empty">{% if q.view == "done" %}Nothing set aside.{% else if q.view == "unread" %}All read.{% else if !q.reason.is_empty() || !q.kind.is_empty() || !q.repo.is_empty() %}Nothing matches these filters.{% else %}Nothing yet. Watch a repository or take part in a thread and its events land here.{% endif %}</p>
29
{% else %}
30
<ul class="rows threads">
31
{% for t in threads %}
32
  <li{% if t.unread > 0 %} class="unread"{% endif %} data-row-thread="{{ t.thread }}">
33
    <div>
34
      <a class="name" href="/notifications/open/{{ t.id }}">{% if t.unread > 0 %}<span class="sig sig-valid" title="unread">●</span> {% endif %}{{ t.title }}</a>
35
      <p class="small">{% if let Some(r) = t.repo %}<span class="mute">{{ r }}</span> · {% endif %}{{ t.kind }} · {{ t.actor }} · <time title="{{ t.at_ms|when_i }}">{{ t.at_ms|ago_i }}</time>{% if t.count > 1 %} · {{ t.count }} updates{% if t.unread > 0 && t.unread < t.count %}, {{ t.unread }} new{% endif %}{% endif %} · <span class="tag{% if !t.participating %} dim{% endif %}">{% if t.participating %}participating{% else %}watching{% endif %}</span></p>
36
    </div>
37
    <div class="right">
38
      <form class="tiny" method="post" action="/notifications/thread"><input type="hidden" name="_csrf" value="{{ shell.csrf }}"><input type="hidden" name="thread" value="{{ t.thread }}"><input type="hidden" name="back" value="{{ q.here() }}">
39
        {% if t.unread > 0 %}<button name="action" value="read" title="Mark the thread read">read</button>{% else %}<button name="action" value="unread" title="Mark the thread unread">unread</button>{% endif %}
40
        {% if t.done %}<button name="action" value="undone" title="Back to the inbox">move to inbox</button>{% else %}<button name="action" value="done" title="Set the thread aside until something new happens">done</button>{% endif %}
41
      </form>
42
    </div>
43
  </li>
44
{% endfor %}
45
</ul>
46
{% endif %}
47
</div>
48
</div>
49
{% endblock %}