radiant-event_calendar-extension 1.4.8 → 1.4.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,10 +36,10 @@ with this in your environment.rb:
36
36
 
37
37
  There are a few optional config settings:
38
38
 
39
- * `event_calendar.icals_path` is the directory (under /public/) holding the calendar subscription files. Default is `icals`.
40
- * `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.
39
+ * `event_calendar.path` is the stem of all EventsController addresses. It defaults to `/calendar`, which gives you addresses like `/calendar/2011/June`. You can change the stem to any value you like provided it is not also a page address.
41
40
  * `event_calendar.layout` is the name of the layout that EventsController will use (see below)
42
- * `event_calendar.filename_prefix` is an optional prefix for ics filenames
41
+ * `event_calendar.icals_path` is the directory (under /public/) holding the calendar subscription files. Default is `icals`.
42
+ * `event_calendar.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.
43
43
  * `event_calendar.cached?` determines whether the EventsController pages are cached by Rack::Cache. EventCalendarPages are always cached like other pages.
44
44
  * `event_calendar.cache_duration` determines for how long.
45
45
 
@@ -74,7 +74,7 @@ The events controller uses `share_layouts` to define various page parts that you
74
74
  * `pagination` is the usual will_paginate block.
75
75
  * `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.
76
76
 
77
- 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.
77
+ 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.
78
78
 
79
79
  Here's a basic sample layout that should just work:
80
80
 
@@ -15,7 +15,7 @@ class EventsController < SiteController
15
15
  @seen_events = {}
16
16
  respond_to do |format|
17
17
  format.html {
18
- timeout = Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 1.hour
18
+ timeout = (Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 3600).seconds
19
19
  expires_in timeout.to_i, :public => true, :private => false
20
20
  }
21
21
  format.js {
@@ -36,7 +36,7 @@ class EventsController < SiteController
36
36
  def show
37
37
  @event = Event.find(params[:id])
38
38
  format.html {
39
- timeout = Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 1.hour
39
+ timeout = (Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 3600).seconds
40
40
  expires_in timeout.to_i, :public => true, :private => false
41
41
  }
42
42
  format.ics {
@@ -0,0 +1,5 @@
1
+ %fieldset
2
+ %h4= t('calendar')
3
+ %p= edit_config 'event_calendar.layout'
4
+ %p= edit_config 'event_calendar.cache_duration'
5
+ %p= edit_config 'event_calendar.refresh_interval'
@@ -0,0 +1,8 @@
1
+ %h4
2
+ = t('calendar')
3
+ %p.ruled
4
+ = show_config 'event_calendar.layout'
5
+ %p.ruled
6
+ = show_config 'event_calendar.cache_duration'
7
+ %p.ruled
8
+ = show_config 'event_calendar.refresh_interval'
@@ -17,6 +17,8 @@
17
17
  = link_to event.title, event.url, :class => 'title'
18
18
  - else
19
19
  = event.title
20
+ - if event.facebook_id
21
+ = link_to t('event_calendar_extension.view_on_facebook'), event.facebook_url, :class => 'facebook event'
20
22
  = render :partial => 'events/keywords', :locals => {:event => event}
21
23
 
22
24
  %p.practicalities
@@ -29,12 +31,12 @@
29
31
  = link_to event.event_venue.title, event.event_venue.url, :class => 'location'
30
32
  - else
31
33
  = event.event_venue.title
32
- = event.event_venue.address
34
+ - if event.event_venue.address
35
+ %br
36
+ = event.event_venue.address
33
37
  - elsif event.location
34
38
  %span.location
35
39
  = event.location
36
- - if event.facebook_id
37
- = link_to t('event_calendar_extension.view_on_facebook'), event.facebook_url, :class => 'facebook event'
38
40
  - unless repeating
39
41
  = event.description_paragraph
40
42
 
@@ -1,5 +1,10 @@
1
1
  Radiant.config do |config|
2
- config.namespace('event_calendar') do |forum|
3
- forum.define 'icals_path', :default => "/icals"
2
+ config.namespace('event_calendar') do |calendar|
3
+ calendar.define 'path', :default => "/calendar", :allow_blank => false
4
+ calendar.define 'icals_path', :default => "/icals", :allow_blank => false
5
+ calendar.define 'cache_duration', :type => :integer, :default => 3600, :units => 'seconds'
6
+ calendar.define 'refresh_interval', :type => :integer, :default => 3600, :units => 'seconds'
7
+ calendar.define 'recurrence_horizon', :type => :integer, :default => 10, :units => 'years'
8
+ calendar.define 'layout', :select_from => lambda { Layout.all.map(&:name) }, :allow_blank => false
4
9
  end
5
10
  end
@@ -1,5 +1,10 @@
1
1
  ---
2
2
  en:
3
+ config:
4
+ event_calendar:
5
+ path: Calendar path
6
+ refresh_interval: Refresh subscriptions after
7
+ cache_duration: Cache duration
3
8
  time:
4
9
  formats:
5
10
  calendar_period_description_week: "in week %U of %Y"
@@ -36,9 +41,10 @@ en:
36
41
  delete_calendar: "delete calendar"
37
42
  really_delete_calendar: "Are you sure you want to delete the %{name} calendar?"
38
43
  calendar: Calendar
39
- calendars: calendars
40
- events: events
41
- locations: locations
44
+ calendars: Calendars
45
+ events: Events
46
+ locations: Locations
47
+ event_venues: Locations
42
48
  defaults:
43
49
  cancel: Cancel
44
50
  or: or
data/config/routes.rb CHANGED
@@ -7,9 +7,10 @@ ActionController::Routing::Routes.draw do |map|
7
7
  cal.calendars_home '/', :controller => 'events', :action => 'index'
8
8
  end
9
9
 
10
- map.calendar "/calendar/events/:id.:format", :controller => 'events', :action => 'show'
11
- map.calendar "/calendar.:format", :controller => 'events', :action => 'index'
12
- map.calendar_year "/calendar/:year", :controller => 'events', :action => 'index'
13
- map.calendar_month "/calendar/:year/:month", :controller => 'events', :action => 'index'
14
- map.calendar_day "/calendar/:year/:month/:mday", :controller => 'events', :action => 'index'
10
+ prefix = Radiant.config['event_calendar.path'] || "/calendar"
11
+ map.calendar "#{prefix}/events/:id.:format", :controller => 'events', :action => 'show'
12
+ map.calendar "#{prefix}.:format", :controller => 'events', :action => 'index'
13
+ map.calendar_year "#{prefix}/:year", :controller => 'events', :action => 'index'
14
+ map.calendar_month "#{prefix}/:year/:month", :controller => 'events', :action => 'index'
15
+ map.calendar_day "#{prefix}/:year/:month/:mday", :controller => 'events', :action => 'index'
15
16
  end
@@ -24,13 +24,15 @@ class EventCalendarExtension < Radiant::Extension
24
24
  admin.calendar = Radiant::AdminUI.load_default_calendar_regions
25
25
  admin.event = Radiant::AdminUI.load_default_event_regions
26
26
  admin.event_venue = Radiant::AdminUI.load_default_event_venue_regions
27
+ admin.configuration.show.add :config, 'admin/configuration/calendar_show', :after => 'defaults'
28
+ admin.configuration.edit.add :form, 'admin/configuration/calendar_edit', :after => 'edit_defaults'
27
29
 
28
30
  admin.dashboard.index.add(:main, "coming_events", :before => 'recent_assets') if admin.respond_to? :dashboard
29
31
 
30
- tab('calendar') do
31
- add_item('events', '/admin/event_calendar')
32
- add_item('calendars', '/admin/event_calendar/calendars')
33
- add_item('locations', '/admin/event_calendar/event_venues')
32
+ tab('Calendar') do
33
+ add_item('Events', '/admin/event_calendar')
34
+ add_item('Calendars', '/admin/event_calendar/calendars')
35
+ add_item('Locations', '/admin/event_calendar/event_venues')
34
36
  end
35
37
 
36
38
  end
@@ -466,6 +466,24 @@ module EventCalendarTags
466
466
  tag.locals.event.facebook_url
467
467
  end
468
468
 
469
+ desc %{
470
+ Renders a link to the facebook version of this event, if any. Attributes are
471
+ passed through in the usual way and if the tag is double its rendered contents
472
+ will become the link text.
473
+
474
+ Usage:
475
+ <pre><code><r:facebook_link class="facebook event" /></code></pre>
476
+ }
477
+ tag "event:facebook_link" do |tag|
478
+ if tag.locals.event.facebook_id
479
+ options = tag.attr.dup
480
+ attributes = options.inject('') { |s, (k, v)| s << %{#{k.downcase}="#{v}" } }.strip
481
+ attributes = " #{attributes}" unless attributes.empty?
482
+ text = tag.double? ? tag.expand : I18n.t('event_calendar_extension.view_on_facebook')
483
+ %{<a href="#{tag.render('facebook_url')}"#{attributes}>#{text}</a>}
484
+ end
485
+ end
486
+
469
487
  #todo: venues:* tags
470
488
 
471
489
  desc %{
@@ -1,5 +1,5 @@
1
1
  module RadiantEventCalendarExtension
2
- VERSION = '1.4.8'
2
+ VERSION = '1.4.9'
3
3
  SUMMARY = %Q{Event Calendar Extension for Radiant CMS}
4
4
  DESCRIPTION = "An event calendar extension that administers events locally or draws them from any ical or CalDAV publishers (Google Calendar, .Mac, Darwin Calendar Server, etc.)"
5
5
  URL = "http://github.com/radiant/radiant-event_calendar-extension"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-event_calendar-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 4
9
- - 8
10
- version: 1.4.8
9
+ - 9
10
+ version: 1.4.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Loren Johnson
@@ -106,6 +106,8 @@ files:
106
106
  - app/views/admin/calendars/index.html.haml
107
107
  - app/views/admin/calendars/new.html.haml
108
108
  - app/views/admin/calendars/show.html.haml
109
+ - app/views/admin/configuration/_calendar_edit.html.haml
110
+ - app/views/admin/configuration/_calendar_show.html.haml
109
111
  - app/views/admin/dashboard/_coming_events.html.haml
110
112
  - app/views/admin/event_venues/_event_venue.html.haml
111
113
  - app/views/admin/event_venues/_form.html.haml
@@ -178,6 +180,7 @@ files:
178
180
  - public/stylesheets/sass/admin/event_calendar.sass
179
181
  - public/stylesheets/sass/admin/event_calendar_dashboard.sass
180
182
  - public/stylesheets/sass/event_calendar.sass
183
+ - radiant-event_calendar-extension-1.4.9.gem
181
184
  - radiant-event_calendar-extension.gemspec
182
185
  - Rakefile
183
186
  - README.md
@@ -199,7 +202,7 @@ has_rdoc: true
199
202
  homepage: http://github.com/radiant/radiant-event_calendar-extension
200
203
  licenses: []
201
204
 
202
- post_install_message: "\n Add this to your radiant project with:\n\n config.gem 'radiant-event_calendar-extension', :version => '~> 1.4.8'\n\n "
205
+ post_install_message: "\n Add this to your radiant project with:\n\n config.gem 'radiant-event_calendar-extension', :version => '~> 1.4.9'\n\n "
203
206
  rdoc_options: []
204
207
 
205
208
  require_paths: