]> source.dussan.org Git - gitea.git/commitdiff
#1459 Dashboard issues lacks sorting
authorUnknwon <u@gogs.io>
Wed, 4 Nov 2015 17:50:02 +0000 (12:50 -0500)
committerUnknwon <u@gogs.io>
Wed, 4 Nov 2015 17:50:02 +0000 (12:50 -0500)
README.md
gogs.go
public/css/gogs.css
public/less/_dashboard.less
routers/user/home.go
templates/.VERSION
templates/user/dashboard/issues.tmpl

index 59ba8e21a2f758d237de6145e5c4e1cf51e08250..9b7d71c4113f974cec9a9cbc193de2723dec8c79 100644 (file)
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
 
 ![](public/img/gogs-large-resize.png)
 
-##### Current version: 0.6.24 Beta
+##### Current version: 0.6.25 Beta
 
 <table>
     <tr>
diff --git a/gogs.go b/gogs.go
index c903192b84f13722ac5caecbe156eb19f1aa6ddb..8fe723fbda6b852465322545e55fdeb533fe1bfc 100644 (file)
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
        "github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.6.24.1104 Beta"
+const APP_VER = "0.6.25.1104 Beta"
 
 func init() {
        runtime.GOMAXPROCS(runtime.NumCPU())
index 8448d618fe2cdfe888bdb5d4d2239c3595e818ad..8c66cdb3f364a90c1fb73044e6129da2e8959a3d 100755 (executable)
@@ -2554,17 +2554,23 @@ ol.linenums {
   height: 16px;
   vertical-align: middle;
 }
+.dashboard.issues .filter.menu .item .text.truncate {
+  width: 85%;
+}
 .dashboard.issues .filter.menu .item .floating.label {
   top: 7px;
   left: 90%;
   width: 15%;
 }
-.dashboard.issues .filter.menu .item.active {
-  background-color: #4183c4;
-  color: #FFF;
+.dashboard.issues .filter.menu .jump.item {
+  margin: 1px;
+  padding-right: 0;
 }
-.dashboard.issues .filter.menu .item .text {
-  width: 85%;
+.dashboard.issues .filter.menu .menu {
+  max-height: 300px;
+  overflow-x: auto;
+  right: 0!important;
+  left: auto!important;
 }
 .dashboard.issues .ui.right .head.menu {
   margin-top: -5px;
index d1b194bdcb095faa2910ba87e318a6a2c4a9d6e4..19264b0953872ca258eaf0a66cc93649cf29942a 100644 (file)
@@ -17,6 +17,9 @@
                                .text {
                                        height: 16px;
                            vertical-align: middle;
+                           &.truncate {
+                                               width: 85%;
+                                       }
                                }
                                .floating.label {
                                        top: 7px;
                                        width: 15%;
                                }
                        }
-                       .item.active {
-                   background-color: #4183c4;
-                   color: #FFF;
+
+                       // Sort
+                       .jump.item {
+                               margin: 1px;
+                   padding-right: 0;
                        }
-                       .item .text {
-                               width: 85%;
+                       .menu {
+                               max-height: 300px;
+                               overflow-x: auto;
+                               right: 0!important;
+                               left: auto!important;
                        }
                }
                .ui.right .head.menu {
index 581bb0633c1db7e8f77603acded8086cdd319b3e..c5c42694faba20d3085a96b0db0a7d397ec4c4f7 100644 (file)
@@ -156,6 +156,7 @@ func Issues(ctx *middleware.Context) {
        // Organization does not have view type and filter mode.
        var (
                viewType   string
+               sortType   = ctx.Query("sort")
                filterMode = models.FM_ALL
                assigneeID int64
                posterID   int64
@@ -248,6 +249,7 @@ func Issues(ctx *middleware.Context) {
                Page:       page,
                IsClosed:   isShowClosed,
                IsPull:     isPullList,
+               SortType:   sortType,
        })
        if err != nil {
                ctx.Handle(500, "Issues: %v", err)
@@ -276,6 +278,7 @@ func Issues(ctx *middleware.Context) {
 
        ctx.Data["IssueStats"] = issueStats
        ctx.Data["ViewType"] = viewType
+       ctx.Data["SortType"] = sortType
        ctx.Data["RepoID"] = repoID
        ctx.Data["IsShowClosed"] = isShowClosed
        if isShowClosed {
index fee1aa357c0fd4725ff54eee6da43ae65e56becc..f116ce5caac1d9b91e5b57bb1206bdb9928512d6 100644 (file)
@@ -1 +1 @@
-0.6.24.1104 Beta
\ No newline at end of file
+0.6.25.1104 Beta
\ No newline at end of file
index 092c2523c65e63d9390d9d0e7ea68c9a2f7915c5..678dfecfc6c46af6c3ba64e25de24255f95618be 100644 (file)
@@ -5,23 +5,23 @@
        <div class="ui grid">
                <div class="four wide column">
                        <div class="ui secondary vertical filter menu">
-                               <a class="{{if eq .ViewType "all"}}ui basic blue button{{end}} item" href="{{.Link}}?repo={{.RepoID}}&state={{.State}}">
+                               <a class="{{if eq .ViewType "all"}}ui basic blue button{{end}} item" href="{{.Link}}?repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
                                        {{.i18n.Tr "home.issues.in_your_repos"}}
                                        <strong class="ui right">{{.IssueStats.AllCount}}</strong>
                                </a>
                                {{if not .ContextUser.IsOrganization}}
-                               <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repo={{.RepoID}}&state={{.State}}">
+                               <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
                                        {{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}
                                        <strong class="ui right">{{.IssueStats.AssignCount}}</strong>
                                </a>
-                               <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repo={{.RepoID}}&state={{.State}}">
+                               <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repo={{.RepoID}}&sort={{$.SortType}}&state={{.State}}">
                                        {{.i18n.Tr "repo.issues.filter_type.created_by_you"}}
                                        <strong class="ui right">{{.IssueStats.CreateCount}}</strong>
                                </a>
                                {{end}}
                                <div class="ui divider"></div>
           {{range .Repos}}
-          <a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&state={{$.State}}">
+          <a class="{{if eq $.RepoID .ID}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}{{if not (eq $.RepoID .ID)}}&repo={{.ID}}{{end}}&sort={{$.SortType}}&state={{$.State}}">
                <span class="text truncate">{{$.ContextUser.Name}}/{{.Name}}</span>
                <div class="floating ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{if $.IsShowClosed}}{{.NumClosedIssues}}{{else}}{{.NumOpenIssues}}{{end}}</div>
           </a>
                </div>
                        <div class="twelve wide column content">
                                <div class="ui tiny basic status buttons">
-                                 <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&state=open">
+                                 <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=open">
                                        <i class="octicon octicon-issue-opened"></i>
                                        {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
                                  </a>
-                                 <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&state=closed">
+                                 <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort={{$.SortType}}&state=closed">
                                        <i class="octicon octicon-issue-closed"></i>
                                        {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
                                  </a>
                                </div>
+                               <div class="ui right floated secondary filter menu">
+                                       <!-- Sort -->
+                                       <div class="ui dropdown type jump item">
+                                               <span class="text">
+                                                       {{.i18n.Tr "repo.issues.filter_sort"}}
+                                                       <i class="dropdown icon"></i>
+                                               </span>
+                       <div class="menu">
+                               <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=latest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
+                               <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=oldest&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
+                               <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=recentupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
+                               <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastupdate&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
+                               <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=mostcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
+                               <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repo={{.RepoID}}&sort=leastcomment&state={{$.State}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
+                                               </div>
+                                       </div>
+                               </div>
 
                                <div class="issue list">
                                        {{range .Issues}}