radiant-event_calendar-extension 1.3.6 → 1.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.6
1
+ 1.3.7
@@ -1,5 +1,6 @@
1
1
  class EventsController < SiteController
2
2
  require "uri"
3
+ include Radiant::Pagination::Controller
3
4
 
4
5
  helper_method :events, :all_events, :continuing_events, :period, :calendars, :list_description
5
6
  helper_method :url_for_date, :url_for_month, :url_without_period, :calendar_parameters, :month_name, :short_month_name, :day_names
@@ -14,12 +15,8 @@ class EventsController < SiteController
14
15
  @seen_events = {}
15
16
  respond_to do |format|
16
17
  format.html {
17
- if Radiant::Config['event_calendar:cached?']
18
- timeout = Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout
19
- expires_in timeout.to_i, :public => true, :private => false
20
- else
21
- expires_now
22
- end
18
+ timeout = Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 1.hour
19
+ expires_in timeout.to_i, :public => true, :private => false
23
20
  }
24
21
  format.js {
25
22
  render :json => events.to_json
@@ -102,6 +99,12 @@ class EventsController < SiteController
102
99
  parts << "in #{calendars.to_sentence}" if calendars
103
100
  @description = parts.join(' ')
104
101
  end
102
+
103
+ # these methods build calendar links by using supplied parameters to amend the current parameter set
104
+ # anything not mentioned is carried forward unchanged.
105
+ # this is only slightly worthwhile here but gets much more useful when there are more ways to select events.
106
+
107
+ # this whole mechanism should probably be moved into a helper.
105
108
 
106
109
  def url_for_date(date)
107
110
  url_for(url_parts({
@@ -135,8 +138,8 @@ class EventsController < SiteController
135
138
  url_parts.map{|p| params[p] }.join("_")
136
139
  end
137
140
 
138
- # this is broken down to provide chain points for other extensions that add more ways to filter
139
- # eg, to start with, taggable_events
141
+ # this is broken down into minimal parts to provide chain points for other extensions
142
+ # that add more ways to filter. eg, to start with, taggable_events
140
143
 
141
144
  def calendar_parameters
142
145
  url_parts
@@ -151,31 +154,31 @@ class EventsController < SiteController
151
154
  [:year, :month, :mday, :category, :slug, :calendar_id]
152
155
  end
153
156
 
154
- def month_name(month)
155
- month_names[month]
156
- end
157
-
158
- def short_month_name(month)
159
- short_month_names[month]
160
- end
161
-
162
157
  def day_names
163
158
  return @day_names if @day_names
164
159
  @day_names ||= Date::DAYNAMES.dup
165
160
  @day_names.push(@day_names.shift) # Class::Date and ActiveSupport::CoreExtensions::Time::Calculations have different ideas of when is the start of the week. We've gone for the rails standard.
166
161
  @day_names
167
162
  end
168
-
169
- protected
170
-
171
- def short_month_names
172
- @short_month_names ||= Date::ABBR_MONTHNAMES.dup
163
+
164
+ def month_name(month)
165
+ month_names[month]
173
166
  end
174
-
167
+
175
168
  def month_names
176
169
  @month_names ||= Date::MONTHNAMES.dup
177
170
  end
178
-
171
+
172
+ def short_month_name(month)
173
+ short_month_names[month]
174
+ end
175
+
176
+ def short_month_names
177
+ @short_month_names ||= Date::ABBR_MONTHNAMES.dup
178
+ end
179
+
180
+ private
181
+
179
182
  # months can be passed around either as names or numbers
180
183
  # any date part can be 'now' or 'next' for ease of linking
181
184
  # and everything is converted to_i to save clutter later
@@ -190,12 +193,5 @@ protected
190
193
  params[p] = params[p].to_i
191
194
  end
192
195
  end
193
-
194
- def pagination_parameters
195
- {
196
- :page => (params[:p] || 1).to_i,
197
- :per_page => (params[:pp] || Radiant::Config['event_calendar.per_page'] || 10).to_i
198
- }
199
- end
200
-
196
+
201
197
  end
@@ -22,7 +22,7 @@
22
22
  %p.practicalities
23
23
  = event.summarize_start
24
24
  - if event.event_venue
25
- at
25
+ = t('at')
26
26
  - if event.event_venue.url
27
27
  = link_to event.event_venue.title, event.event_venue.url, :class => 'location'
28
28
  - else
@@ -1,11 +1,4 @@
1
- - content_for :breadhead do
2
- - home = Page.find_by_parent_id(nil)
3
- = link_to home.breadcrumb, home.url
4
- \&gt;
5
-
6
- - content_for :title do
7
- Events
8
- = list_description
1
+ = render :partial => 'events/other_page_parts'
9
2
 
10
3
  - content_for :events do
11
4
  = render :partial => 'event', :collection => events
@@ -13,23 +6,23 @@
13
6
  - if events.length < 5 && continuing_events.any?
14
7
  - if events.any?
15
8
  %h2.listheader
16
- Continuing events
9
+ = t('continuing_events')
17
10
  = render :partial => 'event', :collection => continuing_events
18
11
 
19
12
  - if events.empty? && continuing_events.empty?
20
13
  - if period
21
14
  %h2
22
- Sorry: there are no events
15
+ = t('sorry_no_events')
23
16
  = render :partial => 'events/defacet'
24
17
  - else
25
18
  %h2
26
- Sorry: there are no events coming up
19
+ = t('sorry_no_events')
27
20
 
28
21
  - content_for :continuing_events do
29
22
  - if continuing_events.any? && events.length >= 5
30
23
  #continuing
31
24
  %h3
32
- Continuing events
25
+ = t('continuing_events')
33
26
  %ul
34
27
  - continuing_events.each do |event|
35
28
  %li
@@ -38,13 +31,13 @@
38
31
  - else
39
32
  = event.title
40
33
  %span.detail
41
- runs until
34
+ = t('runs_until')
42
35
  = event.last_day
43
36
  - if event.event_venue
44
- at
37
+ =t('at')
45
38
  = link_to event.event_venue.title, event.event_venue.url
46
39
  - elsif event.location
47
- at
40
+ = t('at')
48
41
  = event.location
49
42
 
50
43
  - content_for :calendar do
@@ -52,10 +45,25 @@
52
45
  = render :partial => "events/minicalendar", :locals => {:date => period ? period.start : Date.today}
53
46
 
54
47
  - content_for :pagination do
55
- - if events.next_page || events.previous_page
56
- = will_paginate(events, :param_name => :p)
48
+ = will_paginate events
57
49
 
58
50
  - content_for :faceting do
59
51
  = render :partial => 'faceting'
60
52
 
61
- = render :partial => 'events/other_page_parts'
53
+ - content_for :title do
54
+ = t('pagetitle.calendar')
55
+
56
+ - content_for :full_title do
57
+ = t('events').titlecase
58
+ = list_description
59
+
60
+ - content_for :sidebar do
61
+ = yield :calendar
62
+ = yield :continuing_events
63
+
64
+
65
+ = yield :faceting
66
+ #events
67
+ = yield :pagination if events.previous_page
68
+ = yield :events
69
+ = yield :pagination if events.next_page
@@ -1,5 +1,11 @@
1
1
  en:
2
+ at: "at"
3
+ calendar: "calendar"
2
4
  refresh_calendar: "refresh calendar"
3
5
  edit_calendar: "edit calendar"
4
6
  delete_calendar: "delete calendar"
5
- really_delete_calendar: "Are you sure you want to delete the %{name} calendar?"
7
+ really_delete_calendar: "Are you sure you want to delete the %{name} calendar?"
8
+ sorry_no_events: "Sorry: there are no events to display"
9
+ runs_until: "runs until"
10
+ events: "events"
11
+ pagetitle.calendar: "Calendar"
@@ -1,5 +1,5 @@
1
1
  class EventCalendarExtension < Radiant::Extension
2
- version "1.3.6"
2
+ version "1.3.7"
3
3
  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.)"
4
4
  url "http://github.com/radiant/radiant-event_calendar-extension"
5
5
 
@@ -45,6 +45,72 @@ $input: $coolgrey11
45
45
 
46
46
  /*** calendars and maps *******
47
47
 
48
+ #events
49
+ .event
50
+ :position relative
51
+ :margin-bottom 20px
52
+ .dateholder
53
+ :position absolute
54
+ :left 15px
55
+ :top 2px
56
+ :padding 5px 5px 0 5px
57
+ :border 0
58
+ +functionalfonts
59
+ :text-align center
60
+ :line-height 1.05
61
+ :background-color = !page
62
+ :border
63
+ :style solid
64
+ :width 1px
65
+ :color = !verypale
66
+ span.month, span.dow
67
+ :display block
68
+ :font-weight lighter
69
+ :font-size 80%
70
+ :text-transform uppercase
71
+ span.day, span.dom
72
+ :display block
73
+ :font-weight bold
74
+ :font-size 160%
75
+ .detail
76
+ h3
77
+ :margin 0
78
+ :font-size 180%
79
+ p
80
+ :margin-top 0
81
+ :font-size 90%
82
+ :line-height 1.4
83
+ p.venue
84
+ :font-style italic
85
+ :margin-bottom 6px
86
+ p.description
87
+ :margin-bottom 16px
88
+
89
+ #continuing
90
+ h3
91
+ +functionalfonts
92
+ :font-weight bold
93
+ :font-size 1.2em
94
+ :margin-bottom 0
95
+ ul
96
+ +functionalfonts
97
+ :font-size 90%
98
+ :line-height 1.2
99
+ :padding-left 0
100
+ li
101
+ :margin-top 10px
102
+ :font-style normal
103
+ a.title
104
+ :font-weight bold
105
+ span.detail
106
+ :font-size 80%
107
+
108
+ #faceting
109
+ a.defilter
110
+ :padding-left 14px
111
+ :background transparent url(/images/furniture/detag.png) no-repeat top left
112
+ :color #c00
113
+
48
114
  table.minimonth
49
115
  font-style: normal
50
116
  border-collapse: collapse
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-event_calendar-extension}
8
- s.version = "1.3.6"
8
+ s.version = "1.3.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
12
- s.date = %q{2010-11-02}
12
+ s.date = %q{2011-02-03}
13
13
  s.description = %q{An event calendar extension that administers events locally or draws them from any ical or CalDAV publishers (Google Calendar, .Mac, Darwin Calendar Server, etc.)}
14
14
  s.email = %q{will@spanner.org}
15
15
  s.extra_rdoc_files = [
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: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 6
10
- version: 1.3.6
9
+ - 7
10
+ version: 1.3.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-02 00:00:00 +00:00
18
+ date: 2011-02-03 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency