You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/views/subjects/show.json.jbuilder

33 lines
1.3 KiB

json.(@subject, :id, :name, :description, :learning_notes, :stages_count, :stage_shixuns_count, :shixuns_count, :excellent)
6 years ago
json.challenge_choose_count @subject.subject_challenge_choose_count
json.challenges_count @subject.subject_challenge_count
json.subject_score @subject.all_score
json.member_count @subject.member_count
json.allow_delete (@subject.status != 2 && @is_creator) || @user.admin?
6 years ago
json.publish_status publish_status(@subject, @is_manager, @user, @shixuns)
json.allow_statistics @is_manager
6 years ago
json.allow_send @user.logged?
json.allow_visit @subject.status > 1 || @is_manager
json.allow_add_member @is_manager
6 years ago
json.is_creator @is_creator
6 years ago
if @subject.excellent
json.has_start @subject.has_course_start?
json.courses @courses do |course|
json.course_id course.id
json.first_category_url module_url(course.none_hidden_course_modules.first, course)
json.start_date course.start_date
json.end_date course.end_date
6 years ago
json.student_count course.students.count
json.course_identity @user.course_identity(course)
json.course_status subject_course_status course
6 years ago
end
5 years ago
if @subject.max_course_end_date.nil? || @subject.max_course_end_date < Date.today
json.student_count @subject.student_count
json.participant_count @subject.participant_count
json.has_participate @subject.has_participate?
5 years ago
end
6 years ago
end