|
|
@ -5,12 +5,12 @@ |
|
|
|
package routers |
|
|
|
package routers |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"bytes" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"strings" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/Unknwon/paginater" |
|
|
|
"github.com/Unknwon/paginater" |
|
|
|
|
|
|
|
|
|
|
|
"bytes" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
@ -100,7 +100,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { |
|
|
|
orderBy = "created_unix DESC" |
|
|
|
orderBy = "created_unix DESC" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
keyword := ctx.Query("q") |
|
|
|
keyword := strings.Trim(ctx.Query("q"), " ") |
|
|
|
if len(keyword) == 0 { |
|
|
|
if len(keyword) == 0 { |
|
|
|
repos, err = opts.Ranger(&models.SearchRepoOptions{ |
|
|
|
repos, err = opts.Ranger(&models.SearchRepoOptions{ |
|
|
|
Page: page, |
|
|
|
Page: page, |
|
|
@ -199,7 +199,7 @@ func RenderUserSearch(ctx *context.Context, opts *UserSearchOptions) { |
|
|
|
orderBy = "id DESC" |
|
|
|
orderBy = "id DESC" |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
keyword := ctx.Query("q") |
|
|
|
keyword := strings.Trim(ctx.Query("q"), " ") |
|
|
|
if len(keyword) == 0 { |
|
|
|
if len(keyword) == 0 { |
|
|
|
users, err = opts.Ranger(&models.SearchUserOptions{OrderBy: orderBy, |
|
|
|
users, err = opts.Ranger(&models.SearchUserOptions{OrderBy: orderBy, |
|
|
|
Page: page, |
|
|
|
Page: page, |
|
|
|