|
1 | 1 | {{template "base/head" .}} |
2 | | - |
3 | | -<div class="user notification"> |
4 | | - <div class="ui container"> |
5 | | - <h1 class="ui dividing header">{{.i18n.Tr "notification.notifications"}}</h1> |
6 | | - |
7 | | - <div class="ui top attached tabular menu"> |
8 | | - <a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active{{end}} item"> |
9 | | - {{.i18n.Tr "notification.unread"}} |
10 | | - {{if .NotificationUnreadCount}} |
11 | | - <div class="ui label">{{.NotificationUnreadCount}}</div> |
12 | | - {{end}} |
13 | | - </a> |
14 | | - <a href="{{AppSubUrl}}/notifications?q=read" class="{{if eq .Status 2}}active{{end}} item"> |
15 | | - {{.i18n.Tr "notification.read"}} |
16 | | - </a> |
17 | | - {{if and (eq .Status 1) (.NotificationUnreadCount)}} |
18 | | - <form action="{{AppSubUrl}}/notifications/purge" method="POST" style="margin-left: auto;"> |
19 | | - {{$.CsrfTokenHtml}} |
20 | | - <button class="ui mini button primary" title='{{$.i18n.Tr "notification.mark_all_as_read"}}'> |
21 | | - {{svg "octicon-checklist" 16}} |
22 | | - </button> |
23 | | - </form> |
24 | | - {{end}} |
25 | | - </div> |
26 | | - <div class="ui bottom attached active tab segment"> |
27 | | - {{if eq (len .Notifications) 0}} |
28 | | - {{if eq .Status 1}} |
29 | | - {{.i18n.Tr "notification.no_unread"}} |
30 | | - {{else}} |
31 | | - {{.i18n.Tr "notification.no_read"}} |
32 | | - {{end}} |
33 | | - {{else}} |
34 | | - <table class="ui unstackable striped very compact small selectable table"> |
35 | | - <tbody> |
36 | | - {{range $notification := .Notifications}} |
37 | | - {{$issue := $notification.Issue}} |
38 | | - {{$repo := $notification.Repository}} |
39 | | - {{$repoOwner := $repo.MustOwner}} |
40 | | - |
41 | | - <tr data-href="{{$notification.HTMLURL}}"> |
42 | | - <td class="collapsing"> |
43 | | - {{if eq $notification.Status 3}} |
44 | | - <span class="blue">{{svg "octicon-pin" 16}}</span> |
45 | | - {{else if $issue.IsPull}} |
46 | | - {{if $issue.IsClosed}} |
47 | | - {{if $issue.GetPullRequest.HasMerged}} |
48 | | - <span class="purple">{{svg "octicon-git-merge" 16}}</span> |
49 | | - {{else}} |
50 | | - <span class="red">{{svg "octicon-git-pull-request" 16}}</span> |
51 | | - {{end}} |
52 | | - {{else}} |
53 | | - <span class="green">{{svg "octicon-git-pull-request" 16}}</span> |
54 | | - {{end}} |
55 | | - {{else}} |
56 | | - {{if $issue.IsClosed}} |
57 | | - <span class="red">{{svg "octicon-issue-closed" 16}}</span> |
58 | | - {{else}} |
59 | | - <span class="green">{{svg "octicon-issue-opened" 16}}</span> |
60 | | - {{end}} |
61 | | - {{end}} |
62 | | - </td> |
63 | | - <td class="eleven wide"> |
64 | | - <a class="item" href="{{$notification.HTMLURL}}"> |
65 | | - #{{$issue.Index}} - {{$issue.Title}} |
66 | | - </a> |
67 | | - </td> |
68 | | - <td> |
69 | | - <a class="item" href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}"> |
70 | | - {{$repoOwner.Name}}/{{$repo.Name}} |
71 | | - </a> |
72 | | - </td> |
73 | | - <td class="collapsing"> |
74 | | - {{if ne $notification.Status 3}} |
75 | | - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
76 | | - {{$.CsrfTokenHtml}} |
77 | | - <input type="hidden" name="notification_id" value="{{$notification.ID}}" /> |
78 | | - <input type="hidden" name="status" value="pinned" /> |
79 | | - <button class="ui mini button" title='{{$.i18n.Tr "notification.pin"}}'> |
80 | | - {{svg "octicon-pin" 16}} |
81 | | - </button> |
82 | | - </form> |
83 | | - {{end}} |
84 | | - </td> |
85 | | - <td class="collapsing"> |
86 | | - {{if or (eq $notification.Status 1) (eq $notification.Status 3)}} |
87 | | - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
88 | | - {{$.CsrfTokenHtml}} |
89 | | - <input type="hidden" name="notification_id" value="{{$notification.ID}}" /> |
90 | | - <input type="hidden" name="status" value="read" /> |
91 | | - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" /> |
92 | | - <button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_read"}}'> |
93 | | - {{svg "octicon-check" 16}} |
94 | | - </button> |
95 | | - </form> |
96 | | - {{else if eq $notification.Status 2}} |
97 | | - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
98 | | - {{$.CsrfTokenHtml}} |
99 | | - <input type="hidden" name="notification_id" value="{{$notification.ID}}" /> |
100 | | - <input type="hidden" name="status" value="unread" /> |
101 | | - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}" /> |
102 | | - <button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_unread"}}'> |
103 | | - {{svg "octicon-bell" 16}} |
104 | | - </button> |
105 | | - </form> |
106 | | - {{end}} |
107 | | - </td> |
108 | | - </tr> |
109 | | - {{end}} |
110 | | - </tbody> |
111 | | - </table> |
112 | | - {{end}} |
113 | | - </div> |
114 | | - |
115 | | - {{template "base/paginate" .}} |
116 | | - </div> |
117 | | -</div> |
118 | | - |
| 2 | +{{template "user/notification/notification_div" .}} |
119 | 3 | {{template "base/footer" .}} |
0 commit comments