]> git.openstreetmap.org Git - rails.git/commitdiff
Merge branch 'master' into overpass
authorTom Hughes <tom@compton.nu>
Sun, 15 Jun 2014 13:54:39 +0000 (14:54 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 15 Jun 2014 13:54:39 +0000 (14:54 +0100)
1  2 
app/assets/javascripts/index.js
app/assets/stylesheets/common.css.scss
config/locales/en.yml
config/routes.rb

index 54ccb88ed08a277b8079cd74b7b3ed6476171c72,cfee031fd47086d2c530da7a0e12bd6245a2e8cb..236ed44fc190de0410a0145fb0cfddd6d1b6ad13
@@@ -5,7 -5,6 +5,7 @@@
  //= require leaflet.key
  //= require leaflet.note
  //= require leaflet.share
 +//= require leaflet.query
  //= require index/search
  //= require index/browse
  //= require index/export
@@@ -13,7 -12,6 +13,7 @@@
  //= require index/history
  //= require index/note
  //= require index/new_note
 +//= require index/query
  //= require router
  
  (function() {
@@@ -125,11 -123,6 +125,11 @@@ $(document).ready(function () 
      sidebar: sidebar
    }).addTo(map);
  
 +  L.OSM.query({
 +    position: position,
 +    sidebar: sidebar
 +  }).addTo(map);
 +
    L.control.scale()
      .addTo(map);
  
      "/node/:id(/history)":         OSM.Browse(map, 'node'),
      "/way/:id(/history)":          OSM.Browse(map, 'way'),
      "/relation/:id(/history)":     OSM.Browse(map, 'relation'),
 -    "/changeset/:id":              OSM.Browse(map, 'changeset')
 +    "/changeset/:id":              OSM.Browse(map, 'changeset'),
 +    "/query":                      OSM.Query(map)
    });
  
    if (OSM.preferred_editor == "remote" && document.location.pathname == "/edit") {
  
    $(".describe_location").on("click", function(e) {
      e.preventDefault();
-     var precision = OSM.zoomPrecision(map.getZoom());
+     var center = map.getCenter().wrap(),
+       precision = OSM.zoomPrecision(map.getZoom());
      OSM.router.route("/search?query=" + encodeURIComponent(
-       map.getCenter().lat.toFixed(precision) + "," +
-       map.getCenter().lng.toFixed(precision)));
+       center.lat.toFixed(precision) + "," + center.lng.toFixed(precision)
+     ));
    });
  });
index 9e614f906022a2518e20724319ca7e42244e6c97,7c400b4f3c4b9f1c07bdcd13a73503f5c6ace706..d3268f43b511ffad0c35706971fce2d8ea2cdc0a
@@@ -171,7 -171,7 +171,7 @@@ small, aside 
  .icon.close:hover { background-position: -200px -20px; }
  .icon.check       { background-position: -220px 0; }
  .icon.note        { background-position: -240px 0; }
 -.icon.gear        { background-position: -260px 0; }
 +.icon.query       { background-position: -260px 0; }
  
  /* Rules for links */
  
@@@ -683,14 -683,6 +683,14 @@@ nav.secondary 
    #map {
      height: 100%;
      overflow: hidden;
 +
 +    &.query-active {
 +      cursor: help;
 +    }
 +
 +    &.query-disabled {
 +      cursor: not-allowed;
 +    }
    }
  
    #map-ui {
@@@ -977,7 -969,9 +977,9 @@@ header .search_form 
  .search_results_entry {
    ul li {
      border-bottom: $keyline;
+     cursor: pointer;
      &:first-child { border-top: $keyline; }
+     &.selected { background: #FFFFE6; }
    }
  
    .search_details {
      overflow: hidden;
      margin: 0 0 10px 10px;
    }
 +
 +  .query-intro p {
 +    padding: $lineheight $lineheight $lineheight/2;
 +  }
 +
 +  .query-results {
 +    display: none;
 +
 +    h3 {
 +      padding: $lineheight $lineheight $lineheight/2;
 +      margin: 0;
 +    }
 +
 +    ul {
 +      li {
 +        padding: 15px 20px;
 +        border-bottom: 1px solid #ddd;
 +
 +        &.query-result {
 +          cursor: pointer;
 +        }
 +
 +        &.selected {
 +          background: #FFFFE6;
 +        }
 +
 +        a {
 +          color: #000;
 +        }
 +      }
 +    }
 +  }
  }
  
  /* Rules for export sidebar */
@@@ -2439,13 -2401,6 +2441,6 @@@ input.richtext_title[type="text"] 
    background-size: cover;
    background-attachment: fixed;
  
-   &.photo-0 { background-image: image-url('about/0.jpg'); .photo-0 { display: block; } }
-   &.photo-1 { background-image: image-url('about/1.jpg'); .photo-1 { display: block; } }
-   &.photo-2 { background-image: image-url('about/2.jpg'); .photo-2 { display: block; } }
-   &.photo-3 { background-image: image-url('about/4.jpg'); .photo-3 { display: block; } }
-   &.photo-4 { background-image: image-url('about/4.jpg'); .photo-4 { display: block; } }
-   &.photo-5 { background-image: image-url('about/5.jpg'); .photo-5 { display: block; } }
    .caption {
      max-width: 200px;
      font: 13px/20px Helvetica, Arial, sans-serif;
diff --combined config/locales/en.yml
index 3e452571bbdbbc4425737feb4ea2937d9fa9aba9,fe5f58d512cd55d4c4996a68d7421c503c6cbedb..eb2991d4e1c96792c71b5060dadb493a514e9fc4
@@@ -79,7 -79,7 +79,7 @@@ en
    printable_name:
      with_id: "%{id}"
      with_version: "%{id}, v%{version}"
-     with_name: "%{name} (%{id})"
+     with_name_html: "%{name} (%{id})"
    editor:
      default: "Default (currently %{name})"
      potlatch:
          key: "The wiki description page for the %{key} tag"
          tag: "The wiki description page for the %{key}=%{value} tag"
        wikipedia_link: "The %{page} article on Wikipedia"
+       telephone_link: "Call %{phone_number}"
      note:
        title: "Note: %{id}"
        new_note: "New Note"
        reopened_by: "Reactivated by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
        reopened_by_anonymous: "Reactivated by anonymous <abbr title='%{exact_time}'>%{when} ago</abbr>"
        hidden_by: "Hidden by %{user} <abbr title='%{exact_time}'>%{when} ago</abbr>"
 +    query:
 +      title: "Query Features"
 +      introduction: "Click on the map to find nearby features."
 +      nearby: "Nearby features"
 +      enclosing: "Enclosing features"
    changeset:
      changeset_paging_nav:
        showing_page: "Page %{page}"
            primary_link: "Primary Road"
            proposed: "Proposed Road"
            raceway: "Raceway"
 -          residential: "Residential"
 +          residential: "Residential Road"
            rest_area: "Rest Area"
            road: "Road"
            secondary: "Secondary Road"
            tram: "Tramway"
            tram_stop: "Tram Stop"
            yard: "Railway Yard"
 +        route:
 +          bus: "Bus Route"
          shop:
            alcohol: "Off License"
            antiques: "Antiques"
        createnote_disabled_tooltip: Zoom in to add a note to the map
        map_notes_zoom_in_tooltip: Zoom in to see map notes
        map_data_zoom_in_tooltip: Zoom in to see map data
 +      queryfeature_tooltip: Query features
 +      queryfeature_disabled_tooltip: Zoom in to query features
      notes:
        new:
-         intro: "Spotted a mistake or something missing? Let other mappers know so we can fix it. Move the marker to the correct position and type a note to explain the problem. (Please don't enter personal information here.)"
+         intro: "Spotted a mistake or something missing? Let other mappers know so we can fix it. Move the marker to the correct position and type a note to explain the problem. (Please don't enter personal information or information from copyrighted maps or directory listings.)"
          add: Add Note
        show:
          anonymous_warning: This note includes comments from anonymous users which should be independently verified.
          comment_and_resolve: Comment & Resolve
          comment: Comment
      edit_help: Move the map and zoom in on a location you want to edit, then click here.
 +    query:
 +      node: Node
 +      way: Way
 +      relation: Relation
 +      nothing_found: No features found
 +      error: "Error contacting %{server}: %{error}"
 +      timeout: "Timeout contacting %{server}"
    redaction:
      edit:
        description: "Description"
diff --combined config/routes.rb
index e03c5d632110ba225e340a48feb5a4a00c490c67,3357f911dd599ca2a408e28f0cb6f79c22cbf2e0..9af0c1099118c67f0f2f2918b8c5777c03cba291
@@@ -150,7 -150,6 +150,7 @@@ OpenStreetMap::Application.routes.draw 
    match '/offline' => 'site#offline', :via => :get
    match '/key' => 'site#key', :via => :get
    match '/id' => 'site#id', :via => :get
 +  match '/query' => 'browse#query', :via => :get
    match '/user/new' => 'user#new', :via => :get
    match '/user/new' => 'user#create', :via => :post
    match '/user/terms' => 'user#terms', :via => :get
    match '/traces/mine/page/:page' => 'trace#mine', :via => :get
    match '/traces/mine' => 'trace#mine', :via => :get
    match '/trace/create' => 'trace#create', :via => [:get, :post]
-   match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/
+   match '/trace/:id/data' => 'trace#data', :via => :get, :id => /\d+/, :as => "trace_data"
    match '/trace/:id/edit' => 'trace#edit', :via => [:get, :post, :patch], :id => /\d+/, :as => "trace_edit"
    match '/trace/:id/delete' => 'trace#delete', :via => :post, :id => /\d+/