jam-cloud/web/app/views/api_schools/show.rabl

50 lines
1.2 KiB
Ruby

object @school
attributes :id, :user_id, :name, :enabled, :scheduling_communication, :original_fpfile, :cropped_fpfile, :crop_selection, :photo_url, :correspondence_email, :education
child :owner => :owner do
attributes :id, :email, :photo_url, :name, :first_name, :last_name
end
child :students => :students do
attributes :id, :name, :first_name, :last_name, :photo_url
if @owner_viewing
attributes :email
end
end
if @show_approved_only
child :approved_teachers => :teachers do |teacher|
attributes :id
child :instruments do |teacher|
attributes :id, :description
end
child :user => :user do
attributes :id, :name, :first_name, :last_name, :photo_url, :teacher_profile_url, :resolved_photo_url
if @owner_viewing
attributes :email
end
end
end
else
child :teachers => :teachers do |teacher|
attributes :id
child :instruments do |teacher|
attributes :id, :description
end
child :user => :user do
attributes :id, :name, :first_name, :last_name, :photo_url, :teacher_profile_url, :resolved_photo_url
if @owner_viewing
attributes :email
end
end
end
end