aboutsummaryrefslogtreecommitdiff
path: root/templates/repo/issue/labels.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/repo/issue/labels.tmpl')
-rw-r--r--templates/repo/issue/labels.tmpl81
1 files changed, 63 insertions, 18 deletions
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index 47b8614c..b69988cd 100644
--- a/templates/repo/issue/labels.tmpl
+++ b/templates/repo/issue/labels.tmpl
@@ -19,22 +19,7 @@
</div>
</div>
<div class="item precolors">
- <a class="color" style="background-color:#e11d21" data-color-hex="#e11d21"></a>
- <a class="color" style="background-color:#eb6420" data-color-hex="#eb6420"></a>
- <a class="color" style="background-color:#fbca04" data-color-hex="#fbca04"></a>
- <a class="color" style="background-color:#009800" data-color-hex="#009800"></a>
- <a class="color" style="background-color:#006b75" data-color-hex="#006b75"></a>
- <a class="color" style="background-color:#207de5" data-color-hex="#207de5"></a>
- <a class="color" style="background-color:#0052cc" data-color-hex="#0052cc"></a>
- <a class="color" style="background-color:#53e917" data-color-hex="#53e917"></a>
- <a class="color" style="background-color:#f6c6c7" data-color-hex="#f6c6c7"></a>
- <a class="color" style="background-color:#fad8c7" data-color-hex="#fad8c7"></a>
- <a class="color" style="background-color:#fef2c0" data-color-hex="#fef2c0"></a>
- <a class="color" style="background-color:#bfe5bf" data-color-hex="#bfe5bf"></a>
- <a class="color" style="background-color:#bfdadc" data-color-hex="#bfdadc"></a>
- <a class="color" style="background-color:#c7def8" data-color-hex="#c7def8"></a>
- <a class="color" style="background-color:#bfd4f2" data-color-hex="#bfd4f2"></a>
- <a class="color" style="background-color:#d4c5f9" data-color-hex="#d4c5f9"></a>
+ {{template "repo/issue/label_precolors"}}
</div>
<button class="ui green button">{{.i18n.Tr "repo.issues.new_label"}}</button>
</div>
@@ -52,8 +37,8 @@
<li class="item">
<div class="ui label" style="background-color: {{.Color}}"><i class="octicon octicon-tag"></i> {{.Name}}</div>
{{if $.IsRepositoryAdmin}}
- <a class="ui right" href="#"><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
- <a class="ui right" href="#"><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
+ <a class="ui right delete-label-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
+ <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>
{{end}}
<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>
</li>
@@ -61,4 +46,64 @@
</div>
</div>
</div>
+
+{{if .IsRepositoryAdmin}}
+<div class="ui basic delete-label modal">
+ <div class="header">
+ {{.i18n.Tr "repo.issues.label_deletion"}}
+ </div>
+ <div class="content">
+ <div class="image">
+ <i class="trash icon"></i>
+ </div>
+ <div class="description">
+ <p>{{.i18n.Tr "repo.issues.label_deletion_desc"}}</p>
+ </div>
+ </div>
+ <div class="actions">
+ <div class="two fluid ui inverted buttons">
+ <div class="ui red basic inverted button">
+ <i class="remove icon"></i>
+ {{.i18n.Tr "modal.no"}}
+ </div>
+ <div class="ui green basic inverted positive button">
+ <i class="checkmark icon"></i>
+ {{.i18n.Tr "modal.yes"}}
+ </div>
+ </div>
+ </div>
+</div>
+
+<div class="ui small edit-label modal">
+ <div class="header">
+ {{.i18n.Tr "repo.issues.label_modify"}}
+ </div>
+ <div class="content">
+ <form class="ui edit-label form" action="{{$.RepoLink}}/labels/edit" method="post">
+ {{.CsrfTokenHtml}}
+ <input id="label-modal-id" name="id" type="hidden">
+ <div class="inline fields">
+ <div class="field">
+ <input id="label-modal-title" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" required>
+ </div>
+ <div class="field">
+ <input id="label-modal-color" class="color-picker" name="color" value="#70c24a" required>
+ </div>
+ <div class="field precolors">
+ {{template "repo/issue/label_precolors"}}
+ </div>
+ </div>
+ </form>
+ </div>
+ <div class="actions">
+ <div class="ui negative button">
+ {{.i18n.Tr "modal.no"}}
+ </div>
+ <div class="ui positive right labeled icon button">
+ {{.i18n.Tr "modal.modify"}}
+ <i class="checkmark icon"></i>
+ </div>
+ </div>
+</div>
+{{end}}
{{template "base/footer" .}} \ No newline at end of file