From ce07bf7e3497bc5aa8348705d6b5968a92760bbc Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Jun 2019 15:37:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/add_collaborators.json.jbuilder | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/views/shixuns/add_collaborators.json.jbuilder b/app/views/shixuns/add_collaborators.json.jbuilder index 963389933..79b325fcd 100644 --- a/app/views/shixuns/add_collaborators.json.jbuilder +++ b/app/views/shixuns/add_collaborators.json.jbuilder @@ -1,8 +1,11 @@ #json.partial! "users/users_list", users: @users json.total_count @total_count -json.array! @users do |user| - json.user_id user.id - json.identify user.identity - json.nickname user.lastname - json.school_name user.school_name +json.users do + json.array! @users do |user| + json.user_id user.id + json.identify user.identity + json.nickname user.lastname + json.school_name user.school_name + end + end From c211548a13326945c5795b74ee1ad64e41c29383 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Jun 2019 15:38:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=90=88=E4=BD=9C=E8=80=85=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- app/views/shixuns/add_collaborators.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 89a0d524f..73029706f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -635,7 +635,7 @@ class ShixunsController < ApplicationController end page = params[:page] || 1 limit = params[:limit] || 20 - @total_count = @users.count + @user_count = @users.count @users = @users.page(page).per(limit) end diff --git a/app/views/shixuns/add_collaborators.json.jbuilder b/app/views/shixuns/add_collaborators.json.jbuilder index 79b325fcd..d73a5b9bc 100644 --- a/app/views/shixuns/add_collaborators.json.jbuilder +++ b/app/views/shixuns/add_collaborators.json.jbuilder @@ -1,5 +1,5 @@ #json.partial! "users/users_list", users: @users -json.total_count @total_count +json.user_count @user_count json.users do json.array! @users do |user| json.user_id user.id From 4fefe12d16da4987ea91037813207ba5d73321d1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 28 Jun 2019 16:29:13 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 5 ++--- app/views/shixuns/add_collaborators.json.jbuilder | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index ac0b6baa8..9e645c35a 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -51,9 +51,8 @@ class GamesController < ApplicationController # 统计评测时间 record_onsume_time = EvaluateRecord.where(game_id: @game.id).first.try(:consume_time) - # power判断用户是否有权限查看隐藏测试集(TPM管理员;平台认证的老师;花费金币查看者) - # myshixun_manager - myshixun_manager = current_user.manager_of_shixun?(@shixun) || (current_user.is_teacher? && current_user.pro_certification?) + # myshixun_manager判断用户是否有权限查看隐藏测试集(TPM管理员;平台认证的老师;花费金币查看者) + myshixun_manager = @identity < USER::EDU_GAME_MANAGER # 选择题和编程题公共部分 @base_date = {st: @st, discusses_count: discusses_count, game_count: game_count, myshixun: @myshixun, diff --git a/app/views/shixuns/add_collaborators.json.jbuilder b/app/views/shixuns/add_collaborators.json.jbuilder index d73a5b9bc..d20f0b318 100644 --- a/app/views/shixuns/add_collaborators.json.jbuilder +++ b/app/views/shixuns/add_collaborators.json.jbuilder @@ -4,7 +4,7 @@ json.users do json.array! @users do |user| json.user_id user.id json.identify user.identity - json.nickname user.lastname + json.nickname user.real_name json.school_name user.school_name end