Browse Source

添加对hovercard4proj的支持

pull/324/head
zhangxunhui 3 years ago
parent
commit
efc96f3467
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      app/controllers/users_controller.rb

+ 6
- 2
app/controllers/users_controller.rb View File

@@ -2,8 +2,8 @@ class UsersController < ApplicationController
include ApplicationHelper
include Ci::DbConnectable

before_action :load_user, only: [:show, :homepage_info, :sync_token, :sync_gitea_pwd, :projects, :watch_users, :fan_users, :hovercard]
before_action :check_user_exist, only: [:show, :homepage_info,: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, :hovercard4proj]
before_action :require_login, only: %i[me sync_user_info]
before_action :connect_to_ci_db, only: [:get_user_info]
before_action :convert_image!, only: [:update, :update_image]
@@ -205,6 +205,10 @@ class UsersController < ApplicationController
def hovercard
end

# author: zxh, 查询贡献者的贡献度
def hovercard4proj
end

def update
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)


Loading…
Cancel
Save