]> source.dussan.org Git - gitea.git/commitdiff
Add * to selected label
authorUnknown <joe2010xtmf@163.com>
Mon, 26 May 2014 03:46:45 +0000 (23:46 -0400)
committerUnknown <joe2010xtmf@163.com>
Mon, 26 May 2014 03:46:45 +0000 (23:46 -0400)
routers/repo/issue.go
templates/issue/list.tmpl

index 006b467a86a8fb2ce9ff264fb392baedd77a5651..d09a23963877caa51308d1bc0e28378e33606bbd 100644 (file)
@@ -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
index 6862aadcd271518e504a9fdba7cc76aa50371e05..ba8055309d0853e42713eddc0824f2c46af79158 100644 (file)
                 <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>