新增:个人项目分页limit使用9999
This commit is contained in:
parent
0fc705fcde
commit
b37ff07bcf
|
@ -680,6 +680,14 @@ class ApplicationController < ActionController::Base
|
|||
relation.page(page).per(limit)
|
||||
end
|
||||
|
||||
def kaminari_unlimit_paginate(ralation)
|
||||
limit = params[:limit] || params[:per_page]
|
||||
limit = (limit.to_i.zero? || limit.to_i > 9999) ? 9999 : limit.to_i
|
||||
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
|
||||
|
||||
relation.page(page).per(limit)
|
||||
end
|
||||
|
||||
def kaminari_array_paginate(relation)
|
||||
limit = params[:limit] || params[:per_page]
|
||||
limit = (limit.to_i.zero? || limit.to_i > 20) ? 20 : limit.to_i
|
||||
|
|
|
@ -281,7 +281,7 @@ class UsersController < ApplicationController
|
|||
is_current_admin_user = User.current.logged? && (current_user&.admin? || current_user.id == @user.id)
|
||||
scope = Projects::ListMyQuery.call(params, @user,is_current_admin_user)
|
||||
@total_count = scope.size
|
||||
@projects = paginate(scope)
|
||||
@projects = kaminari_unlimit_paginate(scope)
|
||||
end
|
||||
|
||||
# TODO 其他平台登录时同步修改gitea平台对应用户的密码
|
||||
|
|
Loading…
Reference in New Issue