diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-25 23:46:45 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-25 23:46:45 -0400 |
commit | bf5fcfb49c777b649ccbb4c9e385cd247e194552 (patch) | |
tree | 93d6ced5488ec328bad1584eb0e57bb97ef69f13 | |
parent | ff48aeddeff2e16f45fe4bae1220f3ed47b786a4 (diff) | |
download | gitea-bf5fcfb49c777b649ccbb4c9e385cd247e194552.tar.gz gitea-bf5fcfb49c777b649ccbb4c9e385cd247e194552.zip |
Add * to selected label
-rw-r--r-- | routers/repo/issue.go | 4 | ||||
-rw-r--r-- | templates/issue/list.tmpl | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 006b467a86..d09a239638 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -65,6 +65,7 @@ func Issues(ctx *middleware.Context) { mid = mile.Id } + selectLabels := ctx.Query("labels") labels, err := models.GetLabels(ctx.Repo.Repository.Id) if err != nil { ctx.Handle(500, "issue.Issues(GetLabels): %v", err) @@ -79,7 +80,7 @@ func Issues(ctx *middleware.Context) { // Get issues. issues, err := models.GetIssues(assigneeId, ctx.Repo.Repository.Id, posterId, mid, page, - isShowClosed, ctx.Query("labels"), ctx.Query("sortType")) + isShowClosed, selectLabels, ctx.Query("sortType")) if err != nil { ctx.Handle(500, "issue.Issues(GetIssues): %v", err) return @@ -118,6 +119,7 @@ func Issues(ctx *middleware.Context) { } issueStats := models.GetIssueStats(ctx.Repo.Repository.Id, uid, isShowClosed, filterMode) ctx.Data["IssueStats"] = issueStats + ctx.Data["SelectLabels"], _ = base.StrTo(selectLabels).Int64() ctx.Data["ViewType"] = viewType ctx.Data["Issues"] = issues ctx.Data["IsShowClosed"] = isShowClosed diff --git a/templates/issue/list.tmpl b/templates/issue/list.tmpl index 6862aadcd2..ba8055309d 100644 --- a/templates/issue/list.tmpl +++ b/templates/issue/list.tmpl @@ -18,10 +18,10 @@ <ul class="list-unstyled" id="label-list" data-ajax="{{$.RepoLink}}/issues/labels/delete"> {{range .Labels}} <li class="label-item" id="label-{{.Id}}" data-id="{{.Id}}"> - <a href="?type={{$.ViewType}}&state={{$.State}}&labels={{.Id}}"> + <a href="?type={{$.ViewType}}&state={{$.State}}{{if not (eq $.SelectLabels .Id)}}&labels={{.Id}}{{end}}"> <span class="pull-right count">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</span> <span class="color" style="background-color: {{.Color}}" data-color="{{.Color}}"></span> - <span class="name">{{.Name}}</span> + <span class="name">{{.Name}}{{if eq $.SelectLabels .Id}}*{{end}}</span> </a> <a class="del pull-right" href="#" data-id="{{.Id}}"><i class="fa fa-times-circle-o"></i></a> </li> |