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