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.

issues.tmpl 7.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. {{template "base/head" .}}
  2. <div class="dashboard issues">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. <div class="ui stackable 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.YourRepositoriesCount}}</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">{{index $.Counts .ID}}</div>
  27. </a>
  28. {{end}}
  29. </div>
  30. </div>
  31. <div class="twelve wide column content">
  32. <div class="ui tiny basic status buttons">
  33. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open">
  34. <i class="octicon octicon-issue-opened"></i>
  35. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  36. </a>
  37. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed">
  38. <i class="octicon octicon-issue-closed"></i>
  39. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  40. </a>
  41. </div>
  42. <div class="ui right floated secondary filter menu">
  43. <!-- Sort -->
  44. <div class="ui dropdown type jump item">
  45. <span class="text">
  46. {{.i18n.Tr "repo.issues.filter_sort"}}
  47. <i class="dropdown icon"></i>
  48. </span>
  49. <div class="menu">
  50. <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>
  51. <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>
  52. <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>
  53. <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>
  54. <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>
  55. <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>
  56. <a class="{{if eq .SortType "nearduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=nearduedate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.nearduedate"}}</a>
  57. <a class="{{if eq .SortType "farduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=farduedate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.farduedate"}}</a>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="issue list">
  62. {{range .Issues}}
  63. {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
  64. <li class="item">
  65. <div class="ui label">{{if not $.RepoID}}{{.Repo.FullName}}{{end}}#{{.Index}}</div>
  66. <a class="title has-emoji" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Title}}</a>
  67. {{if .IsPull }}
  68. {{if (index $.CommitStatus .ID)}}
  69. {{template "repo/commit_status" (index $.CommitStatus .ID)}}
  70. {{end}}
  71. {{end}}
  72. {{with .Labels}}
  73. {{/* If we have any labels, we should show them
  74. with a 2.5 line height, this way they don't look
  75. awful and they don't stack on top of each other,
  76. especially on mobile views. */}}
  77. <span style="line-height: 2.5">
  78. {{range .}}
  79. <a class="ui label has-emoji" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&repo={{$.RepoID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
  80. {{end}}
  81. </span>
  82. {{end}}
  83. {{if .NumComments}}
  84. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  85. {{end}}
  86. {{if .TotalTrackedTime}}
  87. <span class="comment ui right"><i class="octicon octicon-clock"></i> {{.TotalTrackedTime | Sec2Time}}</span>
  88. {{end}}
  89. <p class="desc">
  90. {{if .OriginalAuthor}}
  91. {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}}
  92. {{else if gt .Poster.ID 0}}
  93. {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
  94. {{else}}
  95. {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
  96. {{end}}
  97. {{if .Milestone}}
  98. <a class="milestone" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  99. <span class="octicon octicon-milestone"></span> {{.Milestone.Name}}
  100. </a>
  101. {{end}}
  102. {{if .Ref}}
  103. <a class="ref" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/src/branch/{{.Ref}}">
  104. <span class="octicon octicon-git-branch"></span> {{.Ref}}
  105. </a>
  106. {{end}}
  107. {{range .Assignees}}
  108. <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-variation="inverted" data-position="left center">
  109. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  110. </a>
  111. {{end}}
  112. {{$tasks := .GetTasks}}
  113. {{if gt $tasks 0}}
  114. {{$tasksDone := .GetTasksDone}}
  115. <span class="checklist">
  116. <span class="octicon octicon-checklist"></span> {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  117. </span>
  118. {{end}}
  119. </p>
  120. </li>
  121. {{end}}
  122. {{template "base/paginate" .}}
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. {{template "base/footer" .}}