]> git.openstreetmap.org Git - rails.git/commitdiff
Merge 12304:14009 from trunk.
authorTom Hughes <tom@compton.nu>
Sun, 8 Mar 2009 13:02:37 +0000 (13:02 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 8 Mar 2009 13:02:37 +0000 (13:02 +0000)
36 files changed:
app/controllers/api_controller.rb
app/controllers/geocoder_controller.rb
app/controllers/user_controller.rb
app/controllers/user_preference_controller.rb
app/models/changeset.rb
app/models/node.rb
app/models/relation.rb
app/models/way.rb
app/views/browse/_way_details.rhtml
app/views/diary_entry/list.rhtml
app/views/layouts/site.rhtml
app/views/notifier/signup_confirm.text.html.rhtml
app/views/notifier/signup_confirm.text.plain.rhtml
app/views/site/_key.rhtml
app/views/site/_search.rhtml
app/views/site/index.rhtml
app/views/trace/_trace_header.rhtml
app/views/user/login.rhtml
app/views/user/new.rhtml
config/environment.rb
config/initializers/libxml.rb
db/migrate/019_add_timestamp_indexes.rb [moved from db/migrate/018_add_timestamp_indexes.rb with 100% similarity]
db/migrate/020_populate_node_tags_and_remove.rb [moved from db/migrate/019_populate_node_tags_and_remove.rb with 94% similarity]
db/migrate/020_populate_node_tags_and_remove_helper.c [moved from db/migrate/019_populate_node_tags_and_remove_helper.c with 100% similarity]
db/migrate/021_move_to_innodb.rb [moved from db/migrate/020_move_to_innodb.rb with 100% similarity]
db/migrate/022_key_constraints.rb [moved from db/migrate/021_key_constraints.rb with 100% similarity]
db/migrate/023_add_changesets.rb [moved from db/migrate/022_add_changesets.rb with 100% similarity]
db/migrate/024_order_relation_members.rb [moved from db/migrate/023_order_relation_members.rb with 100% similarity]
db/migrate/025_add_end_time_to_changesets.rb [moved from db/migrate/024_add_end_time_to_changesets.rb with 100% similarity]
lib/diff_reader.rb
lib/osm.rb
public/images/donate.png [new file with mode: 0644]
public/robots.txt
public/stylesheets/site.css
test/functional/node_controller_test.rb
test/functional/relation_controller_test.rb

index 0724a3712651cfd23e05fcd81c0fc38f24182be3..cae510284068a2d48f3bad0ce29b73425b008030 100644 (file)
@@ -55,7 +55,7 @@ class ApiController < ApplicationController
     points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => TRACEPOINTS_PER_PAGE, :order => "timestamp DESC" )
 
     doc = XML::Document.new
-    doc.encoding = 'UTF-8'
+    doc.encoding = XML::Encoding::UTF_8
     root = XML::Node.new 'gpx'
     root['version'] = '1.0'
     root['creator'] = 'OpenStreetMap.org'
index 531cce4221df34b2d10155e3f872251113d9197c..18812689b4c2c8318d792993e6366987bdde479a 100644 (file)
@@ -29,7 +29,7 @@ class GeocoderController < ApplicationController
 
       if results_count == 1
         position = results.collect { |s| s[:results] }.compact.flatten[0]
-        page.call "setPosition", position[:lat], position[:lon], position[:zoom]
+        page.call "setPosition", position[:lat].to_f, position[:lon].to_f, position[:zoom].to_i
       else
         page.call "openSidebar"
       end
index 7ebe6b6b6f7af8ddcbe3404b3f2b99f64a38b45f..47c1cff9fbb4e259310601a8469c94eeaf28017d 100644 (file)
@@ -11,19 +11,24 @@ class UserController < ApplicationController
 
   def save
     @title = 'create account'
-    @user = User.new(params[:user])
 
-    @user.visible = true
-    @user.data_public = true
-    @user.description = "" if @user.description.nil?
-    @user.creation_ip = request.remote_ip
-
-    if @user.save
-      flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
-      Notifier.deliver_signup_confirm(@user, @user.tokens.create)
-      redirect_to :action => 'login'
-    else
+    if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"})
       render :action => 'new'
+    else
+      @user = User.new(params[:user])
+
+      @user.visible = true
+      @user.data_public = true
+      @user.description = "" if @user.description.nil?
+      @user.creation_ip = request.remote_ip
+
+      if @user.save
+        flash[:notice] = "User was successfully created. Check your email for a confirmation note, and you\'ll be mapping in no time :-)<br>Please note that you won't be able to login until you've received and confirmed your email address."
+        Notifier.deliver_signup_confirm(@user, @user.tokens.create)
+        redirect_to :action => 'login'
+      else
+        render :action => 'new'
+      end
     end
   end
 
index 3b56c257be32b822864b08f984c959d8f549fc27..68ea88eeac5922def89f7e7e947f73c68332e072 100644 (file)
@@ -52,8 +52,7 @@ class UserPreferenceController < ApplicationController
 
   # update the entire set of preferences
   def update
-    p = XML::Parser.new
-    p.string = request.raw_post
+    p = XML::Parser.string(request.raw_post)
     doc = p.parse
 
     prefs = []
index 31d927e9a6649094b7ff9825519bad8ccff26365..d420f537a2472d8fe0a0f0058dee62952dd8adcf 100644 (file)
@@ -53,8 +53,7 @@ class Changeset < ActiveRecord::Base
   
   def self.from_xml(xml, create=false)
     begin
-      p = XML::Parser.new
-      p.string = xml
+      p = XML::Parser.string(xml)
       doc = p.parse
 
       cs = Changeset.new
index f2ad3a78add2196f117214816489d3c7bdc686cb..d3e0a7e8d392a470ed193eb6de4fff0738ee8e29 100644 (file)
@@ -64,8 +64,7 @@ class Node < ActiveRecord::Base
   # Read in xml as text and return it's Node object representation
   def self.from_xml(xml, create=false)
     begin
-      p = XML::Parser.new
-      p.string = xml
+      p = XML::Parser.string(xml)
       doc = p.parse
 
       doc.find('//osm/node').each do |pt|
index 6be1061591dda7b665b20ceed5b5b81ae79e96d3..64af4ecc1eb9d59eff27e8b46d292f3a2aa560f6 100644 (file)
@@ -27,8 +27,7 @@ class Relation < ActiveRecord::Base
 
   def self.from_xml(xml, create=false)
     begin
-      p = XML::Parser.new
-      p.string = xml
+      p = XML::Parser.string(xml)
       doc = p.parse
 
       doc.find('//osm/relation').each do |pt|
index 86b25e08e2fb44a9660bc197221e35d109b46f69..dbc1197a9e039ec003b1e623e92bdf97e9c1faf2 100644 (file)
@@ -27,8 +27,7 @@ class Way < ActiveRecord::Base
 
   def self.from_xml(xml, create=false)
     begin
-      p = XML::Parser.new
-      p.string = xml
+      p = XML::Parser.string(xml)
       doc = p.parse
 
       doc.find('//osm/way').each do |pt|
index 99b8e1d16def240323c0f3958aeddf231719b6e8..bc00100d888dbef43cf74acbfca9cbdf2d217d84 100644 (file)
@@ -14,7 +14,7 @@
   </tr>
 
   <% unless way_details.containing_relation_members.empty? %>
-    <tr>
+    <tr valign="top">
       <th>Part of:</th>
       <td>
         <table padding="0">
index 9852313bbd7e669d308af8586fd2ed0c49562580..38157b183b976883282d86ba2bdcca717ccf0857 100644 (file)
 
 
 <% if @entries.empty? %>
-       <p>No diary entries</p>
-
+  <p>No diary entries</p>
 <% else %>
+  <p>Recent diary entries:</p>
+
+  <hr />
+
+  <%= render :partial => 'diary_entry', :collection => @entries %>
        
-       <p>Recent diary entries:</p>
-       <hr />
-       <%= render :partial => 'diary_entry', :collection => @entries %>
-       
-       <%= link_to "Older Entries", { :page => @entry_pages.current.next } if @entry_pages.current.next %>
-       <% if @entry_pages.current.next and @entry_pages.current.previous %>
-       |
-       <% end %>
-       <%= link_to "Newer Entries", { :page => @entry_pages.current.previous } if @entry_pages.current.previous %>
-       
-       <br />
-       
+  <%= link_to "Older Entries", { :page => @entry_pages.current.next } if @entry_pages.current.next %>
+  <% if @entry_pages.current.next and @entry_pages.current.previous %>|<% end %>
+  <%= link_to "Newer Entries", { :page => @entry_pages.current.previous } if @entry_pages.current.previous %>
+
+  <br />
 <% end %>
 
 <%= rss_link_to :action => 'rss' %>
-<%= auto_discovery_link_tag :atom, :action => 'rss' %>
-
 
-<br />
-<br />
\ No newline at end of file
+<% content_for :head do %>
+<%= auto_discovery_link_tag :atom, :action => 'rss' %>
+<% end %>
index cf7ad9fc811f839adc9fe2cf413831ebb6954996..cc8f7192d6953c06be92ae39af19114badfdca1a 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
     <%= javascript_include_tag 'prototype' %>
     <%= javascript_include_tag 'site' %>
@@ -8,6 +8,7 @@
     <%= stylesheet_link_tag 'print', :media => "print" %>
     <%= tag("link", { :rel => "search", :type => "application/opensearchdescription+xml", :title => "OpenStreetMap Search", :href => "/opensearch/osm.xml" }) %>
     <%= tag("meta", { :name => "description", :content => "OpenStreetMap is the free wiki world map." }) %>
+    <%= yield :head %>
     <title>OpenStreetMap<%= ' | '+ h(@title) if @title %></title>
   </head>
   <body>
 
       <% unless @user %>
       <div id="intro">
-        OpenStreetMap is a free editable map of the whole world. It is made by people like you.
-        <p/>
-        OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth.
-        <p/>
-        OpenStreetMap's hosting is kindly supported by the <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and <a href="http://www.bytemark.co.uk">bytemark</a>.
+        <p>
+          OpenStreetMap is a free editable map of the whole world. It
+          is made by people like you.
+        </p>
+        <p>
+          OpenStreetMap allows you to view, edit and use geographical
+          data in a collaborative way from anywhere on Earth.
+        </p>
+        <p>
+          OpenStreetMap's hosting is kindly supported by the
+          <a href="http://www.vr.ucl.ac.uk">UCL VR Centre</a> and
+          <a href="http://www.bytemark.co.uk">bytemark</a>.
+        </p>
       </div>
       <% end %>
 
       </div>
       <% end %>
 
+      <% if false %>
+      <div id="donate">
+        Support OpenStreetMap by
+        <a href="http://donate.openstreetmap.org/">donating</a>
+        to the Hardware Upgrade Fund.
+      </div>
+      <% end %>
+
       <div id="left_menu" class="left_menu">
         <a href="http://wiki.openstreetmap.org">Help &amp; Wiki</a><br />
         <a href="http://www.opengeodata.org/">News blog</a><br />
       </div>
 
       <%= yield :optionals %>
-      <div id="cclogo">
-        <center>
 
-          <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
-            <input type="hidden" name="cmd" value="_s-xclick" />
-            <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" style="border: none;" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" />
-            <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
-            <input type="hidden" name="encrypted" value="-----BEGIN PKCS7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g1yZUBwYXlwYWwuY29tAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wNjA4MjYwODQ2NDdaMCMGCSqGSIb3DQEJBDEWBBTyC1ZchvuTMtcYeudPPSP/w8HiEDANBgkqhkiG9w0BAQEFAASBgJPpBf69pRAJfhzv/MfPiMncuq3TSlvpX7VtG9p4dXzSko4i2lWUDD72r5zdF2NwDgZ6avf630PutgpOzYJQ525If1xU2olc9DWI43UZTqY+FArgFuCJ8VnkPsy9mcbXPoSjLRqNwrsA2yoETxMISO3ASELzELJTJgpPk4bU57eZ-----END PKCS7-----" />
-          </form>
-
-          <%= link_to (image_tag "cc_button.png", :alt => "CC by-sa 2.0", :border => "0"), "http://creativecommons.org/licenses/by-sa/2.0/" %>
-
-        </center>
-      </div>
+      <center>
+        <div class="button" style="width: 115px">
+          <a href="http://donate.openstreetmap.org/"><img src="/images/donate.png" border="0" alt="Make a Donation" /></a>
+        </div>
 
+        <div id="cclogo" class="button" style="width: 88px">
+          <%= link_to image_tag("cc_button.png", :alt => "CC by-sa 2.0", :border => "0"), "http://creativecommons.org/licenses/by-sa/2.0/" %>
+        </div>
+      </center>
     </div>
   </body>
 </html>
index 61ab877936f0d49fd4a6f97ba0d19cbb41fb3972..3831ab91b0dee0768ab256d101a2058b7596db5e 100644 (file)
@@ -1,12 +1,16 @@
-<p>Hi,</p>
+<p>Hi there!</p>
 
 <p>Someone (hopefully you) would like to create an account over at
    <%= SERVER_URL %>.</p>
 
-<p>If this is you, please click the link below to confirm that account.</p>
+<p>If this is you, welcome! Please click the link below to confirm that account and read on for more information about OpenStreetMap</p>
 
 <p><a href="<%= @url %>"><%= @url %></a></p>
 
+<p>You can watch an introductory video to OpenStreetMap <a href="http://showmedo.com/videos/video?name=1800000&fromSeriesID=180">video here</a>. There are more <a href="http://showmedo.com/videos/series?name=mS2P1ZqS6">videos here</a>.
+
+Get reading about OpenStreetMap <a href="http://wiki.openstreetmap.org/wiki/Beginners%27_Guide">on the wiki</p> or <a href="http://www.opengeodata.org/">the opengeodata blog</a> which has <a href="http://www.opengeodata.org/?cat=13">podcasts to listen to</a> also!
+
 <p>You may also want to <a href="http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page">sign up to the OpenStreetMap wiki</a>.</p>
 
 <p>It is recommended that you create a user wiki page, which includes category tags noting where you are, such as <a href="http://wiki.openstreetmap.org/index.php/Category:Users_in_London">[[Category:Users_in_London]]</a>.</p> 
index 5b93428574f21c6c77b7fb4baebeb837497692c2..444891d673fe4af0ebd8263330b338d7e8264ae8 100644 (file)
@@ -1,15 +1,32 @@
-Hi,
+Hi there!
 
 Someone (hopefully you) would like to create an account over at
 <%= SERVER_URL %>
 
-If this is you, please click the link below to confirm that account.
+If this is you, welcome! Please click the link below to confirm that
+account and read on for more information about OpenStreetMap.
 
 <%= @url %>
 
+You can watch an introductory video to OpenStreetMap here:
+
+       http://showmedo.com/videos/video?name=1800000&fromSeriesID=180  
+
+There are more videos here:
+
+       http://showmedo.com/videos/series?name=mS2P1ZqS6        
+
+Get reading about OpenStreetMap on the wiki:
+
+       http://wiki.openstreetmap.org/wiki/Beginners%27_Guide
+
+OpenGeoData.org is OpenStreetMap's blog, and it has podcasts too:
+
+       http://www.opengeodata.org/
+
 You may also want to sign up to the OpenStreetMap wiki at:
 
-http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page
+       http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page
 
 It is recommended that you create a user wiki page, which includes
 category tags noting where you are, such as [[Category:Users_in_London]].
index 64309949815eadc0f80922876e3f8d304d800bfb..c632f16617c6cb2662bacef45a3a80309096f466 100644 (file)
@@ -11,7 +11,7 @@
     else if (zoomlevel<13) { var imgname = 'keymapnik'+zoomlevel+'.png'; }
     else                   { var imgname = 'keymapnik13.png'; }
 
-    updateSidebar("Map key", "<p><img src='images/"+imgname+"' /></p>");
+    updateSidebar("Map key", "<p><img src='images/"+imgname+"' /><\/p>");
     openSidebar({ width: "210px" });
   }
 
index 5b4e74b34f4b130c072b3f6754155c773a47db0c..6ddcc851cd640bab7ac4495d3d18f45013f49e81 100644 (file)
@@ -1,7 +1,7 @@
 <script type="text/javascript">
 <!--
   function startSearch() {
-    updateSidebar("Search Results", "<p class='search_results_entry'>Searching...</p>");
+    updateSidebar("Search Results", "<p class='search_results_entry'>Searching...<\/p>");
 
     $("search_field").style.display = "none";
     $("search_active").style.display = "inline";
     <span class="oboxheader">Search</span>
     <span class="whereami"><a href="javascript:describeLocation()">Where am I?</a></span>
     <div class="search_form">
-    <span id="search_field">
+    <div id="search_field">
     <% form_remote_tag(:loading => "startSearch()",
                        :complete => "endSearch()",
                        :url => { :controller => :geocoder, :action => :search }) do %>
       <%= text_field_tag :query, h(params[:query]) %>
       <%= submit_tag "Go" %>
     <% end %>
-    </span>
+    </div>
     <p id="search_active">Searching...</p>
     </div>
     <p class="search_help">
index 2cca4d5292317b8a3728e94ed33e3ec6e057312a..0c6488129740669ba92bf97700e8a1f622b979af 100644 (file)
 </div> 
 
 <div id="attribution">
-<table width="100%">
-<tr>
-<td align="left">http://creativecommons.org/licenses/by-sa/2.0/</td>
-<td align="right">http://openstreetmap.org/</td>
-</tr>
-<tr>
-<td colspan="2" align="center">
-Licensed under the Creative Commons Attribution-Share Alike 2.0 license
-by the OpenStreetMap project and its contributors.
-</td>
-</table>
+  <table width="100%">
+    <tr>
+      <td align="left">http://creativecommons.org/licenses/by-sa/2.0/</td>
+      <td align="right">http://openstreetmap.org/</td>
+    </tr>
+    <tr>
+      <td colspan="2" align="center">Licensed under the Creative Commons Attribution-Share Alike 2.0 license by the OpenStreetMap project and its contributors.</td>
+    </tr>
+  </table>
 </div>
 
 <% if params['mlon'] and params['mlat'] %>
index b4ef3f61273c125b1396f65618173e696f47e4de..f739d90532c7a46a5a995a4a7e2d931887caf416 100644 (file)
@@ -1,6 +1,8 @@
 <h1><%= h(@title) %></h1>
 
+<% content_for :head do %>
 <%= auto_discovery_link_tag :atom, :action => 'georss', :display_name => @display_name, :tag => @tag %>
+<% end %>
 
 <p>
   <%= rss_link_to :action => 'georss', :display_name => @display_name, :tag => @tag %>
index 770ad8873d018390d866f6008425a617e12c5184..3c40906ca92bc4e086e15d0e9faa14d3130ded63 100644 (file)
@@ -1,15 +1,13 @@
-<h1>Login:</h1><br />
-Please login or <%= link_to 'create an account', :controller => 'user', :action => 'new' %>.<br />
+<h1>Login</h1>
+
+<p>Please login or <%= link_to 'create an account', :controller => 'user', :action => 'new' %>.</p>
 
 <% form_tag :action => 'login' do %>
 <%= hidden_field_tag('referer', h(params[:referer])) %>
-<br/>
 <table>
-  <tr><td class="fieldName">Email Address or username:</td><td><%= text_field('user', 'email',{:size => 50, :maxlength => 255}) %></td></tr>
+  <tr><td class="fieldName">Email Address or Username:</td><td><%= text_field('user', 'email',{:size => 50, :maxlength => 255}) %></td></tr>
   <tr><td class="fieldName">Password:</td><td><%= password_field('user', 'password',{:size => 28, :maxlength => 255}) %> <span class="minorNote">(<%= link_to 'Lost your password?', :controller => 'user', :action => 'lost_password' %>)</span></td></tr>
   <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
   <tr><td></td><td align="right"><%= submit_tag 'Login' %></td></tr>
 </table>
-
-<br />
 <% end %>
index 1b7f6e9b433bf58b30b9f2fc343f4910b3975699..823dccf520db76dd0a2032bd93ad6f568ed7cb64 100644 (file)
@@ -1,8 +1,28 @@
-<h1>Create a user account</h1><br>
-Fill in the form and we'll send you a quick email to activate your account.
-<br><br>
+<h1>Create a User Account</h1>
 
-By creating an account, you agree that all work uploaded to openstreetmap.org and all data created by use of any tools which connect to openstreetmap.org is to be (non-exclusively) licensed under <a href="http://creativecommons.org/licenses/by-sa/2.0/">this Creative Commons license (by-sa)</a>.<br><br>
+<% if Acl.find_by_address(request.remote_ip, :conditions => {:k => "no_account_creation"}) %>
+
+<p>Unfortunately we are not currently able to create an account for
+   you automatically.
+</p>
+
+<p>Please contact the <a href="mailto:webmaster@openstreetmap.org">webmaster</a>
+   to arrange for an account to be created - we will try and deal with
+   the request as quickly as possible. 
+</p>
+
+<% else %>
+
+<p>Fill in the form and we'll send you a quick email to activate your
+   account.
+</p>
+
+<p>By creating an account, you agree that all work uploaded to
+   openstreetmap.org and all data created by use of any tools which
+   connect to openstreetmap.org is to be (non-exclusively) licensed under
+   <a href="http://creativecommons.org/licenses/by-sa/2.0/">this Creative
+   Commons license (by-sa)</a>.
+</p>
 
 <%= error_messages_for 'user' %>
 
@@ -20,9 +40,6 @@ By creating an account, you agree that all work uploaded to openstreetmap.org an
   <tr><td colspan=2>&nbsp;<!--vertical spacer--></td></tr>
   <tr><td></td><td align=right><input type="submit" value="Signup"></td></tr>
 </table>
-<br>
-<br>
-<!--
-See also <a href="http://wiki.openstreetmap.org/index.php/Creating_an_Account" title="wiki help information about this screen">'Creating an Account' help</a>
--->
+<% end %>
+
 <% end %>
index ffed548bd4360f2715b9a83b82dda5fdc171ebd3..b3481c024434dcaba4fc36584e7e0aca0e7b5666 100644 (file)
@@ -46,7 +46,7 @@ Rails::Initializer.run do |config|
   # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
   # config.gem "aws-s3", :lib => "aws/s3"
   config.gem 'composite_primary_keys', :version => '1.1.0'
-  config.gem 'libxml-ruby', :version => '0.9.4', :lib => 'libxml'
+  config.gem 'libxml-ruby', :version => '>= 1.0.0', :lib => 'libxml'
   config.gem 'rmagick', :lib => 'RMagick'
   config.gem 'mysql'
 
index ae636a9a31039a260539fd2d195fa49e9ce56684..07f79660f8a8b13107a3bc84dd6f41430b960200 100644 (file)
@@ -1,9 +1,5 @@
 # This is required otherwise libxml writes out memory errors to
-# the standard output and exits uncleanly 
-# Changed method due to deprecation of the old register_error_handler
-# http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/Parser.html#M000076
-# So set_handler is used instead
-# http://libxml.rubyforge.org/rdoc/classes/LibXML/XML/Error.html#M000334
+# the standard output and exits uncleanly
 LibXML::XML::Error.set_handler do |message|
   raise message
 end
similarity index 94%
rename from db/migrate/019_populate_node_tags_and_remove.rb
rename to db/migrate/020_populate_node_tags_and_remove.rb
index 8603586463f8b8330583a33bf67d87dd737d5257..dc048f1906134eab74d7f3b7bf35c09d3bfb3e77 100644 (file)
@@ -3,9 +3,9 @@ class PopulateNodeTagsAndRemove < ActiveRecord::Migration
     have_nodes = select_value("SELECT count(*) FROM current_nodes").to_i != 0
 
     if have_nodes
-      prefix = File.join Dir.tmpdir, "019_populate_node_tags_and_remove.#{$$}."
+      prefix = File.join Dir.tmpdir, "020_populate_node_tags_and_remove.#{$$}."
 
-      cmd = "db/migrate/019_populate_node_tags_and_remove_helper"
+      cmd = "db/migrate/020_populate_node_tags_and_remove_helper"
       src = "#{cmd}.c"
       if not File.exists? cmd or File.mtime(cmd) < File.mtime(src) then 
         system 'cc -O3 -Wall `mysql_config --cflags --libs` ' +
index 37de8ea59f043822bff8faa353b88bef2e5ec3bf..217e9309d7329d681141fd3a1115a04b693cc6a0 100644 (file)
@@ -18,7 +18,7 @@ class DiffReader
   # in OsmChange format. All diffs must be limited to a single changeset
   # given in +changeset+.
   def initialize(data, changeset)
-    @reader = XML::Reader.new data
+    @reader = XML::Reader.string(data)
     @changeset = changeset
   end
 
@@ -26,11 +26,12 @@ class DiffReader
   # Reads the next element from the XML document. Checks the return value
   # and throws an exception if an error occurred.
   def read_or_die
-    # NOTE: XML::Reader#read returns 0 for EOF and -1 for error.
-    # we allow an EOF because we are expecting this to always happen
-    # at the end of a document.
-    if @reader.read < 0
-      raise APIBadUserInput.new("Unexpected end of XML document.")
+    # NOTE: XML::Reader#read returns false for EOF and raises an
+    # exception if an error occurs.
+    begin
+      @reader.read
+    rescue LibXML::XML::Error => ex
+      raise OSM::APIBadXMLError.new("changeset", xml, ex.message)
     end
   end
 
index f6646503d0e37e0d68e04efbaf01755be4c6195e..f372979a8d784bf99a49b14746e1753ee7b74927 100644 (file)
@@ -240,7 +240,7 @@ module OSM
   class GeoRSS
     def initialize(feed_title='OpenStreetMap GPS Traces', feed_description='OpenStreetMap GPS Traces', feed_url='http://www.openstreetmap.org/traces/')
       @doc = XML::Document.new
-      @doc.encoding = 'UTF-8' 
+      @doc.encoding = XML::Encoding::UTF_8
 
       rss = XML::Node.new 'rss'
       @doc.root = rss
@@ -326,7 +326,7 @@ module OSM
   class API
     def get_xml_doc
       doc = XML::Document.new
-      doc.encoding = 'UTF-8' 
+      doc.encoding = XML::Encoding::UTF_8
       root = XML::Node.new 'osm'
       root['version'] = API_VERSION
       root['generator'] = GENERATOR
diff --git a/public/images/donate.png b/public/images/donate.png
new file mode 100644 (file)
index 0000000..9cd9a7c
Binary files /dev/null and b/public/images/donate.png differ
index f7cd6923a03565b71f3606de9f2ec6041f48236e..ec6712596659d6cba93c9ede674d6ba26948bdf4 100644 (file)
@@ -1,5 +1,6 @@
 User-agent: *
 Disallow: /api/
+Disallow: /browse/
 Disallow: /trace/
 Disallow: /edit
-Disallow: /login
\ No newline at end of file
+Disallow: /login
index 764d8971b84f0b0d6f5dbd72979d2ac33f516180..87d325ddb0c4437445461ead3816be3d0797c505 100644 (file)
@@ -64,13 +64,14 @@ body {
 }
 
 #intro {
-  width: 150px;
+  width: 170px;
   margin: 10px;
-  padding: 10px;
   border: 1px solid #ccc;
   font-size: 11px;
 }
 
+#intro p { margin: 10px; }
+
 #alert {
   width: 150px;
   margin: 10px;
@@ -82,6 +83,17 @@ body {
   font-size: 14px;
 }
 
+#donate {
+  width: 150px;
+  margin: 10px;
+  padding: 10px;
+  border: 1px solid #ccc;
+  background: #ea0;
+  line-height: 1.2em;
+  text-align: left;
+  font-size: 12px;
+}
+
 .left_menu {
   width: 150px;
   min-width: 150px;
@@ -361,17 +373,9 @@ hr {
   top: 4px;
 }
 
-#cclogo {
-  width: 150px;
-  min-width: 150px;
-  margin: 10px;
-  padding: 10px;
-  left: 0px;
-  line-height: 1.2em;
-  text-align: left;
-  font-size: 14px;
-  font-weight: bold;
-  background: #fff;
+.button {
+  margin-top: 10px;
+  margin-bottom: 10px;
 }
 
 #controls img
index bc9ffa489f1d1673bc297c67c191c6e60e29e708..8d019bf7902fa549ec259b9061f71676dc5dbc49 100644 (file)
@@ -276,8 +276,7 @@ class NodeControllerTest < ActionController::TestCase
   ##
   # parse some xml
   def xml_parse(xml)
-    parser = XML::Parser.new
-    parser.string = xml
+    parser = XML::Parser.string(xml)
     parser.parse
   end
 end
index 4ace316a4e96ab479abf152b9a669d1e4fa13d5f..f52981233371097a9cd3ad94a1a25f592b5c5405 100644 (file)
@@ -540,8 +540,7 @@ OSM
   ##
   # parse some xml
   def xml_parse(xml)
-    parser = XML::Parser.new
-    parser.string = xml
+    parser = XML::Parser.string(xml)
     parser.parse
   end
 end