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.

list.tmpl 3.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <div class="page-content repository projects">
  2. <div class="ui container">
  3. {{if .CanWriteProjects}}
  4. <div class="navbar">
  5. <div class="ui right">
  6. <a class="ui green button" href="{{$.Link}}/new">{{.locale.Tr "repo.projects.new"}}</a>
  7. </div>
  8. </div>
  9. <div class="ui divider"></div>
  10. {{end}}
  11. {{template "base/alert" .}}
  12. <div class="ui compact tiny menu">
  13. <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=open">
  14. {{svg "octicon-project" 16 "mr-3"}}
  15. {{JsPrettyNumber .OpenCount}}&nbsp;{{.locale.Tr "repo.issues.open_title"}}
  16. </a>
  17. <a class="item{{if .IsShowClosed}} active{{end}}" href="{{$.Link}}?state=closed">
  18. {{svg "octicon-check" 16 "mr-3"}}
  19. {{JsPrettyNumber .ClosedCount}}&nbsp;{{.locale.Tr "repo.issues.closed_title"}}
  20. </a>
  21. </div>
  22. <div class="ui right floated secondary filter menu">
  23. <!-- Sort -->
  24. <div class="ui dropdown type jump item">
  25. <span class="text">
  26. {{.locale.Tr "repo.issues.filter_sort"}}
  27. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  28. </span>
  29. <div class="menu">
  30. <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=oldest&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
  31. <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=recentupdate&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  32. <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&sort=leastupdate&state={{$.State}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="milestone list">
  37. {{range .Projects}}
  38. <li class="item">
  39. {{svg "octicon-project"}} <a href="{{$.Link}}/{{.ID}}">{{.Title}}</a>
  40. <div class="meta">
  41. {{$closedDate:= TimeSinceUnix .ClosedDateUnix $.locale}}
  42. {{if .IsClosed}}
  43. {{svg "octicon-clock"}} {{$.locale.Tr "repo.milestones.closed" $closedDate|Str2html}}
  44. {{end}}
  45. <span class="issue-stats">
  46. {{svg "octicon-issue-opened" 16 "mr-3"}}
  47. {{JsPrettyNumber .NumOpenIssues}}&nbsp;{{$.locale.Tr "repo.issues.open_title"}}
  48. {{svg "octicon-check" 16 "mr-3"}}
  49. {{JsPrettyNumber .NumClosedIssues}}&nbsp;{{$.locale.Tr "repo.issues.closed_title"}}
  50. </span>
  51. </div>
  52. {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
  53. <div class="ui right operate">
  54. <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
  55. {{if .IsClosed}}
  56. <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
  57. {{else}}
  58. <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
  59. {{end}}
  60. <a class="delete-button" href="#" data-url="{{$.RepoLink}}/projects/{{.ID}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
  61. </div>
  62. {{end}}
  63. {{if .Description}}
  64. <div class="content">
  65. {{.RenderedContent|Str2html}}
  66. </div>
  67. {{end}}
  68. </li>
  69. {{end}}
  70. {{template "base/paginate" .}}
  71. </div>
  72. </div>
  73. </div>
  74. {{if or .CanWriteIssues .CanWritePulls}}
  75. <div class="ui small basic delete modal">
  76. <div class="ui icon header">
  77. {{svg "octicon-trash"}}
  78. {{.locale.Tr "repo.projects.deletion"}}
  79. </div>
  80. <div class="content">
  81. <p>{{.locale.Tr "repo.projects.deletion_desc"}}</p>
  82. </div>
  83. <div class="actions">
  84. <div class="ui red basic inverted cancel button">
  85. <i class="remove icon"></i>
  86. {{.locale.Tr "modal.no"}}
  87. </div>
  88. <div class="ui green basic inverted ok button">
  89. <i class="checkmark icon"></i>
  90. {{.locale.Tr "modal.yes"}}
  91. </div>
  92. </div>
  93. </div>
  94. {{end}}