Giter Site home page Giter Site logo

radiant-event-calendar's Introduction

= Event Calendar (iCal) Extension for Radiant =

Created by: Loren Johnson - www.hellovenado.com
   Version: 0.7
   Contact: [email protected]


== INSTALLATION == 
* Req'd Radiant Version: 0.6.4+ (not tested with earlier versions, may work with all 0.6+)

1. Checkout extension to the vendor/extensions directory of your Radiant app using svn (you may have already done this): 

  svn co http://svn.fn-group.com/radiant_extensions/event_calendar

2. Install the VPIM iCal/vCal parsing gem: gem install vpim

3. Migrate extensions: rake db:migrate:extensions

4. Copy extension public assets to Radiant public directory. Currently this will create the default public/icals directory which is required
as a home for the cached ical subscription files, this is configurable via Radiant::Config["event_calendar.icals_path"]:

  rake radiant:extensions:event_calendar:update

5. From Admin navigate to your new "Event Calendars" tab and click "Add a Calendar", enter your iCal subscription URL and name for the calendar and press Save.

6. You can now manually refresh the calendar from the subscription once you've saved it by clicking on the Refresh link. 


== AN EXAMPLE EVENT-CALENDAR IMPLEMENTATION ==

1. Create a new Calendar under the EventCalendar tab in admin entering at minimum a Name and iCal URL

2. Click on the "Refresh" link for the calendar after it's been successfuly created to download all the events from the iCal subscription

3. Create a new page and select EventCalendar as the Page Type

4. Paste the following code in the body page part then save the page. 

Note that if you have used previous version of the event calendar, this version has Events factored out so that they can be presented in a separate window.  Here are a list of changes that you should look for:

<r:event:each> => <r:events:each>
The addition of the new <r:event> tag
<r:start> => <r:event:start_date>
<r:daterange> tag has changed to <r:timeperiod>

<r:calendar>
  <table>
    <tr>
      <td>
        <ul>
          <r:nav>
            <li><r:week_link class="navLink" /></li> 
            <li><r:month_link class="navLink" /></li>
            <li><r:year_link class="navLink" /></li>
          </r:nav>
       </ul>
      </td>
    </tr>
    <tr>
      <td>
        <h2><r:name /></h2>
        <h3><r:begin_date format="%d %B" /> - <r:end_date format="%d %B" /></h3>
      </td>
    </tr>
  </table>
  <div id="eventList">
   <r:events:each>
      <div class="eventBox">
      <r:header><h5><r:start format="%d %B, %A" /></h5></r:header>
	  <r:event>
      <table class="event" id="event<r:id />" onclick="toggleVisible('detail<r:id />'); Effect.Highlight('event<r:id />'); return false;">
        <tr>
          <td style="text-transform:uppercase;width:180px;">
            <r:calendar_name />
          </td>
          <td style="">
            <r:title />
          </td>
       </tr>
       <tr>
          <td style="text-transform:uppercase;width:180px;">
          </td>
          <td>
           <div id="detail<r:id />" class="detail">
             <r:timeperiod format="%I:%M %p" /><br />
             <r:location /><br />
             <r:description />
           </div>
         </td>
       </tr>
     </table>
	</r:event>
    </div>
    <r:events:each>
  </div>     
</r:calendar>

5. Navigate to the newly created page within the public site 

6. You can now create a link to an event by the event id with the tag:
	<a href="<r:url />" target="_blank">Link</a>

7. If your calendar has reoccurring events, then you will probably want to use the tag that links to the event by the ical_uid.  This is a unique identifier for each ical event, Note that all reoccurring events have the same ical_uid. In this case ical model will pick the first event that occurs in the future.  In the Events List inside Radiant Admi9n, the ical_uid has been added.

	<r:event_url id="[email protected]"/>
           
8. To display an event in a separate window, create a new page with a Page Type of "Event" to serve as the Event page. Example content of this page is simply this:

	<r:event>
	  <h1><r:title /></h1>
	  <p><r:description /></p>
	</r:event>

...but you can use any of the <r:event.. tags in the library on this page. 

== NOTES ==

* The handling of all paths below the node an EventCalendar Page are overridden to capture the calendar "category" and "slug". 
So, if you create a page under Home > Calendar and apply the EventCalendar page type to it, and through admin create a calendar with the category of 
"master" and a name of "youth" you'll be able to access your calendar at http://yoursite.com/calendar/master/youth. Also, you'll also be able to see 
events for all calendars with a category of "master" by navigating to http://yoursite.com/calendar/master/all. 

In addition, you can also select the class of events. Public, Private or All.  All is the class by default.  You can specify only the public events by adding to the URL, http://yoursite.com/calendar/master/youth/public.

* For add'l documentation please refer to the Radiant tag reference (the "Available tags" link within Page edit) for the <r:calendar /> tag series, 
you'll only see the Calendar tag documentation available when editing a page that has already been saved as the EventCalendar Page Type.

* Please refer to the tag documentation under "Available Tags" when editing a page in Radiant (page must be already created and of EventCalendar type).

* If you wish to setup a Cron job to automatically keep you Radiant calendar in-sync with the iCal feed have Cron run the following from within the root 
of your Radiant application: script/runner -e production "Calendar::refresh_all"

* By running the migration, the class_name of the Event Calendar page will change from EventCalendarPage to EventCalendar.  If you migrate back to version 8, this change will revert and this version of the calendar extension will no longer be compatible.


== DEVELOPMENT ROADMAP ==

* Manual event entry screens. Allow manual events to be mixed in with events from subscriptions.
* Tag to create link to source ical file (for offering subscription link)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.