Sha256: 928a3950722800cdc1cdd63519eed2d3d82f3b09dcd6ed8926373c925b4f48ba

Contents?: true

Size: 888 Bytes

Versions: 11

Compression:

Stored size: 888 Bytes

Contents

module Caboodle
  class Googlelocal < Caboodle::Kit
    
    description "A google map linking to a list of locations and enabling Local Search around each of them."
    
    required [:google_maps_api_key]
    
    config_files ["googlelocal.yml"]
    
    stylesheets ["http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css", "http://www.google.com/uds/css/gsearch.css"]
    
    before do
      @locations = Settings.google_local_locations
      @location = Settings.google_local_locations.first
    end
    
    menu "Near me"
    
    get "/near_me/:slug" do
      Settings.google_local_locations.each do |loc|
        if loc.title.downcase.gsub(" ","-") == params[:slug]
          @location = loc
        end
      end
            
      if @location
        haml :near_me
      else
        redirect "/near_me" 
      end
    end
    
    add_sass ["googlelocal"]
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
caboodle-0.3.0 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.30 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.29 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.28 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.27 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.26 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.25 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.24 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.23 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.22 lib/caboodle/kits/googlelocal/googlelocal.rb
caboodle-0.2.21 lib/caboodle/kits/googlelocal/googlelocal.rb