# Event Calendar Extension for Radiant This extension lets your radiant site present calendar events in various useful ways. The events can be administered directly or retrieved by subscription to ical and caldav services including Google Calendar, and can be served as RSS, Ical or JSON feeds as well as through a broad set of radius tags on your normal pages. This extension supports a wide range of uses from a single-tag display of forthcoming events through to a full calendar aggregation and mapping service. The calendaring functionality comes from [ri_cal](http://github.com/rubyredrick/ri_cal) and supports proper recurrence and duration. We also recognise all-day events and pass through notes and urls: the ical subscription and redistribution should be fully RFC2445 compliant. It is not yet a full CalDAV client, and we don't have proper support for principals, groups or availability. See the [event_map](http://github.com/spanner/radiant-event_map-extension) extension for googlemapping of events and [taggable_events](http://github.com/spanner/radiant-taggable_events-extension) for more fine-grained tagging and retrieval options. A `reader_events` extension is also in the works for public submission of calendar events. ## Requirements Radiant 0.9 or 1, `layouts` or `share_layouts` and the `ri_cal` gem to handle iCal data. It's declared in the extension so this should do it: sudo rake gems:install This is compatible with `multi_site` and with the [sites](http://github.com/spanner/radiant-sites-extension) extension. With the latter everything will be site-scoped. There is a 0.81 tag in the repository for the last version good with radiant 0.8.1 and `scoped_admin`. This version includes some optional experiments in dashboard integration. If you're using dashboard you need the spanner fork. ## Installation Should be straightforward: script/extension install event_calendar or as a gem: sudo gem install radiant-event_calendar-extension with this in your environment.rb: config.gem 'radiant-event_calendar-extension', :lib => false ## Configuration There are a few optional config settings: * `event_calendar.icals_path` is the directory (under /public/) holding the calendar subscription files. Default is `icals`. * `event_calendar.default_refresh_interval` is the period, in seconds, after which the calendar subscriptions are refreshed. Default is one hour. Set to zero to refresh only in the admin interface. * `event_calendar.layout` is the name of the layout that EventsController will use (see below) * `event_calendar.filename_prefix` is an optional prefix for ics filenames * `event_calendar.cached?` determines whether the EventsController pages are cached by Rack::Cache. EventCalendarPages are always cached like other pages. * `event_calendar.cache_duration` determines for how long. Each calendar subscription will have its own address and authentication settings. ## Usage ### Subscribing to a calendar 1. Create a calendar source. You can do that by publishing a feed from your desktop calendar application, by making a google calendar public or by setting up a CalDAV calendar and persuading all the right people to subscribe to it. 2. Find the ical subscription address of your calendar. 3. Choose 'new calendar' in the radiant admin menu and enter the address and any authentication information you need to get at it. See below for notes about connecting to CalDAV. In the case of an ical file or google calendar you should only need an address. Give the calendar a slug, just as you would for a page, and optionally a category. Let's say you call it 'test'. 4. Your calendar should appear in the subscription list. Click through to browse its events and make sure everything is as it should be. ### Adding events manually Should be obvious. There are a few points to remember: * Event venues are expected to be reused, so they present as a list with the option to add a new one. * The postcode field is a convenience for geocoding purposes. You can leave it blank unless you're mapping and your locations are a bit odd. * Recurrence is for the repetition of identical separate events. A single event that spans several days only needs to have the right start and end times. * End times are optional: an event with just a start time is just listed where it begins. ### Displaying events with the EventsController The events controller uses `share_layouts` to define various page parts that your layout can bring in. To use it, create a layout with any or all of these parts: * `title` is the page title and can also be shown with `r:title` * `events` is a formatted list of events with date stamps and descriptions * `continuing_events` is a compact list of events that have already begun but which continue into the period being shown * `calendar` is a usual calendar block with links to months and days. Days without events are not linked. * `pagination` is the usual will_paginate block. * `faceting` here only gives the option to remove any date filters that have been applied. If you add the `taggable_events` extension it gets more useful. Set the config entry `event_calendar.layout` to the name of your layout and point a browser at /calendar to see what you've got. Here's a basic sample layout that should just work: