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 if @this_user.description
7 xml.tag! "description", @this_user.description
9 xml.tag! "contributor-terms",
10 :agreed => !!@this_user.terms_agreed,
11 :pd => !!@this_user.consider_pd
12 if @this_user.image.file?
13 xml.tag! "img", :href => "http://#{SERVER_URL}#{@this_user.image.url}"
16 @this_user.roles.each do |role|
20 xml.tag! "changesets", :count => @this_user.changesets.size
21 xml.tag! "traces", :count => @this_user.traces.size
23 xml.tag! "received", :count => @this_user.blocks.size,
24 :active => @this_user.blocks.active.size
25 if @this_user.moderator?
26 xml.tag! "issued", :count => @this_user.blocks_created.size,
27 :active => @this_user.blocks_created.active.size
30 if @user && @user == @this_user
31 if @this_user.home_lat and @this_user.home_lon
32 xml.tag! "home", :lat => @this_user.home_lat,
33 :lon => @this_user.home_lon,
34 :zoom => @this_user.home_zoom
36 if @this_user.languages
37 xml.tag! "languages" do
38 @this_user.languages.split(",") { |lang| xml.tag! "lang", lang }