1 xml.instruct! :xml, :version => "1.0"
 
   2 xml.osm("version" => API_VERSION, "generator" => GENERATOR) do
 
   3   xml.tag! "user", :id => @this_user.id,
 
   4                    :display_name => @this_user.display_name,
 
   5                    :account_created => @this_user.creation_time.xmlschema do
 
   6     xml.tag! "description", @this_user.description if @this_user.description
 
   7     if @user && @user == @this_user
 
   8       xml.tag! "contributor-terms", :agreed => @this_user.terms_agreed.present?,
 
   9                                     :pd => @this_user.consider_pd
 
  11       xml.tag! "contributor-terms", :agreed => @this_user.terms_agreed.present?
 
  13     if @this_user.image.file? || @this_user.image_use_gravatar
 
  14       xml.tag! "img", :href => user_image_url(@this_user, :size => 256)
 
  17       @this_user.roles.each do |role|
 
  21     xml.tag! "changesets", :count => @this_user.changesets.size
 
  22     xml.tag! "traces", :count => @this_user.traces.size
 
  24       xml.tag! "received", :count => @this_user.blocks.size,
 
  25                            :active => @this_user.blocks.active.size
 
  26       if @this_user.moderator?
 
  27         xml.tag! "issued", :count => @this_user.blocks_created.size,
 
  28                            :active => @this_user.blocks_created.active.size
 
  31     if @user && @user == @this_user
 
  32       if @this_user.home_lat && @this_user.home_lon
 
  33         xml.tag! "home", :lat => @this_user.home_lat,
 
  34                          :lon => @this_user.home_lon,
 
  35                          :zoom => @this_user.home_zoom
 
  37       if @this_user.languages
 
  38         xml.tag! "languages" do
 
  39           @this_user.languages.split(",") { |lang| xml.tag! "lang", lang }
 
  42       xml.tag! "messages" do
 
  43         xml.tag! "received", :count => @this_user.messages.size,
 
  44                              :unread => @this_user.new_messages.size
 
  45         xml.tag! "sent", :count => @this_user.sent_messages.size