Sha256: dafc901c46618d8a10c63b9603aab867083882fa4c028899779ce7c7b7fa5a66

Contents?: true

Size: 849 Bytes

Versions: 7

Compression:

Stored size: 849 Bytes

Contents

module EventMapTags
  include Radiant::Taggable
  
  class TagError < StandardError; end
  
  desc %{ 
    Drops onto the page a couple of scripts and a div with the id #map_canvas, which between them will 
    present a google map of all your events. To show only one calendar, pass its slug as a calendar attribute:
    
    <pre><code><r:events:googlemap calendar="slug" /></code></pre> 
    
  }
  tag 'events:googlemap' do |tag|
    parameters = {:format => :js}
    if tag.attr['calendar'] && calendar = Calendar.find_by_slug(tag.attr['calendar'])
      parameters[:calendar_id] = calendar.id
    end
    %{
      <div id="map_canvas"></div>
      <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
      <script type="text/javascript" src="#{eventmap_path(parameters)}"></script>
    }
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
radiant-event_map-extension-1.4.1 lib/event_map_tags.rb
radiant-event_map-extension-1.4.0 lib/event_map_tags.rb
radiant-event_map-extension-1.3.6 lib/event_map_tags.rb
radiant-event_map-extension-1.3.5 lib/event_map_tags.rb
radiant-event_map-extension-1.3.4 lib/event_map_tags.rb
radiant-event_map-extension-1.3.3 lib/event_map_tags.rb
radiant-event_map-extension-1.3.2 lib/event_map_tags.rb