2023-07-09 14:42:31 -04:00
|
|
|
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-sequence-number="{{.SequenceNumber}}">
|
2020-04-23 23:57:38 -04:00
|
|
|
<div class="ui container">
|
2023-05-24 22:31:26 -04:00
|
|
|
{{$notificationUnreadCount := call .NotificationUnreadCount}}
|
|
|
|
<div class="gt-df gt-ac gt-sb gt-mb-4">
|
|
|
|
<div class="small-menu-items ui compact tiny menu">
|
|
|
|
<a class="{{if eq .Status 1}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=unread">
|
2023-09-25 09:15:51 -04:00
|
|
|
{{ctx.Locale.Tr "notification.unread"}}
|
2023-05-24 22:31:26 -04:00
|
|
|
<div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}gt-hidden{{end}}">{{$notificationUnreadCount}}</div>
|
|
|
|
</a>
|
|
|
|
<a class="{{if eq .Status 2}}active {{end}}item" href="{{AppSubUrl}}/notifications?q=read">
|
2023-09-25 09:15:51 -04:00
|
|
|
{{ctx.Locale.Tr "notification.read"}}
|
2023-05-24 22:31:26 -04:00
|
|
|
</a>
|
|
|
|
</div>
|
2021-04-10 23:46:37 -04:00
|
|
|
{{if and (eq .Status 1)}}
|
2023-06-14 14:17:58 -04:00
|
|
|
<form action="{{AppSubUrl}}/notifications/purge" method="post">
|
2021-04-10 23:46:37 -04:00
|
|
|
{{$.CsrfTokenHtml}}
|
2023-02-18 23:06:14 -05:00
|
|
|
<div class="{{if not $notificationUnreadCount}}gt-hidden{{end}}">
|
2023-09-25 09:15:51 -04:00
|
|
|
<button class="ui mini button primary gt-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
|
2021-04-10 23:46:37 -04:00
|
|
|
{{svg "octicon-checklist"}}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2023-05-24 22:31:26 -04:00
|
|
|
<div class="gt-p-0">
|
|
|
|
<div id="notification_table">
|
|
|
|
{{if eq (len .Notifications) 0}}
|
|
|
|
<div class="gt-df gt-ac gt-fc gt-p-4">
|
|
|
|
{{svg "octicon-inbox" 56 "gt-mb-4"}}
|
|
|
|
{{if eq .Status 1}}
|
2023-09-25 09:15:51 -04:00
|
|
|
{{ctx.Locale.Tr "notification.no_unread"}}
|
2023-05-24 22:31:26 -04:00
|
|
|
{{else}}
|
2023-09-25 09:15:51 -04:00
|
|
|
{{ctx.Locale.Tr "notification.no_read"}}
|
2023-05-24 22:31:26 -04:00
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
{{range $notification := .Notifications}}
|
|
|
|
<div class="notifications-item gt-df gt-ac gt-fw gt-gap-3 gt-p-3" id="notification_{{.ID}}" data-status="{{.Status}}">
|
|
|
|
<div class="notifications-icon gt-ml-3 gt-mr-2 gt-self-start gt-mt-2">
|
|
|
|
{{if .Issue}}
|
|
|
|
{{template "shared/issueicon" .Issue}}
|
|
|
|
{{else}}
|
|
|
|
{{svg "octicon-repo" 16 "text grey"}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
<a class="notifications-link gt-df gt-f1 gt-fc silenced" href="{{.Link}}">
|
|
|
|
<div class="notifications-top-row gt-font-13">
|
2023-06-06 11:17:56 -04:00
|
|
|
{{.Repository.FullName}} {{if .Issue}}<span class="text light-3">#{{.Issue.Index}}</span>{{end}}
|
2021-04-10 23:46:37 -04:00
|
|
|
{{if eq .Status 3}}
|
2023-05-24 22:31:26 -04:00
|
|
|
{{svg "octicon-pin" 13 "text blue gt-mt-1 gt-ml-2"}}
|
2021-04-10 23:46:37 -04:00
|
|
|
{{end}}
|
2023-05-24 22:31:26 -04:00
|
|
|
</div>
|
|
|
|
<div class="notifications-bottom-row gt-font-16 gt-py-1">
|
|
|
|
<span class="issue-title">
|
|
|
|
{{if .Issue}}
|
|
|
|
{{.Issue.Title | RenderEmoji $.Context | RenderCodeBlock}}
|
2021-04-10 23:46:37 -04:00
|
|
|
{{else}}
|
2023-05-24 22:31:26 -04:00
|
|
|
{{.Repository.FullName}}
|
2021-04-10 23:46:37 -04:00
|
|
|
{{end}}
|
2023-05-24 22:31:26 -04:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<div class="notifications-updated gt-ac gt-mr-3">
|
2023-06-06 11:17:56 -04:00
|
|
|
{{if .Issue}}
|
2023-09-25 09:15:51 -04:00
|
|
|
{{TimeSinceUnix .Issue.UpdatedUnix ctx.Locale}}
|
2023-06-06 11:17:56 -04:00
|
|
|
{{else}}
|
2023-09-25 09:15:51 -04:00
|
|
|
{{TimeSinceUnix .UpdatedUnix ctx.Locale}}
|
2023-06-06 11:17:56 -04:00
|
|
|
{{end}}
|
2023-05-24 22:31:26 -04:00
|
|
|
</div>
|
|
|
|
<div class="notifications-buttons gt-ac gt-je gt-gap-2 gt-px-2">
|
|
|
|
{{if ne .Status 3}}
|
2023-06-14 14:17:58 -04:00
|
|
|
<form action="{{AppSubUrl}}/notifications/status" method="post">
|
2023-05-24 22:31:26 -04:00
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input type="hidden" name="notification_id" value="{{.ID}}">
|
|
|
|
<input type="hidden" name="status" value="pinned">
|
2023-09-25 09:15:51 -04:00
|
|
|
<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.pin"}}"
|
2023-05-24 22:31:26 -04:00
|
|
|
data-url="{{AppSubUrl}}/notifications/status"
|
|
|
|
data-status="pinned"
|
|
|
|
data-page="{{$.Page.Paginater.Current}}"
|
|
|
|
data-notification-id="{{.ID}}"
|
|
|
|
data-q="{{$.Keyword}}">
|
|
|
|
{{svg "octicon-pin"}}
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
{{if or (eq .Status 1) (eq .Status 3)}}
|
2023-06-14 14:17:58 -04:00
|
|
|
<form action="{{AppSubUrl}}/notifications/status" method="post">
|
2023-05-24 22:31:26 -04:00
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input type="hidden" name="notification_id" value="{{.ID}}">
|
|
|
|
<input type="hidden" name="status" value="read">
|
|
|
|
<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
|
2023-09-25 09:15:51 -04:00
|
|
|
<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.mark_as_read"}}"
|
2023-05-24 22:31:26 -04:00
|
|
|
data-url="{{AppSubUrl}}/notifications/status"
|
|
|
|
data-status="read"
|
|
|
|
data-page="{{$.Page.Paginater.Current}}"
|
|
|
|
data-notification-id="{{.ID}}"
|
|
|
|
data-q="{{$.Keyword}}">
|
|
|
|
{{svg "octicon-check"}}
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{else if eq .Status 2}}
|
2023-06-14 14:17:58 -04:00
|
|
|
<form action="{{AppSubUrl}}/notifications/status" method="post">
|
2023-05-24 22:31:26 -04:00
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<input type="hidden" name="notification_id" value="{{.ID}}">
|
|
|
|
<input type="hidden" name="status" value="unread">
|
|
|
|
<input type="hidden" name="page" value="{{$.Page.Paginater.Current}}">
|
2023-09-25 09:15:51 -04:00
|
|
|
<button class="btn interact-bg gt-p-3" title="{{ctx.Locale.Tr "notification.mark_as_unread"}}"
|
2023-05-24 22:31:26 -04:00
|
|
|
data-url="{{AppSubUrl}}/notifications/status"
|
|
|
|
data-status="unread"
|
|
|
|
data-page="{{$.Page.Paginater.Current}}"
|
|
|
|
data-notification-id="{{.ID}}"
|
|
|
|
data-q="{{$.Keyword}}">
|
|
|
|
{{svg "octicon-bell"}}
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
</div>
|
2021-04-10 23:46:37 -04:00
|
|
|
</div>
|
|
|
|
{{template "base/paginate" .}}
|
|
|
|
</div>
|
2020-04-23 23:57:38 -04:00
|
|
|
</div>
|