summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorThibault Meyer <0xbaadf00d@users.noreply.github.com>2016-08-30 04:02:49 +0200
committer无闻 <u@gogs.io>2016-08-29 19:02:49 -0700
commit92fb30c5260cc067da28ae3cd031b76f7b7976db (patch)
tree50855703a1044069861620ca32f98e812627ea59 /templates
parent9f44c267899fabd0b180cdf6cd41e6d77b2fb423 (diff)
downloadgitea-92fb30c5260cc067da28ae3cd031b76f7b7976db.tar.gz
gitea-92fb30c5260cc067da28ae3cd031b76f7b7976db.zip
Load a set of predefined labels (#3459)
* Can use a predefined set of labels * Change UI * Fix HTML file indentation * Avoid reading file from other directory (security issue) * Apply a better fix * Remove not used variable * Merge upstream/develop * Do modifications * Raname * remove binding + rename variable
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/issue/labels.tmpl35
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index 1edb15bccf..85c18570a2 100644
--- a/templates/repo/issue/labels.tmpl
+++ b/templates/repo/issue/labels.tmpl
@@ -33,8 +33,43 @@
</form>
</div>
<div class="ui divider"></div>
+
{{template "base/alert" .}}
<div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div>
+ {{if $.IsRepositoryWriter}}
+ {{if eq .NumLabels 0}}
+ <div class="ui centered grid">
+ <div class="twelve wide column eight wide computer column">
+ <div class="ui attached left aligned segment" style="margin-top:30px">
+ <h4 class="ui header">
+ {{.i18n.Tr "repo.issues.label_templates.title"}}
+ <a target="_blank"
+ href="https://github.com/gogits/go-gogs-client/wiki/Repositories#litte-notes-on-label-template">
+ <span class="octicon octicon-question"></span>
+ </a>
+ </h4>
+ <p>{{.i18n.Tr "repo.issues.label_templates.info"}}</p>
+ <br/>
+ <form class="ui form center" action="{{.Link}}/initialize" method="post">
+ {{.CsrfTokenHtml}}
+ <div class="field">
+ <div class="ui selection dropdown">
+ <input type="hidden" name="template_name" id="templatename" value="Default">
+ <div class="default text">{{.i18n.Tr "repo.issues.label_templates.helper"}}</div>
+ <div class="menu">
+ {{range .LabelTemplates}}
+ <div class="item" data-value="{{.}}">{{.}}</div>
+ {{end}}
+ </div>
+ </div>
+ </div>
+ <button type="submit" class="ui blue button">{{.i18n.Tr "repo.issues.label_templates.use"}}</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ {{end}}
+ {{end}}
<div class="label list">
{{range .Labels}}