issues.tmpl 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 "all"}}ui basic blue button{{end}} item" href="{{.Link}}?repo={{.RepoID}}&state={{.State}}">
  9. {{.i18n.Tr "home.issues.in_your_repos"}}
  10. <strong class="ui right">{{.IssueStats.AllCount}}</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}}&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}}&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}}&state={{$.State}}">
  25. <span class="text truncate">{{$.ContextUser.Name}}/{{.Name}}</span>
  26. <div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</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}}&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}}&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="issue list">
  43. {{range .Issues}}
  44. {{ $timeStr:= TimeSince .Created $.Lang }}
  45. <li class="item">
  46. <div class="ui label">{{if not $.RepoID}}{{.Repo.Name}}{{end}}#{{.Index}}</div>
  47. <a class="title" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/issues/{{.Index}}">{{.Name}}</a>
  48. {{if .NumComments}}
  49. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  50. {{end}}
  51. <p class="desc">
  52. {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  53. {{if .Assignee}}
  54. <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  55. <img class="ui avatar image" src="{{.Assignee.AvatarLink}}">
  56. </a>
  57. {{end}}
  58. </p>
  59. </li>
  60. {{end}}
  61. {{with .Page}}
  62. {{if gt .TotalPages 1}}
  63. <div class="center page buttons">
  64. <div class="ui borderless pagination menu">
  65. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
  66. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  67. </a>
  68. {{range .Pages}}
  69. {{if eq .Num -1}}
  70. <a class="disabled item">...</a>
  71. {{else}}
  72. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  73. {{end}}
  74. {{end}}
  75. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
  76. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  77. </a>
  78. </div>
  79. </div>
  80. {{end}}
  81. {{end}}
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. {{template "base/footer" .}}