]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into openstreetbugs
authorTom Hughes <tom@compton.nu>
Sun, 17 Oct 2010 10:02:11 +0000 (11:02 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 17 Oct 2010 10:02:11 +0000 (11:02 +0100)
Conflicts:
app/views/site/index.html.erb

1  2 
app/views/site/index.html.erb
config/locales/en.yml
config/routes.rb

index fc1e1ec5cba597128c72ccebd3fdc6ed041e07c7,a89212238a26e7706b18a3239b711b284a700abe..305df63c0fd3212a4c1e0d4cbd9f7b6e6e04d668
  </noscript>
  
  <div id="map">
-   <div id="permalink">
-     <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
-     <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a><br/>
-       <a id="ReportBug">Report a problem</a>  
-   </div>
- </div> 
+ </div>
+ <div id="permalink">
+   <a href="/" id="permalinkanchor"><%= t 'site.index.permalink' %></a><br/>
 -  <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
++  <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a><br/>
++  <a href="/" id="ReportBug">Report a problem</a>     
+ </div>
  
  <div id="attribution">
    <table width="100%">
@@@ -41,7 -41,7 +42,7 @@@
  </div>
  
  <%
- if params['mlon'] and params['mlat'] 
+ if params['mlon'] and params['mlat']
      marker = true
      mlon = h(params['mlon'])
      mlat = h(params['mlat'])
@@@ -69,7 -69,7 +70,7 @@@ if params['minlon'] and params['minlat'
      minlat = h(params['minlat'])
      maxlon = h(params['maxlon'])
      maxlat = h(params['maxlat'])
-     box = true if params['box']=="yes" 
+     box = true if params['box']=="yes"
      object_zoom = false
  end
  
@@@ -81,14 -81,14 +82,14 @@@ if params['lon'] and params['lat'
      layers = h(params['layers'])
      object_zoom = false
  elsif params['mlon'] and params['mlat']
-     lon = h(params['mlon']) 
+     lon = h(params['mlon'])
      lat = h(params['mlat'])
      zoom =  h(params['zoom'] || '12')
      layers = h(params['layers'])
      object_zoom = false
  elsif cookies.key?("_osm_location")
      lon,lat,zoom,layers = cookies["_osm_location"].split("|")
- elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil? 
+ elsif @user and !@user.home_lon.nil? and !@user.home_lat.nil?
      lon =  @user.home_lon
      lat =  @user.home_lat
      zoom = '10'
@@@ -102,20 -102,17 +103,20 @@@ els
          maxlon = session[:location][:maxlon]
          maxlat = session[:location][:maxlat]
      else
-         lon =  '-0.1' 
-         lat =  '51.5' 
-         zoom =  h(params['zoom'] || '5') 
+         lon =  '-0.1'
+         lat =  '51.5'
+         zoom =  h(params['zoom'] || '5')
      end
  
-     layers = h(params['layers']) 
+     layers = h(params['layers'])
  end
  %>
  
 -<%= javascript_include_tag '/openlayers/OpenLayers.js' %>
 +<!--Use stock OpenLayers for now, as the OSM one is missing some needed classes-->
 +<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
 +<!-- < %= javascript_include_tag '/openlayers/OpenLayers.js' % > -->
  <%= javascript_include_tag '/openlayers/OpenStreetMap.js' %>
 +<%= javascript_include_tag 'openstreetbugs.js' %>
  <%= javascript_include_tag 'map.js' %>
  
  <script type="text/javascript" defer="defer">
  
    OpenLayers.Lang.setCode("<%= I18n.locale.to_s %>");
  
 +  function createBugCallBack() {
 +      map.osbControl.deactivate();
 +      document.getElementById("map_OpenLayers_Container").style.cursor = "default";
 +  }
 +
    function mapInit(){
      map = createMap("map");
  
        map.dataLayer = new OpenLayers.Layer("<%= I18n.t 'browse.start_rjs.data_layer_name' %>", { "visibility": false });
        map.dataLayer.events.register("visibilitychanged", map.dataLayer, toggleData);
        map.addLayer(map.dataLayer);
 +
 +      map.osbLayer = new OpenLayers.Layer.OpenStreetBugs("OpenStreetBugs", {
 +          serverURL : "/api/0.6/",
 +          iconOpen : new OpenLayers.Icon("http://openstreetbugs.schokokeks.org/client/open_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
 +          iconClosed : new OpenLayers.Icon("http://openstreetbugs.schokokeks.org/client/closed_bug_marker.png", new OpenLayers.Size(22, 22), new OpenLayers.Pixel(-11, -11)),
 +          readonly : false,
 +          setCookie : false,
 +          cookieLifetime : 1000, 
 +          cookiePath : "/my/map/", 
 +          permalinkURL : "http://www.openstreetmap.org/", 
 +          theme : "http://osm.cdauth.de/map/openstreetbugs.css" 
 +      });
 +
 +      map.addLayer(map.osbLayer);
 +
 +      map.osbControl = new OpenLayers.Control.OpenStreetBugs(map.osbLayer); 
 +      map.addControl(map.osbControl);
 +              
 +        var lBug = document.getElementById('ReportBug');
 +      lBug.addEventListener('click',function (e) {
 +              map.osbControl.activate(); document.getElementById("map_OpenLayers_Container").style.cursor = "crosshair"; if (e.stopPropagation) e.stopPropagation(); },false);
 +
 +
      <% end %>
  
      <% unless object_zoom %>
  
      updatelinks(lonlat.lon, lonlat.lat, zoom, layers, extents.left, extents.bottom, extents.right, extents.top, objtype, objid);
  
-     expiry.setYear(expiry.getFullYear() + 10); 
+     expiry.setYear(expiry.getFullYear() + 10);
      document.cookie = "_osm_location=" + lonlat.lon + "|" + lonlat.lat + "|" + zoom + "|" + layers + "; expires=" + expiry.toGMTString();
    }
  
      content.style.width = document.documentElement.clientWidth - content.offsetLeft - rightMargin;
      content.style.height = document.documentElement.clientHeight - content.offsetTop - bottomMargin;
    }
-   
    function resizeMap() {
      var centre = map.getCenter();
      var zoom = map.getZoom();
  
      resizeMap();
    }
-   
    mapInit();
  
    window.onload = handleResize;
diff --combined config/locales/en.yml
index 8e091a22cd0c2ead45946fdb86bc7a49c3707b3b,deef86307f1d597f0287fdfe92c56ec4b9e6eda5..8d2a64564834cd0c8427040c2ebb79e75f7daa6a
@@@ -262,17 -262,6 +262,17 @@@ en
        download_xml: "Download XML"
        view_history: "view history"
        edit: "edit"
 +    bug:
 +      open_title: "Unresolved issue: {{bug_name}}"
 +      closed_title: "Resolved issue: {{bug_name}}"
 +      created_at: "Created at:"
 +      edited_at: "Edited at:"
 +      closed_at: "Closed at:"
 +      opened_by: "Opened by:"
 +      description: "Description:"
 +      comment_by: "Comment by: "
 +      comment: "Comment:"
 +      date: "Date:"
    changeset:
      changeset_paging_nav:
        showing_page: "Showing page {{page}}"
      osm_read_only: "The OpenStreetMap database is currently in read-only mode while essential database maintenance work is carried out."
      donate: "Support OpenStreetMap by {{link}} to the Hardware Upgrade Fund."
      donate_link_text: donating
-     help_wiki: "Help &amp; Wiki"
-     help_wiki_tooltip: "Help &amp; Wiki site for the project"
-     help_wiki_url: "http://wiki.openstreetmap.org"
+     help_and_wiki: "{{help}} & {{wiki}}"
+     help: Help
+     help_url: http://help.openstreetmap.org/
+     help_title: Help site for the project
+     wiki: Wiki
+     wiki_url: http://wiki.openstreetmap.org/
+     wiki_title: Wiki site for the project
      copyright: "Copyright &amp; License"
      news_blog: "News blog"
      news_blog_tooltip: "News blog about OpenStreetMap, free geographical data, etc."
        the_wiki_url: "http://wiki.openstreetmap.org/wiki/Beginners%27_Guide"
        blog_and_twitter: "Catch up with the latest news via the OpenStreetMap blog or Twitter:"
        opengeodata: "OpenGeoData.org is OpenStreetMap founder Steve Coast's blog, and it has podcasts too:"
+       ask_questions: "You can ask any questions you may have about OpenStreetMap at our question and answer site:"
        wiki_signup: "You may also want to sign up to the OpenStreetMap wiki at:"
        wiki_signup_url: "http://wiki.openstreetmap.org/index.php?title=Special:Userlogin&type=signup&returnto=Main_Page"
        # next four translations are in pairs : please word wrap appropriately
        more_videos: "There are {{more_videos_link}}."
        more_videos_here: "more videos here"
        get_reading: Get reading about OpenStreetMap <a href="http://wiki.openstreetmap.org/wiki/Beginners%27_Guide">on the wiki</a>, catch up with the latest news via the <a href="http://blog.openstreetmap.org/">OpenStreetMap blog</a> or <a href="http://twitter.com/openstreetmap">Twitter</a>, or browse through OpenStreetMap founder Steve Coast's <a href="http://www.opengeodata.org/">OpenGeoData blog</a> for the potted history of the project, which has <a href="http://www.opengeodata.org/?cat=13">podcasts to listen to</a> also!
+       ask_questions: You can ask any questions you may have about OpenStreetMap at our <a href="http://help.openstreetmap.org/">question and answer site</a>.
        wiki_signup: '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>.'
        user_wiki_page: '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/wiki/Category:Users_in_London">[[Category:Users_in_London]]</a>.'
        current_user: 'A list of current users in categories, based on where in the world they are, is available from <a href="http://wiki.openstreetmap.org/wiki/Category:Users_by_geographical_region">Category:Users_by_geographical_region</a>.'
        search_help: "examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ', or 'post offices near Lünen' <a href='http://wiki.openstreetmap.org/wiki/Search'>more examples...</a>"
      key:
        map_key: "Map key"
-       map_key_tooltip: "Map key for the mapnik rendering at this zoom level"
+       map_key_tooltip: "Key for the map"
        table:
-         heading: "Legend for z{{zoom_level}}"
          entry:
            motorway: "Motorway"
            trunk: "Trunk road"
        remember: "Remember me:"
        lost password link: "Lost your password?"
        login_button: "Login"
-       account not active: "Sorry, your account is not active yet.<br />Please click on the link in the account confirmation email to activate your account."
+       account not active: "Sorry, your account is not active yet.<br />Please use the link in the account confirmation email to activate your account, or <a href=\"{{reconfirm}}\">request a new confirmation email</a>."
        account suspended: Sorry, your account has been suspended due to suspicious activity.<br />Please contact the {{webmaster}} if you wish to discuss this.
        webmaster: webmaster
        auth failure: "Sorry, could not log in with those details."
        password: "Password:"
        confirm password: "Confirm Password:"
        continue: Continue
-       flash create success message: "User was successfully created. Check your email for a confirmation note, and you will be mapping in no time :-)<br /><br />Please note that you will not be able to login until you've received and confirmed your email address.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
+       flash create success message: "Thanks for signing up. We've sent a confirmation note to {{email}} and as soon as you confirm your account you'll be able to get mapping.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
        terms accepted: "Thanks for accepting the new contributor terms!"
      terms:
        title: "Contributor terms"
        press confirm button: "Press the confirm button below to activate your account."
        button: Confirm
        success: "Confirmed your account, thanks for signing up!"
-       failure: "A user account with this token has already been confirmed."
+       before you start: "We know you're probably in a hurry to start mapping, but before you do you might like to fill in some more information about yourself in the form below."
+       already active: "This account has already been confirmed."
+       unknown token: "That token doesn't seem to exist."
+       reconfirm: "If it's been a while since you signed up you might need to <a href=\"{{reconfirm}}\">send yourself a new confirmation email</a>."
+     confirm_resend:
+       success: "We've sent a new confirmation note to {{email}} and as soon as you confirm your account you'll be able to get mapping.<br /><br />If you use an antispam system which sends confirmation requests then please make sure you whitelist webmaster@openstreetmap.org as we are unable to reply to any confirmation requests."
+       failure: "User {{name}} not found."
      confirm_email:
        heading: Confirm a change of email address
        press confirm button: "Press the confirm button below to confirm your new email address."
        back: "View all blocks"
        revoker: "Revoker:"
        needs_view: "The user needs to log in before this block will be cleared."
 +  bugs:
 +    rss:
 +      description_area: "A list of bugs, reported, commented on or closed in your area [({{min_lat}}|{{min_lon}}) -- ({{max_lat}}|{{max_lon}})]"
 +      description_item: "An rss feed for bug {{id}}"
 +      closed: "closed bug (near {{place}})"
 +      new: "new bug (near {{place}})"
 +      comment: "new comment (near {{place}})"
 +    user:
 +      title_user: "Bugs submitted or commented on by {{user}}"
 +      heading_user: "{{user}}'s bugs"
 +      description_user: "Bugs submitted or commented on by {{user}}"
 +      id: "Id"
 +      last_changed: "Last changed"
 +
    javascripts:
      map:
        base:
diff --combined config/routes.rb
index 3cd95c983426b40df822f6910367f4e49049f9c5,56a59a207d7a52ef57f5b649cae6fafe22103d58..e648f2a198c7a49da7e7590d723d0d4d32fb2940
@@@ -62,36 -62,18 +62,39 @@@ ActionController::Routing::Routes.draw 
    map.connect "api/#{API_VERSION}/user/gpx_files", :controller => 'user', :action => 'api_gpx_files'
   
    map.connect "api/#{API_VERSION}/gpx/create", :controller => 'trace', :action => 'api_create'
-   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_details'
-   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data'
-   map.connect "api/#{API_VERSION}/gpx/:id/data.:format", :controller => 'trace', :action => 'api_data'
+   map.connect "api/#{API_VERSION}/gpx/:id", :controller => 'trace', :action => 'api_read', :id => /\d+/, :conditions => { :method => :get }
+   map.connect "api/#{API_VERSION}/gpx/:id", :controller => 'trace', :action => 'api_update', :id => /\d+/, :conditions => { :method => :put }
+   map.connect "api/#{API_VERSION}/gpx/:id", :controller => 'trace', :action => 'api_delete', :id => /\d+/, :conditions => { :method => :delete }
+   map.connect "api/#{API_VERSION}/gpx/:id/details", :controller => 'trace', :action => 'api_read', :id => /\d+/
+   map.connect "api/#{API_VERSION}/gpx/:id/data", :controller => 'trace', :action => 'api_data', :id => /\d+/
+   map.connect "api/#{API_VERSION}/gpx/:id/data.:format", :controller => 'trace', :action => 'api_data', :id => /\d+/
    
    # AMF (ActionScript) API
    
    map.connect "api/#{API_VERSION}/amf/read", :controller =>'amf', :action =>'amf_read'
    map.connect "api/#{API_VERSION}/amf/write", :controller =>'amf', :action =>'amf_write'
    map.connect "api/#{API_VERSION}/swf/trackpoints", :controller =>'swf', :action =>'trackpoints'
 +
 +  # Map Bugs API  
 +  map.connect "api/#{API_VERSION}/bugs/getBugs", :controller =>'map_bugs', :action =>'get_bugs'
 +  map.connect "api/#{API_VERSION}/bugs/addPOIexec", :controller =>'map_bugs', :action =>'add_bug'
 +  map.connect "api/#{API_VERSION}/bugs/closePOIexec", :controller =>'map_bugs', :action =>'close_bug'
 +  map.connect "api/#{API_VERSION}/bugs/editPOIexec", :controller =>'map_bugs', :action =>'edit_bug'
 +  map.connect "api/#{API_VERSION}/bugs/getGPX", :controller =>'map_bugs', :action =>'gpx_bugs'
 +  map.connect "api/#{API_VERSION}/bugs/getRSSfeed", :controller =>'map_bugs', :action =>'rss'
 +
 +  map.connect "api/#{API_VERSION}/bugs", :controller => 'map_bugs', :action => 'get_bugs'
 +  map.connect "api/#{API_VERSION}/bugs/search", :controller => 'map_bugs', :action => 'search'
 +  map.connect "api/#{API_VERSION}/bugs/rss", :controller =>'map_bugs', :action =>'rss'
 +  map.connect "api/#{API_VERSION}/bug/create", :controller => 'map_bugs', :action => 'add_bug'
 +  map.connect "api/#{API_VERSION}/bug/:id/comment", :controller => 'map_bugs', :action => 'edit_bug', :id => /\d+/
 +  map.connect "api/#{API_VERSION}/bug/:id/close", :controller => 'map_bugs', :action => 'close_bug', :id => /\d+/
 +  map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'read', :id => /\d+/, :conditions => { :method => :get }
 +  map.connect "api/#{API_VERSION}/bug/:id", :controller => 'map_bugs', :action => 'delete', :id => /\d+/, :conditions => { :method => :delete }
 +
 +  map.connect '/user/:display_name/bugs', :controller => 'map_bugs', :action => 'my_bugs'
 +  
 +
    
    # Data browsing
    map.connect '/browse/start', :controller => 'browse', :action => 'start'
    map.connect '/user/:display_name/edits', :controller => 'changeset', :action => 'list'
    map.connect '/browse/changesets/feed', :controller => 'changeset', :action => 'list', :format => :atom
    map.connect '/browse/changesets', :controller => 'changeset', :action => 'list'
 +  map.connect '/browse/bug/:id', :controller => 'browse', :action => 'bug', :id => /\d+/
    map.connect '/browse', :controller => 'changeset', :action => 'list'
  
    # web site
    map.connect '/user/new', :controller => 'user', :action => 'new'
    map.connect '/user/terms', :controller => 'user', :action => 'terms'
    map.connect '/user/save', :controller => 'user', :action => 'save'
+   map.connect '/user/:display_name/confirm/resend', :controller => 'user', :action => 'confirm_resend'
+   map.connect '/user/:display_name/confirm', :controller => 'user', :action => 'confirm'
    map.connect '/user/confirm', :controller => 'user', :action => 'confirm'
    map.connect '/user/confirm-email', :controller => 'user', :action => 'confirm_email'
    map.connect '/user/go_public', :controller => 'user', :action => 'go_public'
    map.connect '/index.html', :controller => 'site', :action => 'index'
    map.connect '/edit.html', :controller => 'site', :action => 'edit'
    map.connect '/export.html', :controller => 'site', :action => 'export'
-   map.connect '/search.html', :controller => 'way_tag', :action => 'search'
    map.connect '/login.html', :controller => 'user', :action => 'login'
    map.connect '/logout.html', :controller => 'user', :action => 'logout'
    map.connect '/create-account.html', :controller => 'user', :action => 'new'