2014-08-06 14:47:47 +02:00
|
|
|
# Geocoding
|
|
|
|
#
|
|
|
|
# Access to OSM controls
|
2014-04-28 00:33:21 +02:00
|
|
|
class MapsController < ApplicationController
|
2017-07-28 00:35:14 +02:00
|
|
|
has_scope :region, :locality, :tag, :daylimit, :year
|
|
|
|
has_scope :near, type: :hash, using: %i[location distance]
|
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]
|
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
|
2018-04-05 22:00:07 +02:00
|
|
|
format.json { @events = 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
|
2019-04-23 18:40:29 +02:00
|
|
|
@orgas = 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
|