issues.tmpl 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. {{template "base/head" .}}
  2. <div class="dashboard issues">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. <div class="ui grid">
  6. <div class="four wide column">
  7. <div class="ui secondary vertical filter menu">
  8. <a class="{{if eq .ViewType "your_repositories"}}ui basic blue button{{end}} item" href="{{.Link}}?type=your_repositories&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
  9. {{.i18n.Tr "home.issues.in_your_repos"}}
  10. <strong class="ui right">{{.IssueStats.YourReposCount}}</strong>
  11. </a>
  12. {{if not .ContextUser.IsOrganization}}
  13. <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
  14. {{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}
  15. <strong class="ui right">{{.IssueStats.AssignCount}}</strong>
  16. </a>
  17. <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
  18. {{.i18n.Tr "repo.issues.filter_type.created_by_you"}}
  19. <strong class="ui right">{{.IssueStats.CreateCount}}</strong>
  20. </a>
  21. {{end}}
  22. <div class="ui divider"></div>
  23. {{range .Repos}}
  24. <a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&sort={{$.SortType}}&state={{$.State}}">
  25. <span class="text truncate">{{.FullName}}</span>
  26. <div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">
  27. {{if $.PageIsIssues}}
  28. {{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}
  29. {{else}}
  30. {{if $.IsShowClosed}}{{.NumClosedPulls}}{{else}}{{.NumOpenPulls}}{{end}}
  31. {{end}}
  32. </div>
  33. </a>
  34. {{end}}
  35. </div>
  36. </div>
  37. <div class="twelve wide column content">
  38. <div class="ui buttons tiny">
  39. <a class="ui {{if not .IsShowClosed}}green{{else}}grey{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open">
  40. <i class="octicon octicon-issue-opened"></i>
  41. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  42. </a>
  43. <a class="ui {{if .IsShowClosed}}red{{else}}grey{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed">
  44. <i class="octicon octicon-issue-closed"></i>
  45. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  46. </a>
  47. </div>
  48. <div class="ui right floated secondary filter menu">
  49. <!-- Sort -->
  50. <div class="ui dropdown type jump item">
  51. <span class="text">
  52. {{.i18n.Tr "repo.issues.filter_sort"}}
  53. <i class="dropdown icon"></i>
  54. </span>
  55. <div class="menu">
  56. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=latest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  57. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=oldest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  58. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=recentupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  59. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  60. <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  61. <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  62. </div>
  63. </div>
  64. </div>
  65. <div class="issue list">
  66. {{if not .Issues}}
  67. {{if .PageIsIssues}}
  68. <div class="ui center dashboard no-activity">
  69. <img class="ui avatar small image" src="https://gitote-cdn.netlify.com/img/svg/no_data.svg">
  70. <br/>
  71. <h2>No Issues</h2>
  72. </div>
  73. {{else if .PageIsPulls}}
  74. <div class="ui center dashboard no-activity">
  75. <img class="ui avatar small image" src="https://gitote-cdn.netlify.com/img/svg/no_data.svg">
  76. <br/>
  77. <h2>No Pull Requests</h2>
  78. </div>
  79. {{end}}
  80. {{end}}
  81. {{range .Issues}}
  82. {{ $timeStr:= TimeSince .Created $.Lang }}
  83. <li class="item">
  84. <div class="ui label">{{if not $.RepoID}}{{.Repo.FullName}}{{end}}#{{.Index}}</div>
  85. <a class="title has-emoji" href="{{AppSubURL}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Title}}</a>
  86. {{if .NumComments}}
  87. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  88. {{end}}
  89. <div>
  90. <span class="ui right">
  91. {{range .Labels}}
  92. <a class="ui label" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name | Sanitize}}</a>
  93. {{end}}
  94. </span>
  95. </div>
  96. <p class="desc">
  97. {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  98. {{if .Assignee}}
  99. <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  100. <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}">
  101. </a>
  102. {{end}}
  103. </p>
  104. </li>
  105. {{end}}
  106. {{with .Page}}
  107. {{if gt .TotalPages 1}}
  108. <div class="center page buttons">
  109. <div class="ui borderless pagination menu">
  110. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
  111. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  112. </a>
  113. {{range .Pages}}
  114. {{if eq .Num -1}}
  115. <a class="disabled item">...</a>
  116. {{else}}
  117. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  118. {{end}}
  119. {{end}}
  120. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
  121. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  122. </a>
  123. </div>
  124. </div>
  125. {{end}}
  126. {{end}}
  127. </div>
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. {{template "base/footer" .}}