145607446884b18bf70443cc3a8ac7a3cc9780e9
[rails.git] / app / views / user / api_read.builder
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
8     end
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}"
14     end
15     if @user && @user == @this_user
16       if @this_user.home_lat and @this_user.home_lon
17         xml.tag! "home", :lat => @this_user.home_lat,
18                          :lon => @this_user.home_lon,
19                          :zoom => @this_user.home_zoom
20       end    
21       if @this_user.languages
22         xml.tag! "languages" do
23           @this_user.languages.split(",") { |lang| xml.tag! "lang", lang }
24         end
25       end
26     end
27   end
28 end