2014-08-06 14:47:47 +02:00
|
|
|
# Geocoding
|
|
|
|
#
|
|
|
|
# Access to OSM controls
|
2014-04-28 00:33:21 +02:00
|
|
|
class MapsController < ApplicationController
|
2015-11-10 23:29:05 +01:00
|
|
|
has_scope :region, :locality, :tag, :daylimit
|
2014-11-25 19:54:20 +01:00
|
|
|
has_scope :future, type: :boolean, default: true
|
2017-04-22 20:01:47 +02:00
|
|
|
has_scope :period, type: :hash, using: %i[year week]
|
|
|
|
has_scope :near, type: :hash, using: %i[location distance]
|
2014-11-05 21:25:18 +01:00
|
|
|
|
2014-04-28 00:33:21 +02:00
|
|
|
def index
|
2014-07-31 01:32:47 +02:00
|
|
|
respond_to do |format|
|
2016-04-17 15:34:04 +02:00
|
|
|
format.html
|
2014-11-25 19:54:20 +01:00
|
|
|
format.json { render json: apply_scopes(Event.moderated.geo) }
|
2014-07-31 01:32:47 +02:00
|
|
|
end
|
2014-04-28 00:33:21 +02:00
|
|
|
end
|
2016-04-16 23:08:03 +02:00
|
|
|
|
|
|
|
def show
|
2016-10-15 16:39:15 +02:00
|
|
|
@kind = Kind.find_by name: params[:id]
|
2016-04-16 23:08:03 +02:00
|
|
|
respond_to do |format|
|
2016-04-17 15:34:04 +02:00
|
|
|
format.html
|
2016-04-17 14:07:39 +02:00
|
|
|
format.json do
|
2016-04-17 15:34:04 +02:00
|
|
|
render json: apply_scopes(Orga.moderated.active.geo).where(kind: @kind)
|
2016-04-17 14:07:39 +02:00
|
|
|
end
|
2016-04-16 23:08:03 +02:00
|
|
|
end
|
|
|
|
end
|
2014-04-28 00:33:21 +02:00
|
|
|
end
|