添加对hovercard4proj的支持

This commit is contained in:
zhangxunhui 2023-02-02 16:56:04 +08:00
parent c5ee0e5400
commit efc96f3467
1 changed files with 6 additions and 2 deletions

View File

@ -2,8 +2,8 @@ class UsersController < ApplicationController
include ApplicationHelper include ApplicationHelper
include Ci::DbConnectable include Ci::DbConnectable
before_action :load_user, only: [:show, :homepage_info, :sync_token, :sync_gitea_pwd, :projects, :watch_users, :fan_users, :hovercard] before_action :load_user, only: [:show, :homepage_info, :sync_token, :sync_gitea_pwd, :projects, :watch_users, :fan_users, :hovercard, :hovercard4proj]
before_action :check_user_exist, only: [:show, :homepage_info,:projects, :watch_users, :fan_users, :hovercard] before_action :check_user_exist, only: [:show, :homepage_info,:projects, :watch_users, :fan_users, :hovercard, :hovercard4proj]
before_action :require_login, only: %i[me sync_user_info] before_action :require_login, only: %i[me sync_user_info]
before_action :connect_to_ci_db, only: [:get_user_info] before_action :connect_to_ci_db, only: [:get_user_info]
before_action :convert_image!, only: [:update, :update_image] before_action :convert_image!, only: [:update, :update_image]
@ -205,6 +205,10 @@ class UsersController < ApplicationController
def hovercard def hovercard
end end
# author: zxh, 查询贡献者的贡献度
def hovercard4proj
end
def update def update
return render_not_found unless @user = User.find_by(login: params[:id]) || User.find_by_id(params[:id]) return render_not_found unless @user = User.find_by(login: params[:id]) || User.find_by_id(params[:id])
return render_forbidden unless User.current.logged? && (current_user&.admin? || current_user.id == @user.id) return render_forbidden unless User.current.logged? && (current_user&.admin? || current_user.id == @user.id)