diff options
Diffstat (limited to 'routers/web/user')
-rw-r--r-- | routers/web/user/code.go | 2 | ||||
-rw-r--r-- | routers/web/user/home.go | 22 | ||||
-rw-r--r-- | routers/web/user/notification.go | 4 | ||||
-rw-r--r-- | routers/web/user/package.go | 4 | ||||
-rw-r--r-- | routers/web/user/profile.go | 8 |
5 files changed, 20 insertions, 20 deletions
diff --git a/routers/web/user/code.go b/routers/web/user/code.go index 7ce3e12192..785c37b124 100644 --- a/routers/web/user/code.go +++ b/routers/web/user/code.go @@ -122,7 +122,7 @@ func CodeSearch(ctx *context.Context) { pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5) pager.SetDefaultParams(ctx) - pager.AddParamIfExist("l", ctx.Data["Language"]) + pager.AddParamString("l", language) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplUserCode) diff --git a/routers/web/user/home.go b/routers/web/user/home.go index dddd03e21f..465de500a0 100644 --- a/routers/web/user/home.go +++ b/routers/web/user/home.go @@ -133,7 +133,7 @@ func Dashboard(ctx *context.Context) { ctx.Data["Feeds"] = feeds pager := context.NewPagination(int(count), setting.UI.FeedPagingNum, page, 5) - pager.AddParamIfExist("date", ctx.Data["Date"]) + pager.AddParamString("date", date) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplDashboard) @@ -329,10 +329,10 @@ func Milestones(ctx *context.Context) { ctx.Data["IsShowClosed"] = isShowClosed pager := context.NewPagination(pagerCount, setting.UI.IssuePagingNum, page, 5) - pager.AddParamIfExist("q", ctx.Data["Keyword"]) - pager.AddParamIfExist("repos", ctx.Data["RepoIDs"]) - pager.AddParamIfExist("sort", ctx.Data["SortType"]) - pager.AddParamIfExist("state", ctx.Data["State"]) + pager.AddParamString("q", keyword) + pager.AddParamString("repos", reposQuery) + pager.AddParamString("sort", sortType) + pager.AddParamString("state", fmt.Sprint(ctx.Data["State"])) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplMilestones) @@ -632,13 +632,11 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { } pager := context.NewPagination(shownIssues, setting.UI.IssuePagingNum, page, 5) - pager.AddParamIfExist("q", ctx.Data["Keyword"]) - pager.AddParamIfExist("type", ctx.Data["ViewType"]) - pager.AddParamIfExist("sort", ctx.Data["SortType"]) - pager.AddParamIfExist("state", ctx.Data["State"]) - pager.AddParamIfExist("labels", ctx.Data["SelectLabels"]) - pager.AddParamIfExist("milestone", ctx.Data["MilestoneID"]) - pager.AddParamIfExist("assignee", ctx.Data["AssigneeID"]) + pager.AddParamString("q", keyword) + pager.AddParamString("type", viewType) + pager.AddParamString("sort", sortType) + pager.AddParamString("state", fmt.Sprint(ctx.Data["State"])) + pager.AddParamString("labels", selectedLabels) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplIssues) diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index 81afeae043..438462371b 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -344,8 +344,8 @@ func NotificationSubscriptions(ctx *context.Context) { ctx.Redirect(fmt.Sprintf("/notifications/subscriptions?page=%d", pager.Paginater.Current())) return } - pager.AddParamIfExist("sort", ctx.Data["SortType"]) - pager.AddParamIfExist("state", ctx.Data["State"]) + pager.AddParamString("sort", sortType) + pager.AddParamString("state", state) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplNotificationSubscriptions) diff --git a/routers/web/user/package.go b/routers/web/user/package.go index 911ca12bf0..9af49406c4 100644 --- a/routers/web/user/package.go +++ b/routers/web/user/package.go @@ -125,8 +125,8 @@ func ListPackages(ctx *context.Context) { } pager := context.NewPagination(int(total), setting.UI.PackagesPagingNum, page, 5) - pager.AddParamIfExist("q", ctx.Data["Query"]) - pager.AddParamIfExist("type", ctx.Data["PackageType"]) + pager.AddParamString("q", query) + pager.AddParamString("type", packageType) ctx.Data["Page"] = pager ctx.HTML(http.StatusOK, tplPackagesList) diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go index f9df511f60..f0749e1021 100644 --- a/routers/web/user/profile.go +++ b/routers/web/user/profile.go @@ -324,12 +324,14 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileDb pager := context.NewPagination(total, pagingNum, page, 5) pager.SetDefaultParams(ctx) - pager.AddParamIfExist("tab", ctx.Data["TabName"]) + pager.AddParamString("tab", tab) if tab != "followers" && tab != "following" && tab != "activity" && tab != "projects" { - pager.AddParamIfExist("language", ctx.Data["Language"]) + pager.AddParamString("language", language) } if tab == "activity" { - pager.AddParamIfExist("date", ctx.Data["Date"]) + if ctx.Data["Date"] != nil { + pager.AddParamString("date", fmt.Sprint(ctx.Data["Date"])) + } } ctx.Data["Page"] = pager } |