first-commit
This commit is contained in:
3
templates/user/notification/notification.tmpl
Normal file
3
templates/user/notification/notification.tmpl
Normal file
@@ -0,0 +1,3 @@
|
||||
{{template "base/head" .}}
|
||||
{{template "user/notification/notification_div" .}}
|
||||
{{template "base/footer" .}}
|
97
templates/user/notification/notification_div.tmpl
Normal file
97
templates/user/notification/notification_div.tmpl
Normal file
@@ -0,0 +1,97 @@
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content user notification" id="notification_div" data-sequence-number="{{.SequenceNumber}}">
|
||||
<div class="ui container">
|
||||
{{$statusUnread := 1}}{{$statusRead := 2}}{{$statusPinned := 3}}
|
||||
{{$notificationUnreadCount := call .PageGlobalData.GetNotificationUnreadCount}}
|
||||
{{$pageTypeIsRead := eq $.PageType "read"}}
|
||||
<div class="flex-text-block tw-justify-between tw-mb-[--page-spacing]">
|
||||
<div class="small-menu-items ui compact tiny menu">
|
||||
<a class="{{if not $pageTypeIsRead}}active{{end}} item" href="{{AppSubUrl}}/notifications?type=unread">
|
||||
{{ctx.Locale.Tr "notification.unread"}}
|
||||
<div class="notifications-unread-count ui label {{if not $notificationUnreadCount}}tw-hidden{{end}}">{{$notificationUnreadCount}}</div>
|
||||
</a>
|
||||
<a class="{{if $pageTypeIsRead}}active{{end}} item" href="{{AppSubUrl}}/notifications?type=read">
|
||||
{{ctx.Locale.Tr "notification.read"}}
|
||||
</a>
|
||||
</div>
|
||||
{{if and (not $pageTypeIsRead) $notificationUnreadCount}}
|
||||
<form action="{{AppSubUrl}}/notifications/purge" method="post">
|
||||
{{$.CsrfTokenHtml}}
|
||||
<button class="ui mini button primary tw-mr-0" title="{{ctx.Locale.Tr "notification.mark_all_as_read"}}">
|
||||
{{svg "octicon-checklist"}}
|
||||
</button>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
<div id="notification_table">
|
||||
{{range $one := .Notifications}}
|
||||
<div class="notifications-item" id="notification_{{$one.ID}}" data-status="{{$one.Status}}">
|
||||
<div class="tw-self-start tw-mt-[2px]">
|
||||
{{if $one.Issue}}
|
||||
{{template "shared/issueicon" $one.Issue}}
|
||||
{{else}}
|
||||
{{svg "octicon-repo" 16 "text grey"}}
|
||||
{{end}}
|
||||
</div>
|
||||
<a class="notifications-link silenced tw-flex-1" href="{{$one.Link ctx}}">
|
||||
<div class="flex-text-block tw-text-[0.95em]">
|
||||
{{$one.Repository.FullName}} {{if $one.Issue}}<span class="text light-3">#{{$one.Issue.Index}}</span>{{end}}
|
||||
{{if eq $one.Status $statusPinned}}
|
||||
{{svg "octicon-pin" 13 "text blue"}}
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="tw-text-16 tw-py-0.5">
|
||||
{{if $one.Issue}}
|
||||
{{$one.Issue.Title | ctx.RenderUtils.RenderIssueSimpleTitle}}
|
||||
{{else}}
|
||||
{{$one.Repository.FullName}}
|
||||
{{end}}
|
||||
</div>
|
||||
</a>
|
||||
<div class="notifications-updated flex-text-inline">
|
||||
{{if $one.Issue}}
|
||||
{{DateUtils.TimeSince $one.Issue.UpdatedUnix}}
|
||||
{{else}}
|
||||
{{DateUtils.TimeSince $one.UpdatedUnix}}
|
||||
{{end}}
|
||||
</div>
|
||||
<form class="notifications-buttons" action="{{AppSubUrl}}/notifications/status?type={{$.PageType}}&page={{$.Page.Paginater.Current}}&perPage={{$.Page.Paginater.PagingNum}}" method="post"
|
||||
hx-boost="true" hx-target="#notification_div" hx-swap="outerHTML"
|
||||
>
|
||||
{{$.CsrfTokenHtml}}
|
||||
<input type="hidden" name="notification_id" value="{{$one.ID}}">
|
||||
{{if ne $one.Status $statusPinned}}
|
||||
<button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.pin"}}"
|
||||
name="notification_action" value="pin"
|
||||
>
|
||||
{{svg "octicon-pin"}}
|
||||
</button>
|
||||
{{end}}
|
||||
{{if or (eq $one.Status $statusUnread) (eq $one.Status $statusPinned)}}
|
||||
<button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.mark_as_read"}}"
|
||||
name="notification_action" value="mark_as_read"
|
||||
>
|
||||
{{svg "octicon-check"}}
|
||||
</button>
|
||||
{{else if eq $one.Status $statusRead}}
|
||||
<button class="btn interact-bg tw-p-2" data-tooltip-content="{{ctx.Locale.Tr "notification.mark_as_unread"}}"
|
||||
name="notification_action" value="mark_as_unread"
|
||||
>
|
||||
{{svg "octicon-bell"}}
|
||||
</button>
|
||||
{{end}}
|
||||
</form>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="empty-placeholder">
|
||||
{{svg "octicon-inbox" 56 "tw-mb-4"}}
|
||||
{{if $pageTypeIsRead}}
|
||||
{{ctx.Locale.Tr "notification.no_read"}}
|
||||
{{else}}
|
||||
{{ctx.Locale.Tr "notification.no_unread"}}
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
79
templates/user/notification/notification_subscriptions.tmpl
Normal file
79
templates/user/notification/notification_subscriptions.tmpl
Normal file
@@ -0,0 +1,79 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content user notification">
|
||||
<div class="ui container">
|
||||
<div class="ui compact small menu small-menu-items">
|
||||
<a href="{{AppSubUrl}}/notifications/subscriptions" class="{{if eq .Status 1}}active {{end}}item">
|
||||
{{ctx.Locale.Tr "notification.subscriptions"}}
|
||||
</a>
|
||||
<a href="{{AppSubUrl}}/notifications/watching" class="{{if eq .Status 2}}active {{end}}item">
|
||||
{{ctx.Locale.Tr "notification.watching"}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="ui top attached segment">
|
||||
{{if eq .Status 1}}
|
||||
<div class="tw-flex tw-justify-between">
|
||||
<div class="tw-flex">
|
||||
<div class="small-menu-items ui compact tiny menu">
|
||||
<a class="{{if eq .State "all"}}active {{end}}item" href="?sort={{$.SortType}}&state=all&issueType={{$.IssueType}}&labels={{$.Labels}}">
|
||||
{{ctx.Locale.Tr "all"}}
|
||||
</a>
|
||||
<a class="{{if eq .State "open"}}active {{end}}item" href="?sort={{$.SortType}}&state=open&issueType={{$.IssueType}}&labels={{$.Labels}}">
|
||||
{{svg "octicon-issue-opened" 16 "tw-mr-2"}}
|
||||
{{ctx.Locale.Tr "repo.issues.open_title"}}
|
||||
</a>
|
||||
<a class="{{if eq .State "closed"}}active {{end}}item" href="?sort={{$.SortType}}&state=closed&issueType={{$.IssueType}}&labels={{$.Labels}}">
|
||||
{{svg "octicon-issue-closed" 16 "tw-mr-2"}}
|
||||
{{ctx.Locale.Tr "repo.issues.closed_title"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw-flex tw-justify-between">
|
||||
<div class="ui secondary filter menu labels">
|
||||
<!-- Type -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_type"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .IssueType "all") (not .IssueType)}}active {{end}}item" href="?sort={{$.SortType}}&state={{$.State}}&issueType=all&labels={{$.Labels}}">{{ctx.Locale.Tr "all"}}</a>
|
||||
<a class="{{if eq .IssueType "issues"}}active {{end}}item" href="?sort={{$.SortType}}&state={{$.State}}&issueType=issues&labels={{$.Labels}}">{{ctx.Locale.Tr "issues"}}</a>
|
||||
<a class="{{if eq .IssueType "pulls"}}active {{end}}item" href="?sort={{$.SortType}}&state={{$.State}}&issueType=pulls&labels={{$.Labels}}">{{ctx.Locale.Tr "pull_requests"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sort -->
|
||||
<div class="ui dropdown type jump item">
|
||||
<span class="text">
|
||||
{{ctx.Locale.Tr "repo.issues.filter_sort"}}
|
||||
</span>
|
||||
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
|
||||
<div class="menu">
|
||||
<a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="?sort=latest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
|
||||
<a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?sort=oldest&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
|
||||
<a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?sort=recentupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
|
||||
<a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?sort=leastupdate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
|
||||
<a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="?sort=mostcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
|
||||
<a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="?sort=leastcomment&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
|
||||
<a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="?sort=nearduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
|
||||
<a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="?sort=farduedate&state={{$.State}}&issueType={{$.IssueType}}&labels={{$.Labels}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="divider"></div>
|
||||
{{if not .Issues}}
|
||||
{{ctx.Locale.Tr "notification.no_subscriptions"}}
|
||||
{{else}}
|
||||
{{template "shared/issuelist" dict "." . "listType" "dashboard"}}
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{template "shared/repo/search" .}}
|
||||
{{template "shared/repo/list" .}}
|
||||
{{template "base/paginate" .}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "base/footer" .}}
|
Reference in New Issue
Block a user