tb_events 1.1.2 → 1.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/admin/events/application.js +16 -0
  3. data/app/assets/javascripts/{calendar_events.js → admin/events/calendar_events.js} +0 -0
  4. data/app/assets/javascripts/{spud/admin → admin/events}/calendars.js +0 -0
  5. data/app/assets/stylesheets/admin/events/application.css +4 -0
  6. data/app/assets/{javascripts/spud/events.js → stylesheets/admin/events/calendar_events.css} +0 -0
  7. data/app/assets/stylesheets/{spud → admin/events}/calendars.css +13 -27
  8. data/app/controllers/admin/calendars_controller.rb +1 -1
  9. data/app/helpers/admin/calendars_helper.rb +4 -4
  10. data/app/helpers/calendars_helper.rb +35 -42
  11. data/app/models/spud/spud_calendar_event_model.rb +2 -7
  12. data/app/models/spud_calendar.rb +18 -2
  13. data/app/views/admin/calendar_events/_calendar.html.erb +10 -4
  14. data/app/views/admin/calendar_events/_form.html.erb +15 -97
  15. data/app/views/admin/calendar_events/index.html.erb +18 -11
  16. data/app/views/admin/calendars/_calendar_legend.html.erb +5 -4
  17. data/app/views/admin/calendars/_form.html.erb +4 -19
  18. data/config/locales/en.yml +9 -0
  19. data/db/migrate/20140730182213_remove_color_from_spud_calendars.rb +8 -0
  20. data/lib/spud_events/calendar_builder.rb +1 -1
  21. data/lib/spud_events/engine.rb +2 -6
  22. data/lib/spud_events/version.rb +1 -1
  23. metadata +17 -47
  24. data/app/assets/javascripts/calendars.js +0 -2
  25. data/app/assets/javascripts/spud/admin/calendar_events.js +0 -2
  26. data/app/assets/javascripts/spud/admin/events.js +0 -51
  27. data/app/assets/lib/colorpicker/colorpicker.css +0 -164
  28. data/app/assets/lib/colorpicker/colorpicker.js +0 -484
  29. data/app/assets/lib/colorpicker/images/blank.gif +0 -0
  30. data/app/assets/lib/colorpicker/images/colorpicker_background.png +0 -0
  31. data/app/assets/lib/colorpicker/images/colorpicker_hex.png +0 -0
  32. data/app/assets/lib/colorpicker/images/colorpicker_hsb_b.png +0 -0
  33. data/app/assets/lib/colorpicker/images/colorpicker_hsb_h.png +0 -0
  34. data/app/assets/lib/colorpicker/images/colorpicker_hsb_s.png +0 -0
  35. data/app/assets/lib/colorpicker/images/colorpicker_indic.gif +0 -0
  36. data/app/assets/lib/colorpicker/images/colorpicker_overlay.png +0 -0
  37. data/app/assets/lib/colorpicker/images/colorpicker_rgb_b.png +0 -0
  38. data/app/assets/lib/colorpicker/images/colorpicker_rgb_g.png +0 -0
  39. data/app/assets/lib/colorpicker/images/colorpicker_rgb_r.png +0 -0
  40. data/app/assets/lib/colorpicker/images/colorpicker_select.gif +0 -0
  41. data/app/assets/lib/colorpicker/images/colorpicker_submit.png +0 -0
  42. data/app/assets/lib/colorpicker/images/custom_background.png +0 -0
  43. data/app/assets/lib/colorpicker/images/custom_hex.png +0 -0
  44. data/app/assets/lib/colorpicker/images/custom_hsb_b.png +0 -0
  45. data/app/assets/lib/colorpicker/images/custom_hsb_h.png +0 -0
  46. data/app/assets/lib/colorpicker/images/custom_hsb_s.png +0 -0
  47. data/app/assets/lib/colorpicker/images/custom_indic.gif +0 -0
  48. data/app/assets/lib/colorpicker/images/custom_rgb_b.png +0 -0
  49. data/app/assets/lib/colorpicker/images/custom_rgb_g.png +0 -0
  50. data/app/assets/lib/colorpicker/images/custom_rgb_r.png +0 -0
  51. data/app/assets/lib/colorpicker/images/custom_submit.png +0 -0
  52. data/app/assets/lib/colorpicker/images/select.png +0 -0
  53. data/app/assets/lib/colorpicker/images/select2.png +0 -0
  54. data/app/assets/lib/colorpicker/images/slider.png +0 -0
  55. data/app/assets/stylesheets/spud/admin/events.css +0 -16
  56. data/app/assets/stylesheets/spud/calendar_events.css +0 -18
  57. data/app/assets/stylesheets/spud/events.css +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9cce5c6d901c2e10830c45cee8f2fbe19b4b053
4
- data.tar.gz: e3e23097abe47c1a0e76d38799f5202d58810c87
3
+ metadata.gz: ce1daf8729504d0663c17b5eea3fe706f86965da
4
+ data.tar.gz: fa913c71926dacde2922cb5d538d64599968c512
5
5
  SHA512:
6
- metadata.gz: 7bf7eef8c225bdb0b76f87b06d4f7b7a6ed46a94e2ceaf9790f2dfde84cba76c27176bebe7e364185eb39a6d50b513074d190bf52a2fd934c492e64ec748de21
7
- data.tar.gz: a83743a64d224a4f1f221d1c980efb338869bf1bd91c48b6fa09eb4582595ae8fe261169bdcd1ea6b6fa5ab423e4f3f464562e5f6ec62e87b2c2a3b221eabd86
6
+ metadata.gz: c2f3c7f6768a50f6a29150c72cdbc13644c31c9d91dd8a4a18fecc4cef78c3ef90f251c7210ec08ea858d8490315438b5c8d8d3a1e7ad2798c73c40c4d983a61
7
+ data.tar.gz: 1a9e8432f194112a8051958f4d5a6710774f46de4ad04c42ffb729ab443a4ccc143a5a38d4792f39409813b736044cacb783da08864e1964c156c2866b2f4eb0
@@ -0,0 +1,16 @@
1
+ //= require_self
2
+ //= require_directory
3
+
4
+ (function(){
5
+
6
+ spud.admin.events = {
7
+ init: function(){
8
+ $(document).on('ajax:success','.js-spud-calendar-delete-action', deletedCalendar);
9
+ }
10
+ };
11
+
12
+ var deletedCalendar = function(){
13
+ $(this).closest('.spud_events_admin_calendar_legend_item').fadeOut(500, function(){ $(this).remove(); });
14
+ };
15
+
16
+ })();
@@ -0,0 +1,4 @@
1
+ /*
2
+ *= require_self
3
+ *= require_directory
4
+ */
@@ -49,10 +49,8 @@
49
49
 
50
50
  #spud_events_admin_calendar,
51
51
  #spud_events_calendar {
52
- width: 700px;
53
- padding-bottom: 50px;
52
+ margin: 0 0 20px;
54
53
  position: relative;
55
- float: left;
56
54
  }
57
55
  #spud_events_calendar {
58
56
  width: auto;
@@ -78,20 +76,23 @@
78
76
  vertical-align: top;
79
77
  width: 98px;
80
78
  }
81
- .spud_events_admin_calendar_date_container,
82
- .spud_events_calendar_date_container {
83
- display: block;
84
- padding: 18px 5px 0;
85
- position: relative;
86
- }
87
- span.spud_events_admin_calendar_date,
88
- span.spud_events_calendar_date {
79
+ .calendar-day{
89
80
  position: absolute;
90
81
  top: 3px;
91
- right: 3px;
82
+ left: 3px;
92
83
  font-size: 11px;
93
84
  line-height: 11px;
94
85
  }
86
+ .calendar-events-list{
87
+ list-style: none;
88
+ margin: 20px 0 0;
89
+ }
90
+ .calendar-events-list li{
91
+ margin: 4px;
92
+ }
93
+ .calendar-events-list a{
94
+ text-decoration: none;
95
+ }
95
96
 
96
97
  /* Calendar Legend
97
98
  ----------------------- */
@@ -100,7 +101,6 @@ span.spud_events_calendar_date {
100
101
  list-style: none;
101
102
  border: 1px solid #d9d9d9;
102
103
  padding: 0;
103
- margin: 45px 0 0 725px;
104
104
  }
105
105
  #spud_events_admin_calendar_legend li,
106
106
  #spud_events_calendar_legend li {
@@ -120,17 +120,3 @@ span.spud_events_calendar_date {
120
120
  #spud_events_calendar_legend li:last-child {
121
121
  border: none;
122
122
  }
123
- .spud_events_admin_calendar_actions,
124
- .spud_events_calendar_actions {
125
- text-align: right;
126
- }
127
-
128
- #spud_events_admin_calendar_legend span,
129
- #spud_events_calendar_legend span {
130
- display: inline-block;
131
- -moz-border-radius: 3px;
132
- -webkit-border-radius: 3px;
133
- border-radius: 3px;
134
- padding: 2px 8px;
135
- margin: 8px 0 0 8px;
136
- }
@@ -51,7 +51,7 @@ class Admin::CalendarsController < Admin::ApplicationController
51
51
  private
52
52
 
53
53
  def calendar_params
54
- params.require(:spud_calendar).permit(:title, :color)
54
+ params.require(:spud_calendar).permit(:title)
55
55
  end
56
56
 
57
57
  end
@@ -1,15 +1,15 @@
1
1
  module Admin::CalendarsHelper
2
2
 
3
- def link_to_previous_admin_calendar_month(date, url_for_options)
3
+ def link_to_previous_admin_calendar_month(date, url_for_options={})
4
4
  date = date.advance(:months => -1)
5
5
  calendar = params[:calendar] ? params[:calendar] : nil
6
- link_to('&laquo; Previous Month'.html_safe, admin_list_spud_calendar_events_path(:month => date.month, :year => date.year, :calendar => calendar), :class => 'spud_events_calendar_link previous_calendar btn').html_safe
6
+ link_to('&laquo; Previous Month'.html_safe, admin_list_spud_calendar_events_path(:month => date.month, :year => date.year, :calendar => calendar), :class => 'spud_events_calendar_link previous_calendar btn btn-sm btn-default').html_safe
7
7
  end
8
8
 
9
- def link_to_next_admin_calendar_month(date, url_for_options)
9
+ def link_to_next_admin_calendar_month(date, url_for_options={})
10
10
  date = date.advance(:months => 1)
11
11
  calendar = params[:calendar] ? params[:calendar] : nil
12
- link_to('Next Month &raquo;'.html_safe, admin_list_spud_calendar_events_path(:month => date.month, :year => date.year, :calendar => calendar), :class => 'spud_events_calendar_link next_calendar btn').html_safe
12
+ link_to('Next Month &raquo;'.html_safe, admin_list_spud_calendar_events_path(:month => date.month, :year => date.year, :calendar => calendar), :class => 'spud_events_calendar_link next_calendar btn btn-sm btn-default pull-right').html_safe
13
13
  end
14
14
 
15
15
  end
@@ -6,43 +6,56 @@ module CalendarsHelper
6
6
  # * opts:
7
7
  # - headers: Array of weekday headers (optional)
8
8
  #
9
- def spud_calendar_for_date(date, opts={})
10
- SpudEvents::CalendarBuilder.new(self, date, opts).table do |day|
11
- concat content_tag(:span, day.day.to_s, :class => 'calendar-day')
12
- if block_given?
13
- yield(day)
14
- end
15
- end
9
+ def spud_calendar_for_date(date, opts={}, &block)
10
+ events = SpudCalendarEvent.in_month_of(date)
11
+ spud_calendar_for_events(events, date, opts, &block)
16
12
  end
17
13
 
18
- # Builds a calendar for the given date, with events
14
+ # Builds a calendar for the given date and identifier
19
15
  #
20
- # * events: An array or relation of SpudCalendarEvent records
16
+ # * identifier: Symbol for the SpudCalendar you wish to display
21
17
  # * date: Determines the month to be displayed. Given date will have the "today" css class
22
18
  # * opts:
23
19
  # - headers: Array of weekday headers (optional)
24
20
  #
25
- def spud_calendar_for_events(events, date, opts={})
26
- events_grouped = events.group_by(&:start_date)
27
- builder = SpudEvents::CalendarBuilder.new(self, date, opts).table do |day|
28
- events = events_grouped[day] || []
29
- if block_given?
30
- yield(day, events)
31
- else
32
- ## TODO
33
- end
21
+ def spud_calendar_for_identifier(identifier, date, opts={}, &block)
22
+ calendar = SpudCalendar.with_identifier(identifier)
23
+ if calendar.present?
24
+ events = calendar.spud_calendar_events.in_month_of(date)
25
+ else
26
+ logger.warn "Failed to load calendar by identifer '#{identifier}'. Does it exist?"
27
+ events = []
34
28
  end
29
+ spud_calendar_for_events(events, date, opts, &block)
35
30
  end
36
31
 
37
- # Builds a calendar for the given date
32
+ # Builds a calendar for the given date, with events
38
33
  #
39
- # * identifier: Symbol for the SpudCalendar you wish to display
34
+ # * events: An array or relation of SpudCalendarEvent records
40
35
  # * date: Determines the month to be displayed. Given date will have the "today" css class
41
36
  # * opts:
42
37
  # - headers: Array of weekday headers (optional)
43
38
  #
44
- def spud_calendar_for_identifier(identifier, date, opts)
45
- ## TODO
39
+ def spud_calendar_for_events(events, date, opts={}, &block)
40
+ events_grouped = events.group_by(&:start_date)
41
+ cache(['spud-calendar', date.to_s, events]) do
42
+ concat(
43
+ SpudEvents::CalendarBuilder.new(self, date, opts).table do |day|
44
+ events = events_grouped[day] || []
45
+ if block
46
+ block.call(day, events)
47
+ else
48
+ concat content_tag(:span, day.day.to_s, :class => 'calendar-day')
49
+ if events.length > 0
50
+ list_items = events.collect{ |event|
51
+ '<li>' + link_to(event.title, calendar_event_path(event)) + '</li>'
52
+ }.join('')
53
+ concat content_tag(:ul, raw(list_items), :class => 'events-list')
54
+ end
55
+ end
56
+ end
57
+ )
58
+ end
46
59
  end
47
60
 
48
61
  def link_to_previous_calendar_month(date)
@@ -57,24 +70,4 @@ module CalendarsHelper
57
70
  link_to('Next Month &raquo;'.html_safe, calendar_path(:month => date.month, :year => date.year, :calendar => calendar), :class => 'spud_events_calendar_link next_calendar btn').html_safe
58
71
  end
59
72
 
60
- def calendar_fore_color(backcolor)
61
- fore_color = "ffffff"
62
- if backcolor.length != 6
63
- return fore_color
64
- end
65
-
66
- red = backcolor[0,2].hex
67
- green = backcolor[2,2].hex
68
- blue = backcolor[4,2].hex
69
-
70
- perceived_brightness = Math.sqrt(red*red*0.241 + green*green*0.691 + blue*blue*0.068)
71
-
72
-
73
- # average = (red+green+blue) / 3
74
- if(perceived_brightness >= 130)
75
- return "000000"
76
- else
77
- return fore_color
78
- end
79
- end
80
73
  end
@@ -5,14 +5,9 @@ class Spud::SpudCalendarEventModel < ActiveRecord::Base
5
5
  validates_presence_of :title, :start_at, :end_at, :spud_calendar_id
6
6
 
7
7
  scope :ordered, ->{ order('start_at desc') }
8
+ scope :in_month_of, ->(date){ where(:start_at => date.beginning_of_month...date.end_of_month) }
8
9
  scope :upcoming, ->(limit=false){ where('start_at >= ?', Date.today).order('start_at asc').limit(limit) }
9
- scope :in_month_of, ->(date){
10
- first = date.beginning_of_month
11
- range_start = Time.zone.local(first.year, first.month, first.day)
12
- range_end = range_start.end_of_month
13
- where(:start_at => range_start..range_end)
14
- }
15
-
10
+
16
11
  def start_date
17
12
  return start_at.to_date
18
13
  end
@@ -1,11 +1,27 @@
1
1
  class SpudCalendar < ActiveRecord::Base
2
2
  has_many :spud_calendar_events, :dependent => :destroy
3
- validates_presence_of :title, :color
3
+ validates_presence_of :title
4
4
  validates :identifier, :presence => true, :uniqueness => true
5
5
 
6
6
  before_validation :set_identifier
7
7
 
8
- scope :with_identifier, ->(identifier){ where(:identifier => identifier).first }
8
+ def self.with_identifier(identifier)
9
+ where(:identifier => identifier).first
10
+ end
11
+
12
+ def color
13
+ modulo = (self.id-1) % COLORS.length
14
+ return COLORS[modulo]
15
+ end
16
+
17
+ COLORS = [
18
+ '4D854B',
19
+ 'f89406',
20
+ 'b94a48',
21
+ '3a87ad',
22
+ '999999',
23
+ '333333'
24
+ ]
9
25
 
10
26
  private
11
27
 
@@ -1,13 +1,19 @@
1
- <p><%= link_to_next_admin_calendar_month(@calendar_date, :class => "btn") %></p>
2
- <p><%= link_to_previous_admin_calendar_month(@calendar_date, :class => "btn") %></p>
1
+ <%= link_to_next_admin_calendar_month @calendar_date %>
2
+ <%= link_to_previous_admin_calendar_month @calendar_date %>
3
3
 
4
4
  <%= spud_calendar_for_events(@calendar_events, @calendar_date, :headers => ['S', 'M', 'T', 'W', 'T', 'F', 'S']) do |day, events| %>
5
5
  <span class="calendar-day">
6
6
  <%= day.day %>
7
7
  </span>
8
- <ul class="calendar-events">
8
+ <ul class="calendar-events-list">
9
9
  <% events.each do |event| %>
10
- <li><%= link_to truncate(event.title, :length => 25), edit_admin_calendar_event_path(event.id) %></li>
10
+ <li>
11
+ <%= link_to edit_admin_calendar_event_path(event.id) do %>
12
+ <span class="label" style="background-color: #<%= event.spud_calendar.color %>">
13
+ <%= truncate(event.title, :length => 25) %>
14
+ </span>
15
+ <% end %>
16
+ </li>
11
17
  <% end %>
12
18
  </ul>
13
19
  <% end %>
@@ -1,103 +1,21 @@
1
- <%= form_for @calendar_event, :url => path, :html=>{:class=>"form-horizontal"} do |f| %>
2
- <%= error_messages_for(f.object) %>
3
- <fieldset>
4
- <legend>Details</legend>
5
- <div class="control-group">
6
- <%= f.label :spud_calender_id, "Calendar",:class => "control-label" %>
7
- <div class="controls">
8
- <%= f.select(:spud_calendar_id, options_from_collection_for_select(SpudCalendar.all, :id, :title, @calendar_event.spud_calendar_id)) %>
9
- </div>
10
- </div>
11
- <div class="control-group">
12
- <%= f.label :title,:class => "control-label" %>
13
- <div class="controls">
14
- <%= f.text_field :title %>
15
- </div>
16
- </div>
17
- <div class="control-group">
18
- <%= f.label :description,:class => "control-label" %>
19
- <div class="controls">
20
- <%= f.text_area :description, :rows => 5 %>
21
- </div>
22
- </div>
23
- </fieldset>
1
+ <%= form_for @calendar_event, :url => path, :builder => TbCore::FormBuilder, :html => {:class => "form-horizontal"} do |f| %>
2
+ <%= tb_form_error_header(f.object) %>
24
3
 
25
- <fieldset>
26
- <legend>Event Time</legend>
4
+ <%= f.tb_select :spud_calendar_id, options_from_collection_for_select(SpudCalendar.all, :id, :title, @calendar_event.spud_calendar_id) %>
27
5
 
28
- <div class="control-group">
29
- <%= f.label :start_at, "Starts",:class => "control-label" %>
30
- <div class="controls">
31
- <%= f.text_field :start_at,:value => f.object.start_at.blank? ? Time.now.strftime("%Y-%m-%d %H:%M") : f.object.start_at.strftime("%Y-%m-%d %H:%M") , :class => 'spud_form_date_picker' %>
32
- <span class="time_select">
33
- <%= f.time_select :start_at, :ignore_date => true,:ampm => true%>
34
- </span>
35
- </div>
36
- </div>
37
- <div class="control-group">
38
- <%= f.label :end_at, "Ends",:class => "control-label" %>
6
+ <%= f.tb_text_field :title %>
7
+ <%= f.tb_text_area :description %>
39
8
 
40
- <div class="controls">
41
- <%= f.text_field :end_at,:value => f.object.end_at.blank? ? Time.now.strftime("%Y-%m-%d %H:%M") : f.object.end_at.strftime("%Y-%m-%d %H:%M") , :class => 'spud_form_date_picker' %>
42
- <span class="time_select">
43
- <%= f.time_select :end_at, :ignore_date => true,:ampm => true%>
44
- </span>
45
- </div>
46
- </div>
47
- </fieldset>
48
- <fieldset>
49
- <legend>Location</legend>
50
- <div class="control-group">
51
- <%= f.label :location,:class => "control-label" %>
52
- <div class="controls">
53
- <%= f.text_field :location %>
54
- </div>
55
- </div>
56
- <div class="control-group">
57
- <%= f.label :address,:class => "control-label" %>
58
- <div class="controls">
59
- <%= f.text_field :address %>
60
- </div>
61
- </div>
62
- <div class="control-group">
63
- <%= f.label :address_2,:class => "control-label" %>
64
- <div class="controls">
65
- <%= f.text_field :address_2 %>
66
- </div>
67
- </div>
68
- <div class="control-group">
69
- <%= f.label :city,:class => "control-label" %>
70
- <div class="controls">
71
- <%= f.text_field :city %>
72
- </div>
73
- </div>
74
- <div class="control-group">
75
- <%= f.label :state,:class => "control-label" %>
76
- <div class="controls">
77
- <%= f.text_field :state %>
78
- </div>
79
- </div>
80
- <div class="control-group">
81
- <%= f.label :zip,:class => "control-label" %>
82
- <div class="controls">
83
- <%= f.text_field :zip %>
84
- </div>
85
- </div>
86
- </fieldset>
9
+ <%= f.tb_datetime_select :start_at, :ampm => true, :minute_step => 5 %>
10
+ <%= f.tb_datetime_select :end_at, :ampm => true, :minute_step => 5 %>
87
11
 
88
- <div class="form-actions">
89
- <%= f.submit "Save", :class=>"btn btn-primary"%>
90
- <%=link_to "cancel",admin_list_spud_calendar_events_path,:class => "btn"%>
91
- <% if !@calendar_event.new_record? %>
92
- or
93
- <%= link_to "Delete", admin_calendar_event_path(@calendar_event), :method=>:delete,:class => "btn btn-danger", :data => {:confirm=>"Are you sure you want delete this event?"} %>
94
- <% end %>
95
- </div>
12
+ <%= f.tb_text_field :location %>
13
+ <%= f.tb_text_field :address %>
14
+ <%= f.tb_text_field :address_2 %>
15
+ <%= f.tb_text_field :city %>
16
+ <%= f.tb_text_field :state %>
17
+ <%= f.tb_text_field :zip %>
18
+
19
+ <%= f.tb_save_buttons 'Event', admin_list_spud_calendar_events_path %>
96
20
 
97
21
  <% end %>
98
- <br class="clear" />
99
- <script type="text/javascript">
100
- $(document).ready(function(){
101
- spud.admin.date_picker.init();
102
- });
103
- </script>
@@ -1,21 +1,28 @@
1
+ <% @page_name = "Events - #{@calendar_date.strftime('%B %Y')}" %>
2
+
1
3
  <%= content_for :data_controls do %>
2
- <%= link_to "New Event", new_admin_calendar_event_path, :class => "btn right" %>
4
+ <%= link_to "New Calendar", new_admin_calendar_path, :class => "btn btn-default" %>
5
+ <%= link_to "New Event", new_admin_calendar_event_path, :class => "btn btn-primary" %>
3
6
  <% end %>
4
7
 
5
8
  <%= content_for :detail do %>
6
9
 
7
- <h3>Calendar Events - <%= @calendar_date.strftime('%B %Y') %></h3>
10
+ <div class="row">
11
+ <div id="spud_events_admin_calendar" class="col-md-8">
12
+ <%= render :partial => 'calendar' %>
13
+ </div>
8
14
 
9
- <div id="spud_events_admin_calendar">
10
- <%= render :partial => 'calendar' %>
15
+ <div class="col-md-4">
16
+ <ul id="spud_events_admin_calendar_legend">
17
+ <%= render :partial => 'admin/calendars/calendar_legend', :collection => @calendars, :as => :calendar %>
18
+ </ul>
19
+ </div>
11
20
  </div>
12
21
 
13
- <ul id="spud_events_admin_calendar_legend">
14
- <%= render :partial => 'admin/calendars/calendar_legend', :collection => @calendars, :as => :calendar %>
15
- <li>
16
- <%= link_to("New Calendar", new_admin_calendar_path, :class => "btn btn-primary btn-small pull-right") %>
17
- <br style="clear:right;"/>
18
- </li>
19
- </ul>
22
+ <script>
23
+ $(document).ready(function() {
24
+ spud.admin.events.init();
25
+ });
26
+ </script>
20
27
 
21
28
  <% end %>