You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

notification.tmpl 4.3KB

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