Skip to content

Commit dc8774e

Browse files
Explore page: Add topic param to pagination (go-gitea#9077)
1 parent af7f08b commit dc8774e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

routers/home.go

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
132132

133133
keyword := strings.Trim(ctx.Query("q"), " ")
134134
topicOnly := ctx.QueryBool("topic")
135+
ctx.Data["TopicOnly"] = topicOnly
135136

136137
repos, count, err = models.SearchRepository(&models.SearchRepoOptions{
137138
Page: page,
@@ -155,6 +156,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
155156

156157
pager := context.NewPagination(int(count), opts.PageSize, page, 5)
157158
pager.SetDefaultParams(ctx)
159+
pager.AddParam(ctx, "topic", "TopicOnly")
158160
ctx.Data["Page"] = pager
159161

160162
ctx.HTML(200, opts.TplName)

0 commit comments

Comments
 (0)