summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-07-24 23:13:42 +0800
committerUnknwon <u@gogs.io>2015-07-24 23:13:42 +0800
commitdc4aab9925b46f8ad4b18f7926e2904163c1c5b5 (patch)
tree77bb65a5407f7daddf2166054d0abf757dc32715 /templates
parent3426ae42b3eadd5acd43e20470a8f1dd45bb55b0 (diff)
downloadgitea-dc4aab9925b46f8ad4b18f7926e2904163c1c5b5.tar.gz
gitea-dc4aab9925b46f8ad4b18f7926e2904163c1c5b5.zip
UI: CURD labels
- fix update lable break connection with repository
Diffstat (limited to 'templates')
-rw-r--r--templates/base/alert.tmpl5
-rw-r--r--templates/repo/issue/label_precolors.tmpl16
-rw-r--r--templates/repo/issue/labels.tmpl81
3 files changed, 84 insertions, 18 deletions
diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl
index 15eeb566bd..c845e36dc5 100644
--- a/templates/base/alert.tmpl
+++ b/templates/base/alert.tmpl
@@ -2,4 +2,9 @@
<div class="ui negative message">
<p>{{.Flash.ErrorMsg}}</p>
</div>
+{{end}}
+{{if .Flash.SuccessMsg}}
+<div class="ui positive message">
+ <p>{{.Flash.SuccessMsg}}</p>
+</div>
{{end}} \ No newline at end of file
diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl
new file mode 100644
index 0000000000..378281b303
--- /dev/null
+++ b/templates/repo/issue/label_precolors.tmpl
@@ -0,0 +1,16 @@
+<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> \ No newline at end of file
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index 47b8614cb8..b69988cdb9 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