1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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
This commit is contained in:
Thibault Meyer
2016-08-30 04:02:49 +02:00
committed by 无闻
parent 9f44c26789
commit 92fb30c526
8 changed files with 841 additions and 925 deletions

View File

@@ -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}}