diff --git a/app/controllers/front_ui_controller.rb b/app/controllers/front_ui_controller.rb index 4c68f927..7eb43482 100644 --- a/app/controllers/front_ui_controller.rb +++ b/app/controllers/front_ui_controller.rb @@ -44,6 +44,20 @@ class FrontUiController < ApplicationController def about; end + def location + @loc = params[:loc] + + @maps = Map.page(params[:maps]) + .per_page(20) + .where('archived = ? and password = ? and location LIKE ?', false, '', "%#{@loc}%") + .order('updated_at DESC') + .group('maps.id') + + respond_to do |format| + format.js + end + end + def gallery @maps = Map.page(params[:maps]) .per_page(20) diff --git a/app/views/front_ui/gallery.html.erb b/app/views/front_ui/gallery.html.erb index 45a93d85..e266e12f 100644 --- a/app/views/front_ui/gallery.html.erb +++ b/app/views/front_ui/gallery.html.erb @@ -20,6 +20,9 @@ + <% if params[:controller] == "tags" %>