From: Tom Hughes Date: Sun, 20 Apr 2008 12:29:50 +0000 (+0000) Subject: Tidy up a few details. X-Git-Tag: live~8263^2~50 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/0c480e05f0f11c881c5c0f2d47cc5c3328a4a3a4 Tidy up a few details. --- diff --git a/app/controllers/browse_controller.rb b/app/controllers/browse_controller.rb index dcc4cd3f3..c35bb821a 100644 --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@ -1,32 +1,32 @@ class BrowseController < ApplicationController before_filter :authorize_web layout 'site' + def way_view begin - way = Way.find(params[:id]) + @way = Way.find(params[:id]) - @way = way @name = @way.tags['name'].to_s if @name.length == 0: @name = "#" + @way.id.to_s - end + end + @title = 'Way | ' + (@name) - rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end end + def node_view begin - node = Node.find(params[:id]) + @node = Node.find(params[:id]) - @node = node @name = @node.tags_as_hash['name'].to_s if @name.length == 0: @name = "#" + @node.id.to_s - end + end + @title = 'Node | ' + (@name) - rescue ActiveRecord::RecordNotFound render :nothing => true, :status => :not_found end diff --git a/app/views/browse/_common.rhtml b/app/views/browse/_common.rhtml index 70b96590b..d400405c3 100644 --- a/app/views/browse/_common.rhtml +++ b/app/views/browse/_common.rhtml @@ -3,7 +3,7 @@
  • <%= link_to h("API"), :controller => "api/#{API_VERSION}/"+type, :id => obj.id %>
  • <%= link_to h("History"), :controller => "api/#{API_VERSION}/"+type, :id => obj.id, :action => "history" %>
  • -Last edited: <%= h(obj.timestamp) %><% if obj.user.data_public %>, - by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %> +Last edited: <%= h(obj.timestamp) %> +<% if obj.user.data_public %> +by <%= link_to h(obj.user.display_name), :controller => 'user', :action => 'view' , :display_name => obj.user.display_name %> <% end %> - diff --git a/app/views/browse/_map.rhtml b/app/views/browse/_map.rhtml index 3128108d9..a90a3fffd 100644 --- a/app/views/browse/_map.rhtml +++ b/app/views/browse/_map.rhtml @@ -16,8 +16,8 @@ var osm_layer = new OpenLayers.Layer.GML("OSM", url, {format: OpenLayers.Format.OSM, projection: new OpenLayers.Projection("EPSG:4326")}); osm_layer.events.register("loadend", osm_layer, function() { $("loading").innerHTML = ""; - this.map.zoomToExtent( this.features[0].geometry.getBounds()); - var center = map.getCenter().clone().transform(this.map.getProjectionObject(), new OpenLayers.Projection("EPSG:4326")); + this.map.zoomToExtent(this.features[0].geometry.getBounds()); + var center = getMapCenter(); $("larger_map").href = '/?lat='+center.lat+'&lon='+center.lon+'&zoom='+this.map.getZoom(); $("larger_map").innerHTML = "View Larger Map"; })