mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-14 01:35:55 +09:00
finish create issue with labels
This commit is contained in:
1 parent
17de3ab0a3
commit
922f3f3062
9 files changed
+160
-41
No files matched your search
+12
-2
@@ -144,8 +144,8 @@ func (i *Issue) AfterDelete() {
|
||||
}
|
||||
}
|
||||
|
||||
// CreateIssue creates new issue for repository.
|
||||
func NewIssue(issue *Issue) (err error) {
|
||||
// CreateIssue creates new issue with labels for repository.
|
||||
func NewIssue(issue *Issue, labelIDs []int64) (err error) {
|
||||
sess := x.NewSession()
|
||||
defer sessionRelease(sess)
|
||||
if err = sess.Begin(); err != nil {
|
||||
@@ -158,6 +158,12 @@ func NewIssue(issue *Issue) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, id := range labelIDs {
|
||||
if err = issue.addLabel(sess, id); err != nil {
|
||||
return fmt.Errorf("addLabel: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err = sess.Commit(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -688,6 +694,10 @@ func HasIssueLabel(issueID, labelID int64) bool {
|
||||
}
|
||||
|
||||
func newIssueLabel(e Engine, issueID, labelID int64) error {
|
||||
if issueID == 0 || labelID == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := e.Insert(&IssueLabel{
|
||||
IssueID: issueID,
|
||||
LabelID: labelID,
|
||||
|
||||
@@ -98,8 +98,8 @@ func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) b
|
||||
// \/ \/ \/
|
||||
|
||||
type CreateIssueForm struct {
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
LabelIDs []int64 `form:"label_id"`
|
||||
Title string `binding:"Required;MaxSize(255)"`
|
||||
LabelIDs string `form:"label_ids"`
|
||||
MilestoneID int64
|
||||
AssigneeID int64
|
||||
Content string
|
||||
|
||||
@@ -420,3 +420,21 @@ func Subtract(left interface{}, right interface{}) interface{} {
|
||||
return fleft + float64(rleft) - (fright + float64(rright))
|
||||
}
|
||||
}
|
||||
|
||||
// StringsToInt64s converts a slice of string to a slice of int64.
|
||||
func StringsToInt64s(strs []string) []int64 {
|
||||
ints := make([]int64, len(strs))
|
||||
for i := range strs {
|
||||
ints[i] = com.StrTo(strs[i]).MustInt64()
|
||||
}
|
||||
return ints
|
||||
}
|
||||
|
||||
// Int64sToMap converts a slice of int64 to a int64 map.
|
||||
func Int64sToMap(ints []int64) map[int64]bool {
|
||||
m := make(map[int64]bool)
|
||||
for _, i := range ints {
|
||||
m[i] = true
|
||||
}
|
||||
return m
|
||||
}
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('embedded-opentype'),url(../fonts/octicons.woff?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('woff'),url(../fonts/octicons.ttf?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('truetype'),url(../fonts/octicons.svg?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6#octicons)format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-alignment-align:before{content:'\f08a'}.octicon-alignment-aligned-to:before{content:'\f08e'}.octicon-alignment-unalign:before{content:'\f08b'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beer:before{content:'\f069'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hourglass:before{content:'\f09e'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-jump-down:before{content:'\f072'}.octicon-jump-left:before{content:'\f0a5'}.octicon-jump-right:before{content:'\f0a6'}.octicon-jump-up:before{content:'\f073'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicoLine truncated
|
||||
@font-face{font-family:octicons;src:url(../fonts/octicons.eot?#iefix&v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('embedded-opentype'),url(../fonts/octicons.woff?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('woff'),url(../fonts/octicons.ttf?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6)format('truetype'),url(../fonts/octicons.svg?v=345f8bad9c5003db196d08f05e7f030fd2a32ff6#octicons)format('svg');font-weight:400;font-style:normal}.mega-octicon,.octicon{font:normal normal normal 16px/1 octicons;display:inline-block;text-decoration:none;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mega-octicon{font-size:32px}.octicon-alert:before{content:'\f02d'}.octicon-alignment-align:before{content:'\f08a'}.octicon-alignment-aligned-to:before{content:'\f08e'}.octicon-alignment-unalign:before{content:'\f08b'}.octicon-arrow-down:before{content:'\f03f'}.octicon-arrow-left:before{content:'\f040'}.octicon-arrow-right:before{content:'\f03e'}.octicon-arrow-small-down:before{content:'\f0a0'}.octicon-arrow-small-left:before{content:'\f0a1'}.octicon-arrow-small-right:before{content:'\f071'}.octicon-arrow-small-up:before{content:'\f09f'}.octicon-arrow-up:before{content:'\f03d'}.octicon-beer:before{content:'\f069'}.octicon-book:before{content:'\f007'}.octicon-bookmark:before{content:'\f07b'}.octicon-briefcase:before{content:'\f0d3'}.octicon-broadcast:before{content:'\f048'}.octicon-browser:before{content:'\f0c5'}.octicon-bug:before{content:'\f091'}.octicon-calendar:before{content:'\f068'}.octicon-check:before{content:'\f03a'}.octicon-checklist:before{content:'\f076'}.octicon-chevron-down:before{content:'\f0a3'}.octicon-chevron-left:before{content:'\f0a4'}.octicon-chevron-right:before{content:'\f078'}.octicon-chevron-up:before{content:'\f0a2'}.octicon-circle-slash:before{content:'\f084'}.octicon-circuit-board:before{content:'\f0d6'}.octicon-clippy:before{content:'\f035'}.octicon-clock:before{content:'\f046'}.octicon-cloud-download:before{content:'\f00b'}.octicon-cloud-upload:before{content:'\f00c'}.octicon-code:before{content:'\f05f'}.octicon-color-mode:before{content:'\f065'}.octicon-comment-add:before,.octicon-comment:before{content:'\f02b'}.octicon-comment-discussion:before{content:'\f04f'}.octicon-credit-card:before{content:'\f045'}.octicon-dash:before{content:'\f0ca'}.octicon-dashboard:before{content:'\f07d'}.octicon-database:before{content:'\f096'}.octicon-device-camera:before{content:'\f056'}.octicon-device-camera-video:before{content:'\f057'}.octicon-device-desktop:before{content:'\f27c'}.octicon-device-mobile:before{content:'\f038'}.octicon-diff:before{content:'\f04d'}.octicon-diff-added:before{content:'\f06b'}.octicon-diff-ignored:before{content:'\f099'}.octicon-diff-modified:before{content:'\f06d'}.octicon-diff-removed:before{content:'\f06c'}.octicon-diff-renamed:before{content:'\f06e'}.octicon-ellipsis:before{content:'\f09a'}.octicon-eye-unwatch:before,.octicon-eye-watch:before,.octicon-eye:before{content:'\f04e'}.octicon-file-binary:before{content:'\f094'}.octicon-file-code:before{content:'\f010'}.octicon-file-directory:before{content:'\f016'}.octicon-file-media:before{content:'\f012'}.octicon-file-pdf:before{content:'\f014'}.octicon-file-submodule:before{content:'\f017'}.octicon-file-symlink-directory:before{content:'\f0b1'}.octicon-file-symlink-file:before{content:'\f0b0'}.octicon-file-text:before{content:'\f011'}.octicon-file-zip:before{content:'\f013'}.octicon-flame:before{content:'\f0d2'}.octicon-fold:before{content:'\f0cc'}.octicon-gear:before{content:'\f02f'}.octicon-gift:before{content:'\f042'}.octicon-gist:before{content:'\f00e'}.octicon-gist-secret:before{content:'\f08c'}.octicon-git-branch-create:before,.octicon-git-branch-delete:before,.octicon-git-branch:before{content:'\f020'}.octicon-git-commit:before{content:'\f01f'}.octicon-git-compare:before{content:'\f0ac'}.octicon-git-merge:before{content:'\f023'}.octicon-git-pull-request-abandoned:before,.octicon-git-pull-request:before{content:'\f009'}.octicon-globe:before{content:'\f0b6'}.octicon-graph:before{content:'\f043'}.octicon-heart:before{content:'\2665'}.octicon-history:before{content:'\f07e'}.octicon-home:before{content:'\f08d'}.octicon-horizontal-rule:before{content:'\f070'}.octicon-hourglass:before{content:'\f09e'}.octicon-hubot:before{content:'\f09d'}.octicon-inbox:before{content:'\f0cf'}.octicon-info:before{content:'\f059'}.octicon-issue-closed:before{content:'\f028'}.octicon-issue-opened:before{content:'\f026'}.octicon-issue-reopened:before{content:'\f027'}.octicon-jersey:before{content:'\f019'}.octicon-jump-down:before{content:'\f072'}.octicon-jump-left:before{content:'\f0a5'}.octicon-jump-right:before{content:'\f0a6'}.octicon-jump-up:before{content:'\f073'}.octicon-key:before{content:'\f049'}.octicon-keyboard:before{content:'\f00d'}.octicon-law:before{content:'\f0d8'}.octicon-light-bulb:before{content:'\f000'}.octicoLine truncated
|
||||
+58
-17
@@ -134,24 +134,65 @@ $(document).ready(function () {
|
||||
$('.poping.up').popup();
|
||||
|
||||
// Comment form
|
||||
$('.comment.form .tabular.menu .item').tab();
|
||||
$('.comment.form .tabular.menu .item[data-tab="preview"]').click(function () {
|
||||
var $this = $(this);
|
||||
console.log($('.comment.form .tab.segment[data-tab="write"] textarea').val())
|
||||
console.log($('.comment.form .tab.segment[data-tab="preview"]').html())
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"mode": "gfm",
|
||||
"context": $this.data('context'),
|
||||
"text": $('.comment.form .tab.segment[data-tab="write"] textarea').val()
|
||||
},
|
||||
function (data) {
|
||||
console.log(data)
|
||||
$('.comment.form .tab.segment[data-tab="preview"]').html(data);
|
||||
if ($('.comment.form').length > 0) {
|
||||
var $form = $(this);
|
||||
$form.find('.tabular.menu .item').tab();
|
||||
$form.find('.tabular.menu .item[data-tab="preview"]').click(function () {
|
||||
var $this = $(this);
|
||||
$.post($this.data('url'), {
|
||||
"_csrf": csrf,
|
||||
"mode": "gfm",
|
||||
"context": $this.data('context'),
|
||||
"text": $form.find('.tab.segment[data-tab="write"] textarea').val()
|
||||
},
|
||||
function (data) {
|
||||
$form.find('.tab.segment[data-tab="preview"]').html(data);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
// Labels
|
||||
var $list = $('.ui.labels.list');
|
||||
var $no_select = $list.find('.no-select');
|
||||
$('.select-label .item:not(.no-select)').click(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
$(this).removeClass('checked')
|
||||
$(this).find('.octicon').removeClass('octicon-check')
|
||||
} else {
|
||||
$(this).addClass('checked')
|
||||
$(this).find('.octicon').addClass('octicon-check')
|
||||
}
|
||||
)
|
||||
;
|
||||
})
|
||||
|
||||
var label_ids = "";
|
||||
$(this).parent().find('.item').each(function () {
|
||||
if ($(this).hasClass('checked')) {
|
||||
label_ids += $(this).data('id') + ",";
|
||||
$($(this).data('id-selector')).removeClass('hide');
|
||||
} else {
|
||||
$($(this).data('id-selector')).addClass('hide');
|
||||
}
|
||||
});
|
||||
if (label_ids.length == 0) {
|
||||
$no_select.removeClass('hide');
|
||||
} else {
|
||||
$no_select.addClass('hide');
|
||||
}
|
||||
$($(this).parent().data('id')).val(label_ids);
|
||||
return false;
|
||||
});
|
||||
$('.select-label .no-select.item').click(function () {
|
||||
$(this).parent().find('.item').each(function () {
|
||||
$(this).removeClass('checked');
|
||||
$(this).find('.octicon').removeClass('octicon-check');
|
||||
});
|
||||
|
||||
$list.find('.item').each(function () {
|
||||
$(this).addClass('hide');
|
||||
});
|
||||
$no_select.removeClass('hide');
|
||||
$($(this).parent().data('id')).val('');
|
||||
});
|
||||
}
|
||||
|
||||
// Helpers.
|
||||
$('.delete-button').click(function () {
|
||||
|
||||
@@ -102,7 +102,7 @@ footer {
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
display: none!important;
|
||||
}
|
||||
.center {
|
||||
text-align: center;
|
||||
|
||||
@@ -29,6 +29,22 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.metas .ui.list {
|
||||
.label.color {
|
||||
padding: 0 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
a {
|
||||
padding-top: 5px;
|
||||
padding-right: 10px;
|
||||
.text {
|
||||
color: #444;
|
||||
&:hover {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.filter.menu {
|
||||
.label.color {
|
||||
margin-left: 15px;
|
||||
@@ -91,6 +107,10 @@
|
||||
.comment.form {
|
||||
.metas {
|
||||
min-width: 220px;
|
||||
.filter.menu {
|
||||
max-height: 300px;
|
||||
overflow-x: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+38
-12
@@ -180,14 +180,16 @@ func NewIssue(ctx *middleware.Context) {
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.AttachmentEnabled
|
||||
ctx.Data["AttachmentAllowedTypes"] = setting.AttachmentAllowedTypes
|
||||
|
||||
var (
|
||||
repo = ctx.Repo.Repository
|
||||
err error
|
||||
)
|
||||
ctx.Data["Labels"], err = models.GetLabelsByRepoID(repo.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetLabelsByRepoID: %v", err)
|
||||
return
|
||||
if ctx.User.IsAdmin {
|
||||
var (
|
||||
repo = ctx.Repo.Repository
|
||||
err error
|
||||
)
|
||||
ctx.Data["Labels"], err = models.GetLabelsByRepoID(repo.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetLabelsByRepoID: %v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// // Get all milestones.
|
||||
@@ -219,6 +221,31 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
|
||||
ctx.Data["IsAttachmentEnabled"] = setting.AttachmentEnabled
|
||||
ctx.Data["AttachmentAllowedTypes"] = setting.AttachmentAllowedTypes
|
||||
|
||||
var (
|
||||
repo = ctx.Repo.Repository
|
||||
labelIDs []int64
|
||||
)
|
||||
if ctx.User.IsAdmin {
|
||||
// Check labels.
|
||||
labelIDs = base.StringsToInt64s(strings.Split(form.LabelIDs, ","))
|
||||
labelIDMark := base.Int64sToMap(labelIDs)
|
||||
labels, err := models.GetLabelsByRepoID(repo.ID)
|
||||
if err != nil {
|
||||
ctx.Handle(500, "GetLabelsByRepoID: %v", err)
|
||||
return
|
||||
}
|
||||
hasSelected := false
|
||||
for i := range labels {
|
||||
if labelIDMark[labels[i].ID] {
|
||||
labels[i].IsChecked = true
|
||||
hasSelected = true
|
||||
}
|
||||
}
|
||||
ctx.Data["HasSelectedLabel"] = hasSelected
|
||||
ctx.Data["label_ids"] = form.LabelIDs
|
||||
ctx.Data["Labels"] = labels
|
||||
}
|
||||
|
||||
if ctx.HasError() {
|
||||
ctx.HTML(200, ISSUE_NEW)
|
||||
return
|
||||
@@ -226,18 +253,17 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
|
||||
|
||||
issue := &models.Issue{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
Index: int64(ctx.Repo.Repository.NumIssues) + 1,
|
||||
Index: int64(repo.NumIssues) + 1,
|
||||
Name: form.Title,
|
||||
PosterID: ctx.User.Id,
|
||||
// MilestoneID: form.MilestoneID,
|
||||
// AssigneeID: form.AssigneeID,
|
||||
// LabelIDs: "$" + strings.Join(form.LabelIDs, "|$") + "|",
|
||||
Content: form.Content,
|
||||
}
|
||||
if err := models.NewIssue(issue); err != nil {
|
||||
if err := models.NewIssue(issue, labelIDs); err != nil {
|
||||
ctx.Handle(500, "NewIssue", err)
|
||||
return
|
||||
} else if err := models.NewIssueUserPairs(ctx.Repo.Repository, issue); err != nil {
|
||||
} else if err := models.NewIssueUserPairs(repo, issue); err != nil {
|
||||
ctx.Handle(500, "NewIssue", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -38,22 +38,26 @@
|
||||
</div>
|
||||
|
||||
{{if .IsRepositoryAdmin}}
|
||||
<input id="label_ids" name="label_ids" type="hidden" value="{{.label_ids}}">
|
||||
<div class="four wide column">
|
||||
<div class="ui segment metas">
|
||||
<div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
|
||||
<div class="ui {{if not .Labels}}disabled{{end}} jump select-label dropdown">
|
||||
<span class="text">
|
||||
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
|
||||
<span class="octicon octicon-gear"></span>
|
||||
</span>
|
||||
<div class="filter menu">
|
||||
<a class="item" href="#">{{.i18n.Tr "repo.issues.new.clear_labels"}}</a>
|
||||
<div class="filter menu" data-id="#label_ids">
|
||||
<a class="no-select item" href="#">{{.i18n.Tr "repo.issues.new.clear_labels"}}</a>
|
||||
{{range .Labels}}
|
||||
<a class="item" href="#"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
|
||||
<a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" data-id-selector="#label_{{.ID}}"><span class="octicon {{if .IsChecked}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui list">
|
||||
<span class="item {{if .SelectedLabels}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span>
|
||||
<div class="ui labels list">
|
||||
<span class="no-select item {{if .HasSelectedLabel}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_label"}}</span>
|
||||
{{range .Labels}}
|
||||
<a class="{{if not .IsChecked}}hide{{end}} item" id="label_{{.ID}}" href="{{$.RepoLink}}/issues?labels={{.ID}}"><span class="label color" style="background-color: {{.Color}}"></span> <span class="text">{{.Name}}</span></a>
|
||||
{{end}}
|
||||
</div>
|
||||
<!-- <div class="ui divider"></div>
|
||||
<div class="ui {{if .Labels}}disabled{{end}} dropdown jump item">
|
||||
|
||||
Reference in new issue
Block a user