From: Tom Hughes Date: Sun, 14 Oct 2012 14:58:40 +0000 (+0100) Subject: Fix up issues with notes in the data browser X-Git-Tag: live~5052^2~80 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/c6be5f3a6f5773455b1f289caefdbe414dbdf7ad?hp=5cb9f2b022ba1c829ae5f4d980f27c7aad694ff6;ds=inline Fix up issues with notes in the data browser --- diff --git a/app/assets/javascripts/browse.js b/app/assets/javascripts/browse.js index 08b355991..906bb0bae 100644 --- a/app/assets/javascripts/browse.js +++ b/app/assets/javascripts/browse.js @@ -47,7 +47,7 @@ $(document).ready(function () { setMapCenter(centre, 16); addMarkerToMap(centre); - var bbox = getMapExtent(); + var bbox = unproj(map.getExtent()); $("#loading").hide(); $("#browse_map .geolink").show(); diff --git a/app/views/browse/_map.html.erb b/app/views/browse/_map.html.erb index 8c28644b1..f694d0464 100644 --- a/app/views/browse/_map.html.erb +++ b/app/views/browse/_map.html.erb @@ -2,7 +2,7 @@
- <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %> + <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible? %> <% content_for :head do %> <%= javascript_include_tag "browse" %> @@ -23,7 +23,7 @@ data = { :type => "note", :lon => map.lon, - :lon => map.lat + :lat => map.lat } else data = { @@ -39,7 +39,7 @@ <% if map.instance_of? Note -%> <%= link_to t("browse.map.larger.area"), - root_path(:note => "yes"), + root_path(:notes => "yes"), :id => "area_larger_map", :class => "geolink bbox" %> <% else -%> diff --git a/app/views/browse/note.html.erb b/app/views/browse/note.html.erb index 59c96c4aa..4137c33c1 100644 --- a/app/views/browse/note.html.erb +++ b/app/views/browse/note.html.erb @@ -11,18 +11,18 @@ <%= t "browse.note.opened" %> - <%= t "browse.note.at_by", :when => friendly_date(@note.created_at), :user => note_author(@note) %> + <%= t "browse.note.at_by_html", :when => friendly_date(@note.created_at), :user => note_author(@note) %> <% if @note.status == "closed" %> <%= t "browse.note.closed" %> - <%= t "browse.note.at_by", :when => friendly_date(@note.closed_at), :user => note_author(@note.comments.last) %> + <%= t "browse.note.at_by_html", :when => friendly_date(@note.closed_at), :user => note_author(@note.comments.last) %> <% elsif @note.comments.length > 1 %> <%= t "browse.note.last_modified" %> - <%= t "browse.note.at_by", :when => friendly_date(@note.updated_at), :user => note_author(@note.comments.last) %> + <%= t "browse.note.at_by_html", :when => friendly_date(@note.updated_at), :user => note_author(@note.comments.last) %> <% end %> @@ -33,7 +33,7 @@ <%= t "browse.node_details.coordinates" %> -
<%= link_to ("#{number_with_delimiter(@note.lat)}, #{number_with_delimiter(@note.lon)}"), {:controller => 'site', :action => 'index', :lat => h(@note.lat), :lon => h(@note.lon), :zoom => "18"} %>
+
<%= link_to ("#{number_with_delimiter(@note.lat)}, #{number_with_delimiter(@note.lon)}".html_safe), {:controller => 'site', :action => 'index', :lat => h(@note.lat), :lon => h(@note.lon), :zoom => "18"} %>
<% if @note.comments.length > 1 %> @@ -46,7 +46,7 @@ <%= h(comment.body) %>
- <%= t "browse.note.at_by", :when => friendly_date(comment.created_at), :user => note_author(comment) %> + <%= t "browse.note.at_by_html", :when => friendly_date(comment.created_at), :user => note_author(comment) %> <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 38f6757ae..bacf8a4e6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -291,7 +291,7 @@ en: opened: "Opened:" last_modified: "Last modified:" closed: "Closed:" - at_by: "%{when} ago by %{user}" + at_by_html: "%{when} ago by %{user}" description: "Description:" comments: "Comments:" changeset: