@@ -119,6 +119,11 @@ func Profile(ctx *context.Context) {
119
119
page = 1
120
120
}
121
121
122
+ pagingNum := setting .UI .User .RepoPagingNum
123
+ if tab == "activity" {
124
+ pagingNum = setting .UI .FeedPagingNum
125
+ }
126
+
122
127
topicOnly := ctx .FormBool ("topic" )
123
128
124
129
var (
@@ -164,7 +169,7 @@ func Profile(ctx *context.Context) {
164
169
switch tab {
165
170
case "followers" :
166
171
items , count , err := user_model .GetUserFollowers (ctx , ctx .ContextUser , ctx .Doer , db.ListOptions {
167
- PageSize : setting . UI . User . RepoPagingNum ,
172
+ PageSize : pagingNum ,
168
173
Page : page ,
169
174
})
170
175
if err != nil {
@@ -176,7 +181,7 @@ func Profile(ctx *context.Context) {
176
181
total = int (count )
177
182
case "following" :
178
183
items , count , err := user_model .GetUserFollowing (ctx , ctx .ContextUser , ctx .Doer , db.ListOptions {
179
- PageSize : setting . UI . User . RepoPagingNum ,
184
+ PageSize : pagingNum ,
180
185
Page : page ,
181
186
})
182
187
if err != nil {
@@ -187,15 +192,16 @@ func Profile(ctx *context.Context) {
187
192
188
193
total = int (count )
189
194
case "activity" :
195
+ date := ctx .FormString ("date" )
190
196
items , count , err := activities_model .GetFeeds (ctx , activities_model.GetFeedsOptions {
191
197
RequestedUser : ctx .ContextUser ,
192
198
Actor : ctx .Doer ,
193
199
IncludePrivate : showPrivate ,
194
200
OnlyPerformedBy : true ,
195
201
IncludeDeleted : false ,
196
- Date : ctx . FormString ( " date" ) ,
202
+ Date : date ,
197
203
ListOptions : db.ListOptions {
198
- PageSize : setting . UI . FeedPagingNum ,
204
+ PageSize : pagingNum ,
199
205
Page : page ,
200
206
},
201
207
})
@@ -204,13 +210,14 @@ func Profile(ctx *context.Context) {
204
210
return
205
211
}
206
212
ctx .Data ["Feeds" ] = items
213
+ ctx .Data ["Date" ] = date
207
214
208
215
total = int (count )
209
216
case "stars" :
210
217
ctx .Data ["PageIsProfileStarList" ] = true
211
218
repos , count , err = repo_model .SearchRepository (ctx , & repo_model.SearchRepoOptions {
212
219
ListOptions : db.ListOptions {
213
- PageSize : setting . UI . User . RepoPagingNum ,
220
+ PageSize : pagingNum ,
214
221
Page : page ,
215
222
},
216
223
Actor : ctx .Doer ,
@@ -242,7 +249,7 @@ func Profile(ctx *context.Context) {
242
249
case "watching" :
243
250
repos , count , err = repo_model .SearchRepository (ctx , & repo_model.SearchRepoOptions {
244
251
ListOptions : db.ListOptions {
245
- PageSize : setting . UI . User . RepoPagingNum ,
252
+ PageSize : pagingNum ,
246
253
Page : page ,
247
254
},
248
255
Actor : ctx .Doer ,
@@ -264,7 +271,7 @@ func Profile(ctx *context.Context) {
264
271
default :
265
272
repos , count , err = repo_model .SearchRepository (ctx , & repo_model.SearchRepoOptions {
266
273
ListOptions : db.ListOptions {
267
- PageSize : setting . UI . User . RepoPagingNum ,
274
+ PageSize : pagingNum ,
268
275
Page : page ,
269
276
},
270
277
Actor : ctx .Doer ,
@@ -287,12 +294,15 @@ func Profile(ctx *context.Context) {
287
294
ctx .Data ["Repos" ] = repos
288
295
ctx .Data ["Total" ] = total
289
296
290
- pager := context .NewPagination (total , setting . UI . User . RepoPagingNum , page , 5 )
297
+ pager := context .NewPagination (total , pagingNum , page , 5 )
291
298
pager .SetDefaultParams (ctx )
292
299
pager .AddParam (ctx , "tab" , "TabName" )
293
300
if tab != "followers" && tab != "following" && tab != "activity" && tab != "projects" {
294
301
pager .AddParam (ctx , "language" , "Language" )
295
302
}
303
+ if tab == "activity" {
304
+ pager .AddParam (ctx , "date" , "Date" )
305
+ }
296
306
ctx .Data ["Page" ] = pager
297
307
ctx .Data ["IsPackageEnabled" ] = setting .Packages .Enabled
298
308
ctx .Data ["IsRepoIndexerEnabled" ] = setting .Indexer .RepoIndexerEnabled
0 commit comments