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.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. </div>
  57. </div>
  58. </div>
  59. <div class="issue list">
  60. {{range .Issues}}
  61. {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
  62. <li class="item">
  63. <div class="ui label">{{if not $.RepoID}}{{.Repo.FullName}}{{end}}#{{.Index}}</div>
  64. <a class="title has-emoji" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Title}}</a>
  65. {{with .Labels}}
  66. {{/* If we have any labels, we should show them
  67. with a 2.5 line height, this way they don't look
  68. awful and they don't stack on top of each other,
  69. especially on mobile views. */}}
  70. <span style="line-height: 2.5">
  71. {{range .}}
  72. <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
  73. {{end}}
  74. </span>
  75. {{end}}
  76. {{if .NumComments}}
  77. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  78. {{end}}
  79. <p class="desc">
  80. {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  81. {{if .Assignee}}
  82. <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  83. <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}">
  84. </a>
  85. {{end}}
  86. {{$tasks := .GetTasks}}
  87. {{if gt $tasks 0}}
  88. {{$tasksDone := .GetTasksDone}}
  89. <span class="checklist">
  90. <span class="octicon octicon-checklist"></span> {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  91. </span>
  92. {{end}}
  93. </p>
  94. </li>
  95. {{end}}
  96. {{with .Page}}
  97. {{if gt .TotalPages 1}}
  98. <div class="center page buttons">
  99. <div class="ui borderless pagination menu">
  100. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&repo={{$.RepoID}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
  101. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  102. </a>
  103. {{range .Pages}}
  104. {{if eq .Num -1}}
  105. <a class="disabled item">...</a>
  106. {{else}}
  107. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&repo={{$.RepoID}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  108. {{end}}
  109. {{end}}
  110. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&repo={{$.RepoID}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
  111. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  112. </a>
  113. </div>
  114. </div>
  115. {{end}}
  116. {{end}}
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. {{template "base/footer" .}}