public
Fork of mghaught/radiant-page-event
Description: Radiant extension for page-based event calendar for associating time-based events with your Radiant pages
Homepage:
Clone URL: git://github.com/nelstrom/radiant-page-event.git
nelstrom (author)
Mon Jun 08 14:14:45 -0700 2009
commit  3d4b694a9fab056cc70cec09140ec720ee2a82f1
tree    784dcaa04114fd3510051d43095f027adb1f742f
parent  0a8147129f1a87bdeafc1616fe887ee0ee011a64
README
= Page Event

Created by Marty Haught, January 2008

Page Event is a simple page-based event calendar for associating time-based events with your Radiant pages.  The 
original example was setting up meeting announcements in radiant where the meeting was a page.  Having this meeting show 
up on a site-wide calendar and having exact information on when the meeting was taking place was important.


INSTALLATION

NOTE: The extension is tested against 6.6  through 6.9 though it might work for some of the older 6 releases.  If you 
use a version older than 6.7 you'll need the shards extension installed and configured properly.  I have no intention of 
adding support for any release prior to 6.6.  The following instructions assume you have Radiant 6.7 installed and 
configured properly.

1) Install the Calendar Date Select plugin with the following command:

git clone git://github.com/timcharper/calendar_date_select.git vendor/plugins/calendar_date_select

OR

svn export http://calendardateselect.googlecode.com/svn/tags/calendar_date_select vendor/plugins/calendar_date_select

You can read more about it here:
http://code.google.com/p/calendardateselect/ 


2) Install the Page Event Extension

If you're only 6.9 or newer:

script/extension install page_event

OR the old way:

git clone git://github.com/mghaught/radiant-page-event.git vendor/extensions/page_event

** Github has a download button that will give you a tarball of the extension.  If you don't want to use git then go 
this route and expand the tarball in the vendor/extensions/page_event directory of your Radiant app.


3) run migration*

rake production radiant:extensions:page_event:migrate


4) run rake update for extension*

rake radiant:extensions:page_event:update

*Both 3 and 4 are unnecessary if you used the script/extension install command

5) Start (or restart) your server


USAGE

The extension will create a new column on the pages table to store an optional event timestamp.  The admin create/edit 
page interface will now have an Event Date field with pop-up calendar widget that will allow you to set a date and time 
that represents an event.  This page will now be associated with that time.  Additionally, there is a page event admin 
tab next to pages tab that will give you a month's view of events.  It also have next and previous month navigation.  
The current UI is basic so look forward to it being enhanced.

For displaying these events on your radiant pages you can choose from several tags.  The main tag you'll use is the 
monthly calendar tag:

<r:events:calendar />

It will produce the current month's view with any events during the time.  The calendar also has previous and next month 
navigation.  A default set of css styles are provided in the following file:

<RADIANT_ROOT>/public/stylesheets/page_event/red/style.css

In order to make use of this stylesheet you'll need to add it to the pages that will use the calendar tag.  


There are several tags that allow you to grab either the next event or a list of upcoming events.

<r:events:next>...</r:events:next>
<r:events:upcoming:each>...</r:events:upcoming:each>


When it comes to accessing a specific page's event data you can use the following tags:

<r:event>
  Date: <r:date />
  Time: <r:time />
  Duration: <r:duration />
</r:event>

OR

<r:event:date />
<r:event:time />
<r:event:duration />

They will simply output the date or time, respectively, in a human formatted version.  The <r:date/> and <r:time/> tags 
accept a format attribute that specifies a strftime pattern for formatting the date or time.




FUTURE RELEASES

In the immediate future, I will focus styling and bug fixes.  There are several refactoring opportunities as well as UI 
enhancements on both sides that might happen.  The biggest change I'm anticipating is upgrading the event data from a 
simple timestamp to a true model with time ranges.  Feedback welcome!