Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. user_api = {
  2. :id => @user_profile.id,
  3. :name => {
  4. :first => @user_profile.given_name,
  5. :last => @user_profile.surname
  6. },
  7. :email => @user_profile.email,
  8. :userid => @user_profile.userid,
  9. :title => @user_profile.title,
  10. :organization => @user_profile.organization,
  11. :directs => @user_profile.directs,
  12. :total_reports => @user_profile.total_reports,
  13. :bio => @user_profile.description,
  14. :work_floor => @user_profile.work_floor,
  15. :work_office => @user_profile.work_office,
  16. :work_address1 => @user_profile.work_address1,
  17. :work_address2 => @user_profile.work_address2,
  18. :work_address3 => @user_profile.work_address3,
  19. :work_city => @user_profile.work_city,
  20. :work_state => @user_profile.work_state,
  21. :work_zip => @user_profile.work_zip,
  22. :work_country => @user_profile.work_country,
  23. :work_county => @user_profile.work_county,
  24. :city => @user_profile.city,
  25. :country => @user_profile.country,
  26. :cost_center => @user_profile.cost_center,
  27. :uri => user_profile_url(@user_profile),
  28. :avatar => {
  29. :tiny => @user_profile.avatar.url(:tiny),
  30. :thumb => @user_profile.avatar.url(:thumb),
  31. :square => @user_profile.avatar.url(:square),
  32. :proportional_thumb => @user_profile.avatar.url(:proportional_thumb),
  33. :original => @user_profile.avatar.url(:original),
  34. },
  35. :tags => @user_profile.tag_list.map {|t| {:name => t} },
  36. :groups => @user_profile.groups.map {|g| {:name => g.name, :url => group_url(g)} },
  37. :phone => {
  38. :mobile => @user_profile.mobile_phone,
  39. :work => @user_profile.work_phone,
  40. :phone => @user_profile.phone_fax,
  41. :home_office => @user_profile.phone_home_office,
  42. :other => @user_profile.other
  43. },
  44. :manager => {
  45. :name => @user_profile.manager_name,
  46. :email => (@user_profile.parent ? @user_profile.parent.email : nil),
  47. :id => (@user_profile.parent ? @user_profile.parent.id : nil),
  48. :url => (@user_profile.parent ? user_profile_url(@user_profile.parent) : nil)
  49. },
  50. :im => {
  51. :yahoo => @user_profile.im_yahoo,
  52. :google => @user_profile.im_google,
  53. :aim => @user_profile.im_aol,
  54. :microsoft => @user_profile.im_microsoft,
  55. :jabber => @user_profile.im_jabber,
  56. :icq => @user_profile.im_icq,
  57. :skype => @user_profile.im_skype
  58. },
  59. :network => @user_profile.network.map {|c| {
  60. :name => {
  61. :first => c.given_name,
  62. :last => c.surname
  63. },
  64. :email => c.email,
  65. :id => c.id,
  66. :url => user_profile_url(c)
  67. } if c.active }
  68. }
Add Comment
Please, Sign In to add comment