labels.tmpl 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. {{template "base/alert" .}}
  37. <div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
  38. <div class="label list">
  39. {{if and $.IsRepositoryWriter (eq .NumLabels 0)}}
  40. <div class="ui centered grid">
  41. <div class="twelve wide column eight wide computer column">
  42. <div class="ui attached left aligned segment">
  43. <h4 class="ui header">
  44. {{.i18n.Tr "repo.issues.label_templates.title"}}
  45. <a target="_blank"
  46. href="https://discuss.gogs.io/t/how-to-use-predefined-label-templates/599">
  47. <span class="octicon octicon-question"></span>
  48. </a>
  49. </h4>
  50. <p>{{.i18n.Tr "repo.issues.label_templates.info"}}</p>
  51. <br/>
  52. <form class="ui form center" action="{{.Link}}/initialize" method="post">
  53. {{.CSRFTokenHTML}}
  54. <div class="field">
  55. <div class="ui selection dropdown">
  56. <input type="hidden" name="template_name" value="Default">
  57. <div class="default text">{{.i18n.Tr "repo.issues.label_templates.helper"}}</div>
  58. <div class="menu">
  59. {{range .LabelTemplates}}
  60. <div class="item" data-value="{{.}}">{{.}}</div>
  61. {{end}}
  62. </div>
  63. </div>
  64. </div>
  65. <button type="submit" class="ui blue button">{{.i18n.Tr "repo.issues.label_templates.use"}}</button>
  66. </form>
  67. </div>
  68. </div>
  69. </div>
  70. {{end}}
  71. {{range .Labels}}
  72. <li class="item">
  73. <div class="ui label" style="color: {{.ForegroundColor}}; background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
  74. {{if $.IsRepositoryWriter}}
  75. <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>
  76. <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>
  77. {{end}}
  78. <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>
  79. </li>
  80. {{end}}
  81. </div>
  82. </div>
  83. </div>
  84. {{if .IsRepositoryWriter}}
  85. <div class="ui small basic delete modal">
  86. <div class="ui icon header">
  87. <i class="trash icon"></i>
  88. {{.i18n.Tr "repo.issues.label_deletion"}}
  89. </div>
  90. <div class="content">
  91. <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p>
  92. </div>
  93. <div class="actions">
  94. <div class="ui red basic inverted cancel button">
  95. <i class="remove icon"></i>
  96. {{.i18n.Tr "modal.no"}}
  97. </div>
  98. <div class="ui green basic inverted ok button">
  99. <i class="checkmark icon"></i>
  100. {{.i18n.Tr "modal.yes"}}
  101. </div>
  102. </div>
  103. </div>
  104. <div class="ui small edit-label modal">
  105. <div class="header">
  106. {{.i18n.Tr "repo.issues.label_modify"}}
  107. </div>
  108. <div class="content">
  109. <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
  110. {{.CSRFTokenHTML}}
  111. <input id="label-modal-id" name="id" type="hidden">
  112. <div class="ui grid">
  113. <div class="five wide column">
  114. <div class="ui small input">
  115. <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
  116. </div>
  117. </div>
  118. <div class="color picker column">
  119. <input class="color-picker" name="color" value="#70c24a" required>
  120. </div>
  121. <div class="column precolors">
  122. {{template "repo/issue/label_precolors"}}
  123. </div>
  124. </div>
  125. </form>
  126. </div>
  127. <div class="actions">
  128. <div class="ui negative button">
  129. {{.i18n.Tr "modal.no"}}
  130. </div>
  131. <div class="ui positive right labeled icon button">
  132. {{.i18n.Tr "modal.modify"}}
  133. <i class="checkmark icon"></i>
  134. </div>
  135. </div>
  136. </div>
  137. {{end}}
  138. {{template "base/footer" .}}