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.

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