From: Tom Hughes Date: Wed, 20 Apr 2011 18:23:39 +0000 (+0100) Subject: Merge branch 'master' into openstreetbugs X-Git-Tag: live~5125^2~184^2~3 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8980da4381923d8099a11a1334baf3c3e625a484?hp=-c Merge branch 'master' into openstreetbugs --- 8980da4381923d8099a11a1334baf3c3e625a484 diff --combined app/controllers/browse_controller.rb index 2962c6836,a7dd5f5c9..f6bd89d4d --- a/app/controllers/browse_controller.rb +++ b/app/controllers/browse_controller.rb @@@ -72,18 -72,11 +72,20 @@@ class BrowseController < ApplicationCon @next = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id", { :id => @changeset.id }] ) @prev = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id", { :id => @changeset.id }] ) - @next_by_user = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] ) - @prev_by_user = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id AND user_id = :user_id", {:id => @changeset.id, :user_id => @changeset.user_id }] ) + if @changeset.user.data_public? + @next_by_user = Changeset.find(:first, :order => "id ASC", :conditions => [ "id > :id AND user_id = :user_id", { :id => @changeset.id, :user_id => @changeset.user_id }] ) + @prev_by_user = Changeset.find(:first, :order => "id DESC", :conditions => [ "id < :id AND user_id = :user_id", { :id => @changeset.id, :user_id => @changeset.user_id }] ) + end rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end + + def bug + @type = "bug" + @bug = MapBug.find(params[:id]) + @next = MapBug.find(:first, :order => "id ASC", :conditions => [ "status != 'hidden' AND id > :id", { :id => @bug.id }] ) + @prev = MapBug.find(:first, :order => "id DESC", :conditions => [ "status != 'hidden' AND id < :id", { :id => @bug.id }] ) + rescue ActiveRecord::RecordNotFound + render :action => "not_found", :status => :not_found + end end diff --combined app/views/browse/_map.html.erb index 0b7f76f23,13a352820..2e20f07f3 --- a/app/views/browse/_map.html.erb +++ b/app/views/browse/_map.html.erb @@@ -2,7 -2,7 +2,7 @@@ <%= javascript_include_tag '/openlayers/OpenStreetMap.js' %> <%= javascript_include_tag 'map.js' %>
- <% if map.instance_of? Changeset or map.visible %> + <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %>
<%= t 'browse.map.loading' %> @@@ -15,7 -15,7 +15,7 @@@ <%= t 'browse.map.deleted' %> <% end %>
- <% if map.instance_of? Changeset or map.visible %> + <% if map.instance_of? Changeset or (map.instance_of? Node and map.version > 1) or map.visible %> + <%= javascript_include_tag '/openlayers/OpenStreetMap.js' %> +<%= javascript_include_tag 'openstreetbugs.js' %> <%= javascript_include_tag 'map.js' %>