diff options
author | yp05327 <576951401@qq.com> | 2024-08-16 01:34:24 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-15 16:34:24 +0000 |
commit | 7092402a2db255ecde2c20574b973fb632c16d2e (patch) | |
tree | b5913f2498c57b5161e34c4b2b382d428b12847d /routers/web/user | |
parent | b491b2104f83ee8fc4956c099c427b339291b3be (diff) | |
download | gitea-7092402a2db255ecde2c20574b973fb632c16d2e.tar.gz gitea-7092402a2db255ecde2c20574b973fb632c16d2e.zip |
Add missing repository type filter parameters to pager (#31832)
Fix #31807
ps: the newly added params's value will be changed.
When the first time you selected the filter, the values of params will
be `0` or `1`
But in pager it will be `true` or `false`.
So do we have `boolToInt` function?
Diffstat (limited to 'routers/web/user')
-rw-r--r-- | routers/web/user/notification.go | 15 | ||||
-rw-r--r-- | routers/web/user/profile.go | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index 833a9c049c..414cb0be49 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -446,6 +446,21 @@ func NotificationWatching(ctx *context.Context) { // redirect to last page if request page is more than total pages pager := context.NewPagination(total, setting.UI.User.RepoPagingNum, page, 5) pager.SetDefaultParams(ctx) + if archived.Has() { + pager.AddParamString("archived", fmt.Sprint(archived.Value())) + } + if fork.Has() { + pager.AddParamString("fork", fmt.Sprint(fork.Value())) + } + if mirror.Has() { + pager.AddParamString("mirror", fmt.Sprint(mirror.Value())) + } + if template.Has() { + pager.AddParamString("template", fmt.Sprint(template.Value())) + } + if private.Has() { + pager.AddParamString("private", fmt.Sprint(private.Value())) + } ctx.Data["Page"] = pager ctx.Data["Status"] = 2 diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index f0749e1021..3f91233ee6 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -333,6 +333,21 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb pager.AddParamString("date", fmt.Sprint(ctx.Data["Date"])) } } + if archived.Has() { + pager.AddParamString("archived", fmt.Sprint(archived.Value())) + } + if fork.Has() { + pager.AddParamString("fork", fmt.Sprint(fork.Value())) + } + if mirror.Has() { + pager.AddParamString("mirror", fmt.Sprint(mirror.Value())) + } + if template.Has() { + pager.AddParamString("template", fmt.Sprint(template.Value())) + } + if private.Has() { + pager.AddParamString("private", fmt.Sprint(private.Value())) + } ctx.Data["Page"] = pager } |