1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00
fab-manager/app/views/api/members/index.json.jbuilder

28 lines
896 B
Plaintext
Raw Normal View History

2015-05-05 03:10:25 +02:00
json.array!(@members) do |member|
json.id member.id
json.username member.username
json.slug member.slug
json.name member.profile.full_name
json.email member.email if current_user
json.first_name member.profile.first_name
json.last_name member.profile.last_name
json.profile do
json.user_avatar do
json.id member.profile.user_avatar.id
json.attachment_url member.profile.user_avatar.attachment_url
end if member.profile.user_avatar
json.first_name member.profile.first_name
json.last_name member.profile.last_name
json.gender member.profile.gender.to_s
if current_user and current_user.is_admin?
json.phone member.profile.phone
json.birthday member.profile.birthday.iso8601 if member.profile.birthday
end
end
json.group_id member.group_id
json.group do
json.id member.group.id
json.name member.group.name
end
end