|
1 | 1 | <div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-params="{{.Page.GetParams}}" data-sequence-number="{{.SequenceNumber}}">
|
2 | 2 | <div class="ui container">
|
3 |
| - <h1 class="ui header gt-df gt-ac"> |
4 |
| - {{svg "octicon-bell" 28 "gt-mr-3 gt-mt-1"}} |
5 |
| - {{.locale.Tr "notification.notifications"}} |
6 |
| - </h1> |
7 |
| - <div class="ui top attached tabular menu"> |
8 |
| - {{$notificationUnreadCount := call .NotificationUnreadCount}} |
9 |
| - <a href="{{AppSubUrl}}/notifications?q=unread" class="{{if eq .Status 1}}active {{end}}item"> |
10 |
| - {{.locale.Tr "notification.unread"}} |
11 |
| - <div class="ui label {{if not $notificationUnreadCount}}gt-hidden{{end}}">{{$notificationUnreadCount}}</div> |
12 |
| - </a> |
13 |
| - <a href="{{AppSubUrl}}/notifications?q=read" class="{{if eq .Status 2}}active {{end}}item"> |
14 |
| - {{.locale.Tr "notification.read"}} |
15 |
| - </a> |
| 3 | + {{$notificationUnreadCount := call .NotificationUnreadCount}} |
| 4 | + <div class="gt-df gt-ac gt-sb gt-mb-4"> |
| 5 | + <div class="small-menu-items ui compact tiny menu"> |
| 6 | + <a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread"> |
| 7 | + {{.locale.Tr "notification.unread"}} |
| 8 | + <div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}gt-hidden{{end}}">{{$notificationUnreadCount}}</div> |
| 9 | + </a> |
| 10 | + <a class="{{if eq .Status 2}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=read"> |
| 11 | + {{.locale.Tr "notification.read"}} |
| 12 | + </a> |
| 13 | + </div> |
16 | 14 | {{if and (eq .Status 1)}}
|
17 |
| - <form class="gt-ml-auto" action="{{AppSubUrl}}/notifications/purge" method="POST"> |
| 15 | + <form action="{{AppSubUrl}}/notifications/purge" method="POST"> |
18 | 16 | {{$.CsrfTokenHtml}}
|
19 | 17 | <div class="{{if not $notificationUnreadCount}}gt-hidden{{end}}">
|
20 | 18 | <button class="ui mini button primary gt-mr-0" title='{{$.locale.Tr "notification.mark_all_as_read"}}'>
|
|
24 | 22 | </form>
|
25 | 23 | {{end}}
|
26 | 24 | </div>
|
27 |
| - <div class="ui bottom attached active tab segment gt-p-3"> |
28 |
| - {{if eq (len .Notifications) 0}} |
29 |
| - <div class="gt-df gt-ac gt-fc gt-p-4"> |
30 |
| - {{svg "octicon-inbox" 56 "gt-mb-4"}} |
31 |
| - {{if eq .Status 1}} |
32 |
| - {{.locale.Tr "notification.no_unread"}} |
33 |
| - {{else}} |
34 |
| - {{.locale.Tr "notification.no_read"}} |
35 |
| - {{end}} |
36 |
| - </div> |
37 |
| - {{else}} |
38 |
| - <table class="ui unstackable very compact small table" id="notification_table"> |
39 |
| - <tbody> |
40 |
| - {{range $notification := .Notifications}} |
41 |
| - {{$issue := .Issue}} |
42 |
| - {{$repo := .Repository}} |
43 |
| - <tr id="notification_{{.ID}}"> |
44 |
| - <td class="collapsing gt-pl-4"> |
| 25 | + <div class="gt-p-0"> |
| 26 | + <div id="notification_table"> |
| 27 | + {{if eq (len .Notifications) 0}} |
| 28 | + <div class="gt-df gt-ac gt-fc gt-p-4"> |
| 29 | + {{svg "octicon-inbox" 56 "gt-mb-4"}} |
| 30 | + {{if eq .Status 1}} |
| 31 | + {{.locale.Tr "notification.no_unread"}} |
| 32 | + {{else}} |
| 33 | + {{.locale.Tr "notification.no_read"}} |
| 34 | + {{end}} |
| 35 | + </div> |
| 36 | + {{else}} |
| 37 | + {{$locale := .locale}} |
| 38 | + {{range $notification := .Notifications}} |
| 39 | + <div class="notifications-item gt-df gt-ac gt-fw gt-gap-3 gt-p-3" id="notification_{{.ID}}" data-status="{{.Status}}"> |
| 40 | + <div class="notifications-icon gt-ml-3 gt-mr-2 gt-self-start gt-mt-2"> |
| 41 | + {{if .Issue}} |
| 42 | + {{template "shared/issueicon" .Issue}} |
| 43 | + {{else}} |
| 44 | + {{svg "octicon-repo" 16 "text grey"}} |
| 45 | + {{end}} |
| 46 | + </div> |
| 47 | + <a class="notifications-link gt-df gt-f1 gt-fc silenced" href="{{.Link}}"> |
| 48 | + <div class="notifications-top-row gt-font-13"> |
| 49 | + {{.Repository.FullName}} <span class="text light-3">#{{.Issue.Index}}</span> |
45 | 50 | {{if eq .Status 3}}
|
46 |
| - {{svg "octicon-pin" 16 "text blue"}} |
47 |
| - {{else if not $issue}} |
48 |
| - {{svg "octicon-repo" 16 "text grey"}} |
49 |
| - {{else if $issue.IsPull}} |
50 |
| - {{if $issue.IsClosed}} |
51 |
| - {{if $issue.GetPullRequest.HasMerged}} |
52 |
| - {{svg "octicon-git-merge" 16 "text purple"}} |
53 |
| - {{else}} |
54 |
| - {{svg "octicon-git-pull-request" 16 "text red"}} |
55 |
| - {{end}} |
56 |
| - {{else}} |
57 |
| - {{svg "octicon-git-pull-request" 16 "text green"}} |
58 |
| - {{end}} |
59 |
| - {{else}} |
60 |
| - {{if $issue.IsClosed}} |
61 |
| - {{svg "octicon-issue-closed" 16 "text red"}} |
62 |
| - {{else}} |
63 |
| - {{svg "octicon-issue-opened" 16 "text green"}} |
64 |
| - {{end}} |
| 51 | + {{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}} |
65 | 52 | {{end}}
|
66 |
| - </td> |
67 |
| - <td class="eleven wide"> |
68 |
| - <a class="item issue-title muted" href="{{.Link}}"> |
69 |
| - {{if $issue}} |
70 |
| - #{{$issue.Index}} - {{$issue.Title | RenderEmoji $.Context | RenderCodeBlock}} |
| 53 | + </div> |
| 54 | + <div class="notifications-bottom-row gt-font-16 gt-py-1"> |
| 55 | + <span class="issue-title"> |
| 56 | + {{if .Issue}} |
| 57 | + {{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}} |
71 | 58 | {{else}}
|
72 |
| - {{$repo.FullName}} |
| 59 | + {{.Repository.FullName}} |
73 | 60 | {{end}}
|
74 |
| - </a> |
75 |
| - </td> |
76 |
| - <td> |
77 |
| - <a class="item muted" href="{{$repo.Link}}">{{$repo.FullName}}</a> |
78 |
| - </td> |
79 |
| - <td class="collapsing"> |
80 |
| - {{if ne .Status 3}} |
81 |
| - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
82 |
| - {{$.CsrfTokenHtml}} |
83 |
| - <input type="hidden" name="notification_id" value="{{.ID}}"> |
84 |
| - <input type="hidden" name="status" value="pinned"> |
85 |
| - <button class="ui mini button button-ghost" title='{{$.locale.Tr "notification.pin"}}' |
86 |
| - data-url="{{AppSubUrl}}/notifications/status" |
87 |
| - data-status="pinned" |
88 |
| - data-page="{{$.Page.Paginater.Current}}" |
89 |
| - data-notification-id="{{.ID}}" |
90 |
| - data-q="{{$.Keyword}}"> |
91 |
| - {{svg "octicon-pin"}} |
92 |
| - </button> |
93 |
| - </form> |
94 |
| - {{end}} |
95 |
| - </td> |
96 |
| - <td class="collapsing"> |
97 |
| - {{if or (eq .Status 1) (eq .Status 3)}} |
98 |
| - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
99 |
| - {{$.CsrfTokenHtml}} |
100 |
| - <input type="hidden" name="notification_id" value="{{.ID}}"> |
101 |
| - <input type="hidden" name="status" value="read"> |
102 |
| - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
103 |
| - <button class="ui mini button button-ghost" title='{{$.locale.Tr "notification.mark_as_read"}}' |
104 |
| - data-url="{{AppSubUrl}}/notifications/status" |
105 |
| - data-status="read" |
106 |
| - data-page="{{$.Page.Paginater.Current}}" |
107 |
| - data-notification-id="{{.ID}}" |
108 |
| - data-q="{{$.Keyword}}"> |
109 |
| - {{svg "octicon-check"}} |
110 |
| - </button> |
111 |
| - </form> |
112 |
| - {{else if eq .Status 2}} |
113 |
| - <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
114 |
| - {{$.CsrfTokenHtml}} |
115 |
| - <input type="hidden" name="notification_id" value="{{.ID}}"> |
116 |
| - <input type="hidden" name="status" value="unread"> |
117 |
| - <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
118 |
| - <button class="ui mini button button-ghost" title='{{$.locale.Tr "notification.mark_as_unread"}}' |
119 |
| - data-url="{{AppSubUrl}}/notifications/status" |
120 |
| - data-status="unread" |
121 |
| - data-page="{{$.Page.Paginater.Current}}" |
122 |
| - data-notification-id="{{.ID}}" |
123 |
| - data-q="{{$.Keyword}}"> |
124 |
| - {{svg "octicon-bell"}} |
125 |
| - </button> |
126 |
| - </form> |
127 |
| - {{end}} |
128 |
| - </td> |
129 |
| - </tr> |
130 |
| - {{end}} |
131 |
| - </tbody> |
132 |
| - </table> |
133 |
| - {{end}} |
| 61 | + </span> |
| 62 | + </div> |
| 63 | + </a> |
| 64 | + <div class="notifications-updated gt-ac gt-mr-3"> |
| 65 | + {{TimeSinceUnix .Issue.UpdatedUnix $locale}} |
| 66 | + </div> |
| 67 | + <div class="notifications-buttons gt-ac gt-je gt-gap-2 gt-px-2"> |
| 68 | + {{if ne .Status 3}} |
| 69 | + <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
| 70 | + {{$.CsrfTokenHtml}} |
| 71 | + <input type="hidden" name="notification_id" value="{{.ID}}"> |
| 72 | + <input type="hidden" name="status" value="pinned"> |
| 73 | + <button class="ui mini button button-ghost gt-p-3" title='{{$.locale.Tr "notification.pin"}}' |
| 74 | + data-url="{{AppSubUrl}}/notifications/status" |
| 75 | + data-status="pinned" |
| 76 | + data-page="{{$.Page.Paginater.Current}}" |
| 77 | + data-notification-id="{{.ID}}" |
| 78 | + data-q="{{$.Keyword}}"> |
| 79 | + {{svg "octicon-pin"}} |
| 80 | + </button> |
| 81 | + </form> |
| 82 | + {{end}} |
| 83 | + {{if or (eq .Status 1) (eq .Status 3)}} |
| 84 | + <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
| 85 | + {{$.CsrfTokenHtml}} |
| 86 | + <input type="hidden" name="notification_id" value="{{.ID}}"> |
| 87 | + <input type="hidden" name="status" value="read"> |
| 88 | + <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
| 89 | + <button class="ui mini button button-ghost gt-p-3" title='{{$.locale.Tr "notification.mark_as_read"}}' |
| 90 | + data-url="{{AppSubUrl}}/notifications/status" |
| 91 | + data-status="read" |
| 92 | + data-page="{{$.Page.Paginater.Current}}" |
| 93 | + data-notification-id="{{.ID}}" |
| 94 | + data-q="{{$.Keyword}}"> |
| 95 | + {{svg "octicon-check"}} |
| 96 | + </button> |
| 97 | + </form> |
| 98 | + {{else if eq .Status 2}} |
| 99 | + <form action="{{AppSubUrl}}/notifications/status" method="POST"> |
| 100 | + {{$.CsrfTokenHtml}} |
| 101 | + <input type="hidden" name="notification_id" value="{{.ID}}"> |
| 102 | + <input type="hidden" name="status" value="unread"> |
| 103 | + <input type="hidden" name="page" value="{{$.Page.Paginater.Current}}"> |
| 104 | + <button class="ui mini button button-ghost gt-p-3" title='{{$.locale.Tr "notification.mark_as_unread"}}' |
| 105 | + data-url="{{AppSubUrl}}/notifications/status" |
| 106 | + data-status="unread" |
| 107 | + data-page="{{$.Page.Paginater.Current}}" |
| 108 | + data-notification-id="{{.ID}}" |
| 109 | + data-q="{{$.Keyword}}"> |
| 110 | + {{svg "octicon-bell"}} |
| 111 | + </button> |
| 112 | + </form> |
| 113 | + {{end}} |
| 114 | + </div> |
| 115 | + </div> |
| 116 | + {{end}} |
| 117 | + {{end}} |
| 118 | + </div> |
134 | 119 | </div>
|
135 | 120 | {{template "base/paginate" .}}
|
136 | 121 | </div>
|
|
0 commit comments