-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrew Thornton <art27@cantab.net>
- Loading branch information
Showing
4 changed files
with
172 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<div class="ui bottom attached active tab segment" id="notification_div"> | ||
{{if eq (len .Notifications) 0}} | ||
{{if eq .Status 1}} | ||
{{.i18n.Tr "notification.no_unread"}} | ||
{{else}} | ||
{{.i18n.Tr "notification.no_read"}} | ||
{{end}} | ||
{{else}} | ||
<table class="ui unstackable striped very compact small selectable table" id="notification_table"> | ||
<tbody> | ||
{{range $notification := .Notifications}} | ||
{{$issue := .Issue}} | ||
{{$repo := .Repository}} | ||
{{$repoOwner := $repo.MustOwner}} | ||
<tr id="notification_{{.ID}}"> | ||
<td class="collapsing" data-href="{{.HTMLURL}}"> | ||
{{if eq .Status 3}} | ||
<span class="blue">{{svg "octicon-pin" 16}}</span> | ||
{{else if $issue.IsPull}} | ||
{{if $issue.IsClosed}} | ||
{{if $issue.GetPullRequest.HasMerged}} | ||
<span class="purple">{{svg "octicon-git-merge" 16}}</span> | ||
{{else}} | ||
<span class="red">{{svg "octicon-git-pull-request" 16}}</span> | ||
{{end}} | ||
{{else}} | ||
<span class="green">{{svg "octicon-git-pull-request" 16}}</span> | ||
{{end}} | ||
{{else}} | ||
{{if $issue.IsClosed}} | ||
<span class="red">{{svg "octicon-issue-closed" 16}}</span> | ||
{{else}} | ||
<span class="green">{{svg "octicon-issue-opened" 16}}</span> | ||
{{end}} | ||
{{end}} | ||
</td> | ||
<td class="eleven wide" data-href="{{.HTMLURL}}"> | ||
<a class="item" href="{{.HTMLURL}}"> | ||
#{{$issue.Index}} - {{$issue.Title}} | ||
</a> | ||
</td> | ||
<td data-href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}"> | ||
<a class="item" href="{{AppSubUrl}}/{{$repoOwner.Name}}/{{$repo.Name}}"> | ||
{{$repoOwner.Name}}/{{$repo.Name}} | ||
</a> | ||
</td> | ||
<td class="collapsing"> | ||
{{if ne .Status 3}} | ||
<form action="{{AppSubUrl}}/notifications/status" method="POST"> | ||
{{$.CsrfTokenHtml}} | ||
<input type="hidden" name="notification_id" value="{{.ID}}" /> | ||
<input type="hidden" name="status" value="pinned" /> | ||
<button class="ui mini button" title='{{$.i18n.Tr "notification.pin"}}' | ||
data-url="{{AppSubUrl}}/notifications/status" | ||
data-status="pinned" | ||
data-page="{{$.Page.Paginater.Current}}" | ||
data-notification-id="{{.ID}}" | ||
data-q="{{$.Keyword}}"> | ||
{{svg "octicon-pin" 16}} | ||
</button> | ||
</form> | ||
{{end}} | ||
</td> | ||
<td class="collapsing"> | ||
{{if or (eq .Status 1) (eq .Status 3)}} | ||
<form action="{{AppSubUrl}}/notifications/status" method="POST"> | ||
{{$.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}}" /> | ||
<button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_read"}}' | ||
data-url="{{AppSubUrl}}/notifications/status" | ||
data-status="read" | ||
data-page="{{$.Page.Paginater.Current}}" | ||
data-notification-id="{{.ID}}" | ||
data-q="{{$.Keyword}}"> | ||
{{svg "octicon-check" 16}} | ||
</button> | ||
</form> | ||
{{else if eq .Status 2}} | ||
<form action="{{AppSubUrl}}/notifications/status" method="POST"> | ||
{{$.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}}" /> | ||
<button class="ui mini button" title='{{$.i18n.Tr "notification.mark_as_unread"}}' | ||
data-url="{{AppSubUrl}}/notifications/status" | ||
data-status="unread" | ||
data-page="{{$.Page.Paginater.Current}}" | ||
data-notification-id="{{.ID}}" | ||
data-q="{{$.Keyword}}"> | ||
{{svg "octicon-bell" 16}} | ||
</button> | ||
</form> | ||
{{end}} | ||
</td> | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
{{end}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters