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.

157 lines
6.1 KiB

  1. {{template "base/head" .}}
  2. <div class="repository labels">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="navbar">
  6. {{template "repo/issue/navbar" .}}
  7. {{if .IsRepositoryWriter}}
  8. <div class="ui right">
  9. <div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div>
  10. </div>
  11. {{end}}
  12. </div>
  13. <div class="ui new-label segment hide">
  14. <form class="ui form" action="{{$.RepoLink}}/labels/new" method="post">
  15. {{.CsrfTokenHtml}}
  16. <div class="ui grid">
  17. <div class="five wide column">
  18. <div class="ui small input">
  19. <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
  20. </div>
  21. </div>
  22. <div class="color picker column">
  23. <input class="color-picker" name="color" value="#70c24a" required>
  24. </div>
  25. <div class="column precolors">
  26. {{template "repo/issue/label_precolors"}}
  27. </div>
  28. <div class="buttons">
  29. <div class="ui blue small basic cancel button">{{.i18n.Tr "repo.milestones.cancel"}}</div>
  30. <button class="ui green small button">{{.i18n.Tr "repo.issues.create_label"}}</button>
  31. </div>
  32. </div>
  33. </form>
  34. </div>
  35. <div class="ui divider"></div>
  36. <div class="ui right floated secondary filter menu">
  37. <!-- Sort -->
  38. <div class="ui dropdown type jump item">
  39. <span class="text">
  40. {{.i18n.Tr "repo.issues.filter_sort"}}
  41. <i class="dropdown icon"></i>
  42. </span>
  43. <div class="menu">
  44. <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=alphabetically&state={{$.State}}">{{.i18n.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
  45. <a class="{{if eq .SortType "reversealphabetically"}}active{{end}} item" href="{{$.Link}}?sort=reversealphabetically&state={{$.State}}">{{.i18n.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
  46. <a class="{{if eq .SortType "leastissues"}}active{{end}} item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_issues"}}</a>
  47. <a class="{{if eq .SortType "mostissues"}}active{{end}} item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_issues"}}</a>
  48. </div>
  49. </div>
  50. </div>
  51. {{template "base/alert" .}}
  52. <div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
  53. <div class="label list">
  54. {{if and $.IsRepositoryWriter (eq .NumLabels 0)}}
  55. <div class="ui centered grid">
  56. <div class="twelve wide column eight wide computer column">
  57. <div class="ui attached left aligned segment">
  58. <!-- <h4 class="ui header">
  59. {{.i18n.Tr "repo.issues.label_templates.title"}}
  60. <a target="_blank" rel="noopener"
  61. href="https://discuss.gogs.io/t/how-to-use-predefined-label-templates/599">
  62. <span class="octicon octicon-question"></span>
  63. </a>
  64. </h4> -->
  65. <p>{{.i18n.Tr "repo.issues.label_templates.info"}}</p>
  66. <br/>
  67. <form class="ui form center" action="{{.Link}}/initialize" method="post">
  68. {{.CsrfTokenHtml}}
  69. <div class="field">
  70. <div class="ui selection dropdown">
  71. <input type="hidden" name="template_name" value="Default">
  72. <div class="default text">{{.i18n.Tr "repo.issues.label_templates.helper"}}</div>
  73. <div class="menu">
  74. {{range .LabelTemplates}}
  75. <div class="item" data-value="{{.}}">{{.}}</div>
  76. {{end}}
  77. </div>
  78. </div>
  79. </div>
  80. <button type="submit" class="ui blue button">{{.i18n.Tr "repo.issues.label_templates.use"}}</button>
  81. </form>
  82. </div>
  83. </div>
  84. </div>
  85. {{end}}
  86. {{range .Labels}}
  87. <li class="item">
  88. <div class="ui label" style="color: {{.ForegroundColor}}; background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
  89. {{if $.IsRepositoryWriter}}
  90. <a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
  91. <a class="ui right edit-label-button" href="#" data-id={{.ID}} data-title={{.Name}} data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
  92. {{end}}
  93. <a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a>
  94. </li>
  95. {{end}}
  96. </div>
  97. </div>
  98. </div>
  99. {{if .IsRepositoryWriter}}
  100. <div class="ui small basic delete modal">
  101. <div class="ui icon header">
  102. <i class="trash icon"></i>
  103. {{.i18n.Tr "repo.issues.label_deletion"}}
  104. </div>
  105. <div class="content">
  106. <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p>
  107. </div>
  108. <div class="actions">
  109. <div class="ui red basic inverted cancel button">
  110. <i class="remove icon"></i>
  111. {{.i18n.Tr "modal.no"}}
  112. </div>
  113. <div class="ui green basic inverted ok button">
  114. <i class="checkmark icon"></i>
  115. {{.i18n.Tr "modal.yes"}}
  116. </div>
  117. </div>
  118. </div>
  119. <div class="ui small edit-label modal">
  120. <div class="header">
  121. {{.i18n.Tr "repo.issues.label_modify"}}
  122. </div>
  123. <div class="content">
  124. <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
  125. {{.CsrfTokenHtml}}
  126. <input id="label-modal-id" name="id" type="hidden">
  127. <div class="ui grid">
  128. <div class="five wide column">
  129. <div class="ui small input">
  130. <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
  131. </div>
  132. </div>
  133. <div class="color picker column">
  134. <input class="color-picker" name="color" value="#70c24a" required>
  135. </div>
  136. <div class="column precolors">
  137. {{template "repo/issue/label_precolors"}}
  138. </div>
  139. </div>
  140. </form>
  141. </div>
  142. <div class="actions">
  143. <div class="ui negative button">
  144. {{.i18n.Tr "modal.no"}}
  145. </div>
  146. <div class="ui positive right labeled icon button">
  147. {{.i18n.Tr "modal.modify"}}
  148. <i class="checkmark icon"></i>
  149. </div>
  150. </div>
  151. </div>
  152. {{end}}
  153. {{template "base/footer" .}}