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.
28 lines
771 B
28 lines
771 B
json.carousels do
|
|
json.array! @carousels do |carousel|
|
|
json.extract! carousel, :id, :link, :position
|
|
|
|
json.path carousel.link
|
|
json.image_url Util::FileManage.source_disk_file_url(carousel)
|
|
end
|
|
end
|
|
|
|
if @advert.present?
|
|
json.advert do
|
|
json.extract! @advert, :id, :link
|
|
json.image_url Util::FileManage.source_disk_file_url(@advert)
|
|
end
|
|
else
|
|
json.advert nil
|
|
end
|
|
|
|
json.course_count @course_count
|
|
json.courses @courses.each do |course|
|
|
json.(course, :id, :name, :visits, :course_members_count)
|
|
json.creator course.teacher.real_name
|
|
json.school course.school&.name
|
|
course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first
|
|
json.sticky course_member.sticky
|
|
end
|
|
|