Merge branch 'dev_aliyun' into dev_Ysm

dev_oauth
cxt 6 years ago
commit 490354a96b

@ -1,5 +1,5 @@
class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index, :show]
before_action :require_login, :check_auth, except: [:index, :show, :right_banner]
# before_action :check_auth, except: [:index]
before_action :check_account, except: [:index, :show]
before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
@ -85,17 +85,6 @@ class SubjectsController < ApplicationController
# 合作团队
@shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
shixuns = @subject.shixuns.published.pluck(:id)
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
# 实训路径中的所有实训标签
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
@user_tags = user_shixun_tags challenge_ids, @user.id
@my_subject_progress = @subject.my_subject_progress
# 访问数变更
@subject.increment!(:visits)
end

@ -24,25 +24,3 @@ if @subject.excellent
json.course_status subject_course_status course
end
end
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }
json.role member.role
end
# 技能标签
json.tags @tags do |tag|
unless tag.blank?
json.tag_name tag
json.status @user_tags.include?(tag)
end
end
# 我的进展
json.progress do
json.my_score @subject.my_subject_score
json.all_score @subject.all_score
json.learned @subject.my_subject_progress
json.time @subject.my_consume_time
end
Loading…
Cancel
Save