1 xml.tag! "user", :id => api_user.id,
2 :display_name => api_user.display_name,
3 :account_created => api_user.creation_time.xmlschema do
4 xml.tag! "description", api_user.description if api_user.description
5 if current_user && current_user == api_user
6 xml.tag! "contributor-terms", :agreed => api_user.terms_agreed.present?,
7 :pd => api_user.consider_pd
9 xml.tag! "contributor-terms", :agreed => api_user.terms_agreed.present?
11 xml.tag! "img", :href => user_image_url(api_user) if api_user.image.file? || api_user.image_use_gravatar
13 api_user.roles.each do |role|
17 xml.tag! "changesets", :count => api_user.changesets.size
18 xml.tag! "traces", :count => api_user.traces.size
20 xml.tag! "received", :count => api_user.blocks.size,
21 :active => api_user.blocks.active.size
22 if api_user.moderator?
23 xml.tag! "issued", :count => api_user.blocks_created.size,
24 :active => api_user.blocks_created.active.size
27 if current_user && current_user == api_user
28 if api_user.home_lat && api_user.home_lon
29 xml.tag! "home", :lat => api_user.home_lat,
30 :lon => api_user.home_lon,
31 :zoom => api_user.home_zoom
34 xml.tag! "languages" do
35 api_user.languages.split(",") { |lang| xml.tag! "lang", lang }
38 xml.tag! "messages" do
39 xml.tag! "received", :count => api_user.messages.size,
40 :unread => api_user.new_messages.size
41 xml.tag! "sent", :count => api_user.sent_messages.size