labels.tmpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. {{range .Labels}}
  40. <li class="item">
  41. <div class="ui label" style="color: {{.ForegroundColor}}; background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
  42. {{if $.IsRepositoryWriter}}
  43. <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>
  44. <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>
  45. {{end}}
  46. <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>
  47. </li>
  48. {{end}}
  49. </div>
  50. </div>
  51. </div>
  52. {{if .IsRepositoryWriter}}
  53. <div class="ui small basic delete modal">
  54. <div class="ui icon header">
  55. <i class="trash icon"></i>
  56. {{.i18n.Tr "repo.issues.label_deletion"}}
  57. </div>
  58. <div class="content">
  59. <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p>
  60. </div>
  61. <div class="actions">
  62. <div class="ui red basic inverted cancel button">
  63. <i class="remove icon"></i>
  64. {{.i18n.Tr "modal.no"}}
  65. </div>
  66. <div class="ui green basic inverted ok button">
  67. <i class="checkmark icon"></i>
  68. {{.i18n.Tr "modal.yes"}}
  69. </div>
  70. </div>
  71. </div>
  72. <div class="ui small edit-label modal">
  73. <div class="header">
  74. {{.i18n.Tr "repo.issues.label_modify"}}
  75. </div>
  76. <div class="content">
  77. <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
  78. {{.CsrfTokenHtml}}
  79. <input id="label-modal-id" name="id" type="hidden">
  80. <div class="ui grid">
  81. <div class="five wide column">
  82. <div class="ui small input">
  83. <input class="new-label-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
  84. </div>
  85. </div>
  86. <div class="color picker column">
  87. <input class="color-picker" name="color" value="#70c24a" required>
  88. </div>
  89. <div class="column precolors">
  90. {{template "repo/issue/label_precolors"}}
  91. </div>
  92. </div>
  93. </form>
  94. </div>
  95. <div class="actions">
  96. <div class="ui negative button">
  97. {{.i18n.Tr "modal.no"}}
  98. </div>
  99. <div class="ui positive right labeled icon button">
  100. {{.i18n.Tr "modal.modify"}}
  101. <i class="checkmark icon"></i>
  102. </div>
  103. </div>
  104. </div>
  105. {{end}}
  106. {{template "base/footer" .}}