Merge branch 'master' into openstreetbugs
Conflicts: app/views/browse/_map.html.erb app/views/site/index.html.erb
This commit is contained in:
commit
72e33046c8
134 changed files with 3722 additions and 1345 deletions
|
@ -4,6 +4,9 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
if STATUS == :database_readonly or STATUS == :database_offline
|
||||
session :off
|
||||
|
||||
def self.cache_sweeper(*sweepers)
|
||||
end
|
||||
end
|
||||
|
||||
def authorize_web
|
||||
|
|
|
@ -446,7 +446,7 @@ private
|
|||
# eliminate empty changesets (where the bbox has not been set)
|
||||
# this should be applied to all changeset list displays
|
||||
def conditions_nonempty()
|
||||
return ['min_lat IS NOT NULL']
|
||||
return ['num_changes > 0']
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -10,7 +10,7 @@ class DiaryEntryController < ApplicationController
|
|||
|
||||
caches_action :list, :view, :layout => false
|
||||
caches_action :rss, :layout => true
|
||||
cache_sweeper :diary_sweeper, :only => [:new, :edit, :comment, :hide, :hidecomment], :unless => STATUS == :database_offline
|
||||
cache_sweeper :diary_sweeper, :only => [:new, :edit, :comment, :hide, :hidecomment]
|
||||
|
||||
def new
|
||||
@title = t 'diary_entry.new.title'
|
||||
|
|
|
@ -48,6 +48,18 @@ class SiteController < ApplicationController
|
|||
@lat = params['mlat'].to_f
|
||||
@zoom = params['zoom'].to_i
|
||||
|
||||
elsif params['bbox']
|
||||
bbox = params['bbox'].split(",")
|
||||
|
||||
@lon = ( bbox[0].to_f + bbox[2].to_f ) / 2.0
|
||||
@lat = ( bbox[1].to_f + bbox[3].to_f ) / 2.0
|
||||
@zoom = 16
|
||||
|
||||
elsif params['minlon'] and params['minlat'] and params['maxlon'] and params['maxlat']
|
||||
@lon = ( params['maxlon'].to_f + params['minlon'].to_f ) / 2.0
|
||||
@lat = ( params['maxlat'].to_f + params['minlat'].to_f ) / 2.0
|
||||
@zoom = 16
|
||||
|
||||
elsif params['gpx']
|
||||
@lon = Trace.find(params['gpx']).longitude
|
||||
@lat = Trace.find(params['gpx']).latitude
|
||||
|
|
|
@ -18,8 +18,8 @@ class TraceController < ApplicationController
|
|||
caches_action :list, :unless => :logged_in?, :layout => false
|
||||
caches_action :view, :layout => false
|
||||
caches_action :georss, :layout => true
|
||||
cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete]
|
||||
cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete]
|
||||
|
||||
# Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
|
||||
# target_user - if set, specifies the user to fetch traces for. if not set will fetch all traces
|
||||
|
|
|
@ -17,7 +17,7 @@ class UserController < ApplicationController
|
|||
|
||||
filter_parameter_logging :password, :pass_crypt, :pass_crypt_confirmation
|
||||
|
||||
cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete]
|
||||
|
||||
def terms
|
||||
@legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || DEFAULT_LEGALE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue