radiant-event_calendar-extension 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/controllers/admin/events_controller.rb +8 -2
- data/app/controllers/admin/icals_controller.rb +2 -2
- data/app/controllers/events_controller.rb +1 -1
- data/app/models/event.rb +30 -14
- data/app/models/event_venue.rb +5 -7
- data/app/models/ical.rb +6 -2
- data/app/views/admin/calendars/_form.html.haml +49 -35
- data/app/views/admin/calendars/edit.html.haml +0 -1
- data/app/views/admin/event_venues/_event_venue.html.haml +1 -1
- data/app/views/admin/event_venues/_form.html.haml +36 -32
- data/app/views/admin/event_venues/edit.html.haml +6 -1
- data/app/views/admin/event_venues/new.html.haml +6 -1
- data/app/views/admin/events/_event.html.haml +6 -11
- data/app/views/admin/events/_form.html.haml +87 -83
- data/app/views/admin/events/edit.html.haml +6 -1
- data/app/views/admin/events/new.html.haml +6 -1
- data/app/views/events/_event.html.haml +11 -3
- data/db/migrate/20100216080944_more_event_data.rb +1 -1
- data/db/migrate/20100927140126_amended_events.rb +11 -0
- data/db/migrate/20100927203940_calendar_keywords.rb +14 -0
- data/lib/event_calendar_admin_ui.rb +4 -4
- data/pkg/radiant-event_calendar-extension-1.0.2.gem +0 -0
- data/public/stylesheets/sass/event_calendar.sass +278 -202
- data/radiant-event_calendar-extension.gemspec +5 -2
- metadata +6 -3
@@ -1,6 +1,3 @@
|
|
1
|
-
- include_stylesheet "admin/event_calendar"
|
2
|
-
- include_javascript "admin/event_calendar"
|
3
|
-
|
4
1
|
- if defined? TinyMceFilter
|
5
2
|
- include_javascript "tiny_mce/tiny_mce"
|
6
3
|
- include_javascript "tiny_mce/tiny_mce_settings"
|
@@ -10,104 +7,111 @@
|
|
10
7
|
- @event.event_venue ||= EventVenue.new
|
11
8
|
- @event.recurrence_rules.build unless @event.recurrence_rules.any?
|
12
9
|
|
13
|
-
-
|
14
|
-
= f.hidden_field :lock_version
|
15
|
-
= render_region :form_top
|
16
|
-
|
17
|
-
#event_form.form-area.container_12
|
18
|
-
- render_region :form do |form|
|
10
|
+
- imported = @event.status == Status[:imported]
|
19
11
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
= f.text_field :title, :class => 'textbox'
|
25
|
-
%p.keywords
|
26
|
-
= f.label :keywords, "Tags"
|
27
|
-
= f.text_field :keywords, :class => 'textbox'
|
12
|
+
- if imported
|
13
|
+
%p
|
14
|
+
This event comes from a calendar subscription, but you can add keywords here and give more information about its location.
|
15
|
+
Please note that changes to the location will affect any other events linked to the same place.
|
28
16
|
|
29
|
-
|
30
|
-
%p.url
|
31
|
-
= f.label :url, "Link to"
|
32
|
-
= f.text_field :url, :class => 'textbox'
|
17
|
+
= render_region :form_top
|
33
18
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
= f.select :calendar_id, Calendar.all.map {|c| [c.name, c.id]}, {:include_blank => true}, :class => 'textbox'
|
43
|
-
%span.note
|
44
|
-
This is optional but can be used to file your events or to mix local events into a subscribed calendar.
|
45
|
-
|
19
|
+
#event_form.form-area
|
20
|
+
.main
|
21
|
+
- render_region :form do |form|
|
22
|
+
- form.edit_event do
|
23
|
+
%p.title
|
24
|
+
= f.label :title, "Title"
|
25
|
+
= f.text_field :title, :class => 'textbox', :disabled => imported
|
26
|
+
|
46
27
|
- form.edit_date do
|
47
|
-
.
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
%p.end_date
|
56
|
-
= f.label :end_date, "end date and time"
|
57
|
-
= f.text_field :end_date, :class => 'textbox date time'
|
58
|
-
%p#event_note.note
|
59
|
-
If you specify an end date and later change the start date, the end will shift to preserve the event's duration.
|
28
|
+
%p.start_date
|
29
|
+
= f.label :start_date, "Start date and time"
|
30
|
+
= f.text_field :start_date, :class => 'textbox date time', :disabled => imported
|
31
|
+
= f.check_box :all_day, :disabled => imported
|
32
|
+
= f.label :all_day, 'All-day event?', :class => 'minor'
|
33
|
+
%p.end_date
|
34
|
+
= f.label :end_date, "end date and time"
|
35
|
+
= f.text_field :end_date, :class => 'textbox date time', :disabled => imported
|
60
36
|
|
61
37
|
.recurrence
|
62
38
|
- f.fields_for :recurrence_rules do |rf|
|
63
|
-
|
39
|
+
|
64
40
|
%p.recurrence
|
65
|
-
= rf.check_box 'active', :class => 'toggle', :rel => "toggle[recurrence_detail]", :
|
41
|
+
= rf.check_box 'active', :class => 'toggle', :rel => "toggle[recurrence_detail]", :disabled => imported
|
66
42
|
= rf.label :active, 'Repeats', :class => 'minor'
|
67
43
|
%span.note
|
68
44
|
(this is for separate similar events. For events that span several days you only need to set the start and end.)
|
69
|
-
|
70
|
-
%span#recurrence_detail
|
71
|
-
%span#recurrence_interval
|
72
|
-
= rf.label :interval, "Every"
|
73
|
-
= rf.text_field :interval, :class => 'textbox short'
|
74
|
-
%span#recurrence_period
|
75
|
-
= rf.label :period, " "
|
76
|
-
= rf.select :period, [['day', 'daily'], ['week', 'weekly'], ['month', 'monthly'], ['year', 'yearly']], {}, :class => 'textbox'
|
77
|
-
%span#recurrence_basis
|
78
|
-
= rf.label :basis, " "
|
79
|
-
= rf.select :basis, [['forever', 'unbounded'],['until', 'limit'], ['for', 'count']], {}, :class => 'textbox basis'
|
80
|
-
%span#recurrence_unbounded
|
81
|
-
%span#recurrence_limit
|
82
|
-
= rf.label :limiting_date, " "
|
83
|
-
= rf.text_field :limiting_date, :class => 'textbox date'
|
84
|
-
%span#recurrence_count
|
85
|
-
= rf.label :limiting_count, "this many times:", :class => 'inline'
|
86
|
-
= rf.text_field :limiting_count, :class => 'textbox short'
|
87
45
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
46
|
+
%p#recurrence_detail
|
47
|
+
%span#recurrence_interval
|
48
|
+
= rf.label :interval, "Repeats every"
|
49
|
+
= rf.text_field :interval, :class => 'textbox short'
|
50
|
+
%span#recurrence_period
|
51
|
+
= rf.label :period, " "
|
52
|
+
= rf.select :period, [['day', 'daily'], ['week', 'weekly'], ['month', 'monthly'], ['year', 'yearly']], {}, :class => 'textbox'
|
53
|
+
%span#recurrence_basis
|
54
|
+
= rf.label :basis, " "
|
55
|
+
= rf.select :basis, [['forever', 'unbounded'],['until', 'limit'], ['for', 'count']], {}, :class => 'textbox basis'
|
56
|
+
%span#recurrence_unbounded
|
57
|
+
%span#recurrence_limit
|
58
|
+
= rf.label :limiting_date, " "
|
59
|
+
= rf.text_field :limiting_date, :class => 'textbox date'
|
60
|
+
%span#recurrence_count
|
61
|
+
= rf.label :limiting_count, "this many times:", :class => 'inline'
|
62
|
+
= rf.text_field :limiting_count, :class => 'textbox short'
|
63
|
+
|
64
|
+
- form.edit_description do
|
65
|
+
%p.description
|
66
|
+
- if !imported && defined? TinyMceFilter
|
67
|
+
= link_to image('mce', :alt=> 'toolbar icon'), '#', :class => 'toggleMCE', :rel => 'toggle[event_description]'
|
68
|
+
= f.label :description, "Description"
|
69
|
+
= f.text_area :description, :class => 'textarea', :style => "width: 100%; height: 8em;", :disabled => imported
|
70
|
+
|
71
|
+
- render_region :form_bottom do |form_bottom|
|
72
|
+
- form_bottom.edit_metadata do
|
73
|
+
.metadata
|
74
|
+
%p.keywords
|
75
|
+
= f.label :keywords
|
76
|
+
= f.text_field :keywords, :class => "textbox"
|
77
|
+
%p.calendar
|
78
|
+
= f.label :calendar_id, "Calendar"
|
79
|
+
= f.select :calendar_id, Calendar.all.map {|c| [c.name, c.id]}, {:include_blank => true}, :class => 'textbox', :disabled => imported
|
80
|
+
%br
|
81
|
+
%span.note
|
82
|
+
This is optional but can be used to file your events or to mix local events into a subscribed calendar.
|
83
|
+
%p.url
|
84
|
+
= f.label :url, "Event url"
|
85
|
+
= f.text_field :url, :class => 'textbox', :disabled => imported
|
86
|
+
|
87
|
+
- form_bottom.edit_venue do
|
88
|
+
- toggle_precedence = %w{venue new_venue}
|
89
|
+
- toggle_precedence.reverse! if @venues.empty? || @event.event_venue.new_record?
|
90
|
+
|
91
|
+
- if imported
|
92
|
+
- f.fields_for :event_venue, @event.event_venue do |ef|
|
93
|
+
= render :partial => 'admin/event_venues/form', :locals => {:event_venue => @event.event_venue, :f => ef, :or_choose => false, :compact => true}
|
94
|
+
|
95
|
+
- else
|
96
|
+
-if @venues.any?
|
97
|
+
#venue.main
|
94
98
|
%p#existing_venue
|
95
99
|
= f.label :event_venue_id, "Choose a place"
|
96
|
-
= f.select :event_venue_id, @venues.map {|v| [v.title, v.id]}, {:include_blank => true}, :class => 'textbox'
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
= f.select :event_venue_id, @venues.map {|v| [v.title, v.id]}, {:include_blank => true}, :class => 'textbox', :disabled => imported
|
101
|
+
- if imported
|
102
|
+
= link_to "edit this location", admin_event_venue_url(@event.event_venue)
|
103
|
+
to add title, description and directions
|
104
|
+
- else
|
105
|
+
= link_to "add a new place", new_admin_event_venue_url, :class => 'swapper', :rel => "toggle[#{toggle_precedence.join(',')}]"
|
103
106
|
#new_venue
|
104
|
-
-
|
105
|
-
- f.fields_for :event_venue, event_venue do |ef|
|
106
|
-
= render :partial => 'admin/event_venues/form', :locals => {:event_venue => event_venue, :f => ef, :or_choose => @venues.any?, :compact => true}
|
107
|
+
- @event.build_event_venue unless @event.event_venue
|
108
|
+
- f.fields_for :event_venue, @event.event_venue do |ef|
|
109
|
+
= render :partial => 'admin/event_venues/form', :locals => {:event_venue => @event.event_venue, :f => ef, :or_choose => @venues.any?, :compact => true}
|
110
|
+
|
107
111
|
|
108
|
-
- render_region :form_bottom do |form_bottom|
|
109
112
|
- form_bottom.edit_timestamp do
|
110
113
|
= updated_stamp @event
|
114
|
+
|
111
115
|
- form_bottom.edit_buttons do
|
112
116
|
%p.buttons
|
113
117
|
= save_model_button(@event)
|
@@ -1,6 +1,11 @@
|
|
1
|
+
- include_stylesheet "admin/event_calendar"
|
2
|
+
- include_javascript "admin/event_calendar"
|
3
|
+
|
1
4
|
- render_region :main do |main|
|
2
5
|
- main.edit_header do
|
3
6
|
%h1
|
4
7
|
Edit Event
|
8
|
+
|
5
9
|
- main.edit_form do
|
6
|
-
|
10
|
+
- form_for :event, @event, :url => admin_event_path(@calendar), :html => { :method => "put", :multipart => true } do |f|
|
11
|
+
= render :partial => 'form', :locals => { :f => f }
|
@@ -1,6 +1,11 @@
|
|
1
|
+
- include_stylesheet "admin/event_calendar"
|
2
|
+
- include_javascript "admin/event_calendar"
|
3
|
+
|
1
4
|
- render_region :main do |main|
|
2
5
|
- main.edit_header do
|
3
6
|
%h1
|
4
7
|
Add an event to the calendar
|
8
|
+
|
5
9
|
- main.edit_form do
|
6
|
-
|
10
|
+
- form_for :event, @event, :url => admin_events_path do |f|
|
11
|
+
= render :partial => "form", :locals => { :f => f }
|
@@ -17,13 +17,21 @@
|
|
17
17
|
= link_to event.title, event.url, :class => 'title'
|
18
18
|
- else
|
19
19
|
= event.title
|
20
|
+
- event.attached_tags.each do |tag|
|
21
|
+
%span.tag
|
22
|
+
= tag.name
|
23
|
+
|
20
24
|
%p.practicalities
|
21
25
|
= event.summarize_start
|
22
26
|
- if event.event_venue
|
23
|
-
|
24
|
-
|
27
|
+
at
|
28
|
+
- if event.event_venue.url
|
29
|
+
= link_to event.event_venue.title, event.event_venue.url
|
30
|
+
- else
|
31
|
+
= event.event_venue.title
|
25
32
|
= event.event_venue.address
|
26
|
-
|
33
|
+
- elsif event.location
|
34
|
+
= event.location
|
27
35
|
- unless repeating
|
28
36
|
= event.description_paragraph
|
29
37
|
|
@@ -7,7 +7,7 @@ class MoreEventData < ActiveRecord::Migration
|
|
7
7
|
add_column :events, :keywords, :string
|
8
8
|
add_column :events, :contact, :string
|
9
9
|
add_column :events, :postcode, :string
|
10
|
-
add_column :events, :lock_version, :integer
|
10
|
+
add_column :events, :lock_version, :integer, :default => 0
|
11
11
|
add_column :events, :created_by_id, :integer
|
12
12
|
add_column :events, :created_at, :datetime
|
13
13
|
add_column :events, :updated_by_id, :integer
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CalendarKeywords < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :calendars, :keywords, :string
|
4
|
+
add_column :event_venues, :keywords, :string
|
5
|
+
add_column :event_venues, :location, :string
|
6
|
+
add_index :event_venues, :location
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_column :calendars, :keywords
|
11
|
+
remove_column :event_venues, :keywords
|
12
|
+
remove_column :event_venues, :location
|
13
|
+
end
|
14
|
+
end
|
@@ -23,8 +23,8 @@ module EventCalendarAdminUI
|
|
23
23
|
returning OpenStruct.new do |calendar|
|
24
24
|
calendar.edit = Radiant::AdminUI::RegionSet.new do |edit|
|
25
25
|
edit.main.concat %w{edit_header edit_form}
|
26
|
-
edit.form.concat %w{edit_name edit_ical}
|
27
|
-
edit.form_bottom.concat %w{edit_timestamp edit_buttons}
|
26
|
+
edit.form.concat %w{edit_name edit_ical edit_filing edit_description}
|
27
|
+
edit.form_bottom.concat %w{edit_metadata edit_timestamp edit_buttons}
|
28
28
|
end
|
29
29
|
calendar.index = Radiant::AdminUI::RegionSet.new do |index|
|
30
30
|
index.thead.concat %w{name_header url_header refresh_header action_header}
|
@@ -40,8 +40,8 @@ module EventCalendarAdminUI
|
|
40
40
|
returning OpenStruct.new do |event|
|
41
41
|
event.edit = Radiant::AdminUI::RegionSet.new do |edit|
|
42
42
|
edit.main.concat %w{edit_header edit_form}
|
43
|
-
edit.form.concat %w{edit_event edit_date
|
44
|
-
edit.form_bottom.concat %w{edit_timestamp edit_buttons}
|
43
|
+
edit.form.concat %w{edit_event edit_date edit_description}
|
44
|
+
edit.form_bottom.concat %w{edit_metadata edit_venue edit_timestamp edit_buttons}
|
45
45
|
end
|
46
46
|
event.index = Radiant::AdminUI::RegionSet.new do |index|
|
47
47
|
index.top.concat %w{help_text}
|
Binary file
|