实训和实践课程的收藏参数

schedule_job
cxt 5 years ago
parent 2fcbd4c351
commit 3abae10141

@ -649,6 +649,10 @@ class User < ApplicationRecord
Educoder::Utils.random_hex(16)
end
def is_collect? container
collections.where(container: container).exists?
end
# 全部已认证
def all_certified?
authentication? && professional_certification?

@ -1,5 +1,7 @@
json.fork_from @fork_from
json.identity User.current.shixun_identity(@shixun)
json.is_collect @user.is_collect?(@shixun)
json.power @power
json.partial! 'shixuns/top', locals: { shixun: @shixun, current_myshixun: @current_myshixun }
json.secret_repository @shixun.shixun_secret_repository.present?

@ -5,6 +5,8 @@ json.challenges_count @subject.subject_challenge_count
json.subject_score @subject.all_score
json.member_count @subject.member_count
json.is_collect @user.is_collect?(@subject)
json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin?
json.publish_status publish_status(@subject, @is_manager)
json.public_status public_status(@subject, @is_manager, @user)

Loading…
Cancel
Save