diff options
author | Bo-Yi Wu <appleboy.tw@gmail.com> | 2018-09-13 10:33:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 10:33:48 +0800 |
commit | ea20adaa84cbff762fcaa7f2d5fa6b7bf56706ec (patch) | |
tree | c2d09da1dcb0a00654963b30dbf5eeb152c83857 /routers/home.go | |
parent | 7dd93b2441fc4eac89ccf6b919bf46823334c8bf (diff) | |
download | gitea-ea20adaa84cbff762fcaa7f2d5fa6b7bf56706ec.tar.gz gitea-ea20adaa84cbff762fcaa7f2d5fa6b7bf56706ec.zip |
feat(repo): support search repository by topic name (#4505)
* feat(repo): support search repository by topic name
Diffstat (limited to 'routers/home.go')
-rw-r--r-- | routers/home.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/home.go b/routers/home.go index 0aa907658c..7a23e8765e 100644 --- a/routers/home.go +++ b/routers/home.go @@ -122,6 +122,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { } keyword := strings.Trim(ctx.Query("q"), " ") + topicOnly := ctx.QueryBool("topic") repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{ Page: page, @@ -131,6 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { Keyword: keyword, OwnerID: opts.OwnerID, AllPublic: true, + TopicOnly: topicOnly, }) if err != nil { ctx.ServerError("SearchRepositoryByName", err) |