internal/web/templates/notifications.html
27 lines · 1627 bytes
1{{define "width"}}wide{{end}}
2{{define "title"}}notifications · {{.Site}}{{end}}
3{{define "content"}}
4<div id="notif-root">
5<div class="listhead">
6 <h1>Notifications</h1>
7 <nav class="filters" aria-label="Filter notifications" data-tab-swap="notif-root">
8 <a {{if not .All}}class="active" aria-current="page" {{end}}href="/notifications">Unread</a>
9 <a {{if .All}}class="active" aria-current="page" {{end}}href="/notifications?all=1">All</a>
10 </nav>
11 <input type="search" class="tablefilter" aria-label="Filter notifications" placeholder="Filter notifications…" data-filter-list="notif-root">
12 <span class="spacer"></span>
13 <button type="button" class="btn" data-refresh="/notifications{{if .All}}?all=1{{end}}" data-refresh-target="notif-root">Refresh</button>
14 {{if .Notices}}<form method="post" action="/notifications" class="inline" data-notif-form="1"><button type="submit" class="btn">Mark all read</button></form>{{end}}
15</div>
16<ul class="issuelist rows">
17{{range .Notices}}<li{{if not .Read}} class="unread"{{end}}>
18 <div class="issuemain">
19 <p class="title"><a href="{{.Href}}">{{.Actor}} {{.Summary}}</a></p>
20 <p class="meta"><a href="/{{.RepoPath}}">{{.RepoPath}}</a> · {{when .CreatedAt}}</p>
21 </div>
22 {{if not .Read}}<form method="post" action="/notifications" class="inline" data-notif-form="1"><input type="hidden" name="id" value="{{.ID}}"><button type="submit" class="btn">Mark read</button></form>{{end}}
23</li>
24{{else}}<li class="empty">{{if .All}}nothing to show{{else}}no unread notifications — <a href="/notifications?all=1">show all</a>{{end}}</li>{{end}}
25</ul>
26</div>
27{{end}}