5
5
package admin
6
6
7
7
import (
8
+ "net/url"
9
+ "strconv"
8
10
"strings"
9
11
10
12
"code.gitea.io/gitea/models"
@@ -71,6 +73,8 @@ func UnadoptedRepos(ctx *context.Context) {
71
73
opts .Page = 1
72
74
}
73
75
76
+ ctx .Data ["CurrentPage" ] = opts .Page
77
+
74
78
doSearch := ctx .QueryBool ("search" )
75
79
76
80
ctx .Data ["search" ] = doSearch
@@ -79,6 +83,7 @@ func UnadoptedRepos(ctx *context.Context) {
79
83
if ! doSearch {
80
84
pager := context .NewPagination (0 , opts .PageSize , opts .Page , 5 )
81
85
pager .SetDefaultParams (ctx )
86
+ pager .AddParam (ctx , "search" , "search" )
82
87
ctx .Data ["Page" ] = pager
83
88
ctx .HTML (200 , tplUnadoptedRepos )
84
89
return
@@ -92,6 +97,7 @@ func UnadoptedRepos(ctx *context.Context) {
92
97
ctx .Data ["Dirs" ] = repoNames
93
98
pager := context .NewPagination (int (count ), opts .PageSize , opts .Page , 5 )
94
99
pager .SetDefaultParams (ctx )
100
+ pager .AddParam (ctx , "search" , "search" )
95
101
ctx .Data ["Page" ] = pager
96
102
ctx .HTML (200 , tplUnadoptedRepos )
97
103
}
@@ -100,6 +106,9 @@ func UnadoptedRepos(ctx *context.Context) {
100
106
func AdoptOrDeleteRepository (ctx * context.Context ) {
101
107
dir := ctx .Query ("id" )
102
108
action := ctx .Query ("action" )
109
+ page := ctx .QueryInt ("page" )
110
+ q := ctx .Query ("q" )
111
+
103
112
dirSplit := strings .SplitN (dir , "/" , 2 )
104
113
if len (dirSplit ) != 2 {
105
114
ctx .Redirect (setting .AppSubURL + "/admin/repos" )
@@ -148,5 +157,5 @@ func AdoptOrDeleteRepository(ctx *context.Context) {
148
157
}
149
158
ctx .Flash .Success (ctx .Tr ("repo.delete_preexisting_success" , dir ))
150
159
}
151
- ctx .Redirect (setting .AppSubURL + "/admin/repos/unadopted" )
160
+ ctx .Redirect (setting .AppSubURL + "/admin/repos/unadopted?search=true&q=" + url . QueryEscape ( q ) + "&page=" + strconv . Itoa ( page ) )
152
161
}
0 commit comments