radiant-event_calendar-extension 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.1.2
@@ -59,5 +59,3 @@
59
59
  = pagination_for @calendars
60
60
  %ul
61
61
  %li= link_to image('plus') + " " + "new calendar", new_admin_calendar_url
62
- %li= link_to "évent list", admin_events_url
63
- %li= link_to "venue list", admin_event_venues_url
@@ -32,5 +32,3 @@
32
32
  = pagination_for @event_venues
33
33
  %ul
34
34
  %li= link_to image('plus') + " " + "new venue", new_admin_event_venue_url
35
- %li= link_to "évent list", admin_events_url
36
- %li= link_to "calendar list", admin_calendars_url
@@ -31,9 +31,3 @@
31
31
  %input.button{:type=>"submit", :value=>"Delete location"}
32
32
  or
33
33
  = link_to 'Cancel', admin_event_venues_url
34
-
35
- #actions
36
- %ul
37
- %li= link_to "event list", admin_events_url
38
- %li= link_to "calendar list", admin_calendars_url
39
- %li= link_to "venue list", admin_event_venues_url
@@ -45,5 +45,3 @@
45
45
  = pagination_for @events
46
46
  %ul
47
47
  %li= link_to image('plus') + " " + "new event", new_admin_event_url
48
- %li= link_to "calendar list", admin_calendars_url
49
- %li= link_to "venue list", admin_event_venues_url
@@ -14,9 +14,3 @@
14
14
  %input.button{:type=>"submit", :value=>"Delete event"}/
15
15
  or
16
16
  = link_to 'Cancel', admin_events_url
17
-
18
- #actions
19
- %ul
20
- %li= link_to "event list", admin_events_url
21
- %li= link_to "calendar list", admin_calendars_url
22
- %li= link_to "venue list", admin_event_venues_url
@@ -24,7 +24,7 @@
24
24
  - if event.event_venue
25
25
  at
26
26
  - if event.event_venue.url
27
- = link_to event.event_venue.title, event.event_venue.url
27
+ = link_to event.event_venue.title, event.event_venue.url, :class => 'location'
28
28
  - else
29
29
  = event.event_venue.title
30
30
  = event.event_venue.address
@@ -1,5 +1,5 @@
1
1
  class EventCalendarExtension < Radiant::Extension
2
- version "1.1.1"
2
+ version "1.1.2"
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
 
@@ -27,8 +27,10 @@ class EventCalendarExtension < Radiant::Extension
27
27
  end
28
28
 
29
29
  if respond_to?(:tab)
30
- tab("Content") do
31
- add_item("Calendar", '/admin/event_calendar')
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
34
  end
33
35
  else
34
36
  admin.tabs.add "Calendar", '/admin/event_calendar', :after => "Snippets", :visibility => [:all]
@@ -69,6 +69,23 @@ module EventCalendarTags
69
69
  end
70
70
  result
71
71
  end
72
+
73
+ desc %{
74
+ Equivalent to calling events:each with a limit of 1. All the usual attributes are passed through.
75
+ If no events match the specification, nothing is returned.
76
+
77
+ To show the next event in a particular calendar:
78
+
79
+ <pre><code><r:events:first calendar="slug"><r:event:summary /></r:events:first></code></pre>
80
+ }
81
+
82
+ tag "events:first" do |tag|
83
+ tag.locals.events ||= get_events(tag)
84
+ if tag.locals.event = tag.locals.events.first
85
+ tag.locals.calendar = tag.locals.event.calendar
86
+ tag.expand
87
+ end
88
+ end
72
89
 
73
90
  tag "if_events" do | tag|
74
91
  tag.locals.events ||= get_events(tag)
@@ -442,7 +459,7 @@ module EventCalendarTags
442
459
  #todo: venue:* tags
443
460
 
444
461
  desc %{
445
- If the current event has a venue, this renders a sensible description and link. If not, it returns the location string.
462
+ Renders a sensible location string, based on whatever venue information is available.
446
463
 
447
464
  Usage:
448
465
  <pre><code><r:event:venue /></code></pre>
@@ -450,10 +467,12 @@ module EventCalendarTags
450
467
  tag "event:venue" do |tag|
451
468
  if venue = tag.locals.event.event_venue
452
469
  if venue.url
453
- %{<a href="#{venue.url}">#{venue.title}</a>, #{venue.address}}
470
+ html = %{<a class="location" href="#{venue.url}">#{venue.title}</a>}
454
471
  else
455
- %{#{venue.title}, #{venue.address}}
472
+ html = %{<span class="location">venue.title</span>}
456
473
  end
474
+ html << %{, <span class="address">#{venue.address}</span>} unless venue.address.blank?
475
+ html
457
476
  else
458
477
  tag.render('event:location')
459
478
  end
@@ -520,11 +539,7 @@ module EventCalendarTags
520
539
  <pre><code><r:event:time />: <r:event:title /></code></pre>
521
540
  }
522
541
  tag "event:time" do |tag|
523
- if tag.locals.event.all_day?
524
- "All day"
525
- else
526
- tag.locals.event.start_time
527
- end
542
+ tag.locals.event.summarize_start
528
543
  end
529
544
 
530
545
  [:start, :end].each do |attribute|
@@ -688,7 +703,7 @@ module EventCalendarTags
688
703
 
689
704
  def _datemark(date=Time.now)
690
705
  %{
691
- <div class="datemark"><span class="month">#{Date::ABBR_MONTHNAMES[date.month]}</span><span class="dom">#{"%02d" % date.mday}</span></div>
706
+ <div class="datemark"><span class="mon">#{Date::ABBR_MONTHNAMES[date.month]}</span><span class="dom">#{"%02d" % date.mday}</span></div>
692
707
  }
693
708
  end
694
709
 
@@ -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.1.1"
8
+ s.version = "1.1.2"
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-09-30}
12
+ s.date = %q{2010-10-05}
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 = [
@@ -98,6 +98,7 @@ Gem::Specification.new do |s|
98
98
  "pkg/radiant-event_calendar-extension-1.0.1.gem",
99
99
  "pkg/radiant-event_calendar-extension-1.0.2.gem",
100
100
  "pkg/radiant-event_calendar-extension-1.1.0.gem",
101
+ "pkg/radiant-event_calendar-extension-1.1.1.gem",
101
102
  "public/icals/blank",
102
103
  "public/images/admin/calendar.png",
103
104
  "public/images/event_calendar/calendarlinkbg.png",
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: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 1
10
- version: 1.1.1
9
+ - 2
10
+ version: 1.1.2
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-09-30 00:00:00 +01:00
18
+ date: 2010-10-05 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -181,6 +181,7 @@ files:
181
181
  - pkg/radiant-event_calendar-extension-1.0.1.gem
182
182
  - pkg/radiant-event_calendar-extension-1.0.2.gem
183
183
  - pkg/radiant-event_calendar-extension-1.1.0.gem
184
+ - pkg/radiant-event_calendar-extension-1.1.1.gem
184
185
  - public/icals/blank
185
186
  - public/images/admin/calendar.png
186
187
  - public/images/event_calendar/calendarlinkbg.png