event_calendar_engine 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. data/Gemfile +23 -0
  2. data/Gemfile.lock +161 -0
  3. data/README +1 -0
  4. data/Rakefile +39 -0
  5. data/VERSION +1 -0
  6. data/app/controllers/application_controller.rb +4 -0
  7. data/app/controllers/attendees_controller.rb +53 -0
  8. data/app/controllers/event_calendar/application_controller.rb +5 -0
  9. data/app/controllers/event_revisions_controller.rb +26 -0
  10. data/app/controllers/events_controller.rb +129 -0
  11. data/app/helpers/event_calendar/application_helper.rb +118 -0
  12. data/app/helpers/events_helper.rb +2 -0
  13. data/app/models/attendee.rb +6 -0
  14. data/app/models/deletable_instance_methods.rb +7 -0
  15. data/app/models/event.rb +124 -0
  16. data/app/models/event_revision.rb +9 -0
  17. data/app/models/participant.rb +23 -0
  18. data/app/models/participator.rb +20 -0
  19. data/app/views/attendees/index.html.erb +14 -0
  20. data/app/views/attendees/new.html.erb +13 -0
  21. data/app/views/event-calendar-shared/_flash.html.erb +7 -0
  22. data/app/views/event-calendar-shared/_main_menu.html.erb +3 -0
  23. data/app/views/event-calendar-shared/_navigation.html.erb +15 -0
  24. data/app/views/event_revisions/index.html.erb +31 -0
  25. data/app/views/event_revisions/show.html.erb +5 -0
  26. data/app/views/events/_browse_event_revisions.html.erb +19 -0
  27. data/app/views/events/_event.html.erb +10 -0
  28. data/app/views/events/_event_details.html.erb +26 -0
  29. data/app/views/events/_form.html.erb +36 -0
  30. data/app/views/events/attendees.html.erb +29 -0
  31. data/app/views/events/edit.html.erb +3 -0
  32. data/app/views/events/index.html.erb +41 -0
  33. data/app/views/events/new.html.erb +3 -0
  34. data/app/views/events/search.html.erb +11 -0
  35. data/app/views/events/show.html.erb +30 -0
  36. data/app/views/layouts/application.html.erb +49 -0
  37. data/config/application.rb +42 -0
  38. data/config/blueprint_settings.yml +10 -0
  39. data/config/boot.rb +13 -0
  40. data/config/cucumber.yml +8 -0
  41. data/config/database.example.yml +22 -0
  42. data/config/environment.rb +5 -0
  43. data/config/environments/development.rb +26 -0
  44. data/config/environments/production.rb +49 -0
  45. data/config/environments/test.rb +38 -0
  46. data/config/initializers/backtrace_silencers.rb +7 -0
  47. data/config/initializers/formtastic.rb +55 -0
  48. data/config/initializers/inflections.rb +10 -0
  49. data/config/initializers/mime_types.rb +5 -0
  50. data/config/initializers/secret_token.rb +9 -0
  51. data/config/initializers/session_store.rb +10 -0
  52. data/config/locales/en.yml +5 -0
  53. data/config/routes.rb +67 -0
  54. data/db/migrate/20101011142543_create_events.rb +19 -0
  55. data/db/migrate/20101011172027_create_attendees.rb +16 -0
  56. data/db/migrate/20101011200048_make_events_revisable.rb +25 -0
  57. data/db/schema.rb +45 -0
  58. data/db/seeds.rb +7 -0
  59. data/lib/event_calendar.rb +3 -0
  60. data/lib/event_calendar/engine.rb +25 -0
  61. data/lib/generators/event_calendar/install/USAGE +5 -0
  62. data/lib/generators/event_calendar/install/install_generator.rb +19 -0
  63. data/lib/generators/event_calendar/install/templates/event_calendar.rake +169 -0
  64. data/lib/tasks/blueprint.rake +25 -0
  65. data/lib/tasks/cucumber.rake +53 -0
  66. data/public/404.html +26 -0
  67. data/public/422.html +26 -0
  68. data/public/500.html +26 -0
  69. data/public/favicon.ico +0 -0
  70. data/public/images/rails.png +0 -0
  71. data/public/javascripts/event_calendar.js +62 -0
  72. data/public/javascripts/event_calendar_behaviors.js +131 -0
  73. data/public/javascripts/fullcalendar.js +3965 -0
  74. data/public/javascripts/jquery-ui-1.7.2.custom.min.js +298 -0
  75. data/public/javascripts/jquery.clonePosition.js +27 -0
  76. data/public/javascripts/jquery.js +154 -0
  77. data/public/javascripts/jquery.qtip-1.0.0-rc3.js +2149 -0
  78. data/public/javascripts/jquery.string.1.0-min.js +6 -0
  79. data/public/javascripts/jquery.tablesorter.min.js +2 -0
  80. data/public/javascripts/lowpro.jquery.js +224 -0
  81. data/public/javascripts/rails.js +132 -0
  82. data/public/robots.txt +5 -0
  83. data/public/stylesheets/blueprint/grid.css +280 -0
  84. data/public/stylesheets/blueprint/icons/cross.png +0 -0
  85. data/public/stylesheets/blueprint/icons/doc.png +0 -0
  86. data/public/stylesheets/blueprint/icons/email.png +0 -0
  87. data/public/stylesheets/blueprint/icons/external.png +0 -0
  88. data/public/stylesheets/blueprint/icons/feed.png +0 -0
  89. data/public/stylesheets/blueprint/icons/im.png +0 -0
  90. data/public/stylesheets/blueprint/icons/key.png +0 -0
  91. data/public/stylesheets/blueprint/icons/pdf.png +0 -0
  92. data/public/stylesheets/blueprint/icons/tick.png +0 -0
  93. data/public/stylesheets/blueprint/icons/visited.png +0 -0
  94. data/public/stylesheets/blueprint/icons/xls.png +0 -0
  95. data/public/stylesheets/blueprint/ie.css +36 -0
  96. data/public/stylesheets/blueprint/plugins/buttons/icons/cross.png +0 -0
  97. data/public/stylesheets/blueprint/plugins/buttons/icons/key.png +0 -0
  98. data/public/stylesheets/blueprint/plugins/buttons/icons/tick.png +0 -0
  99. data/public/stylesheets/blueprint/plugins/buttons/readme.txt +32 -0
  100. data/public/stylesheets/blueprint/plugins/buttons/screen.css +97 -0
  101. data/public/stylesheets/blueprint/plugins/fancy-type/readme.txt +14 -0
  102. data/public/stylesheets/blueprint/plugins/fancy-type/screen.css +71 -0
  103. data/public/stylesheets/blueprint/plugins/link-icons/icons/doc.png +0 -0
  104. data/public/stylesheets/blueprint/plugins/link-icons/icons/email.png +0 -0
  105. data/public/stylesheets/blueprint/plugins/link-icons/icons/external.png +0 -0
  106. data/public/stylesheets/blueprint/plugins/link-icons/icons/feed.png +0 -0
  107. data/public/stylesheets/blueprint/plugins/link-icons/icons/im.png +0 -0
  108. data/public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  109. data/public/stylesheets/blueprint/plugins/link-icons/icons/visited.png +0 -0
  110. data/public/stylesheets/blueprint/plugins/link-icons/icons/xls.png +0 -0
  111. data/public/stylesheets/blueprint/plugins/link-icons/readme.txt +18 -0
  112. data/public/stylesheets/blueprint/plugins/link-icons/screen.css +40 -0
  113. data/public/stylesheets/blueprint/plugins/rtl/readme.txt +10 -0
  114. data/public/stylesheets/blueprint/plugins/rtl/screen.css +110 -0
  115. data/public/stylesheets/blueprint/plugins/silksprite/sprite.css +1 -0
  116. data/public/stylesheets/blueprint/plugins/silksprite/sprites.png +0 -0
  117. data/public/stylesheets/blueprint/print.css +29 -0
  118. data/public/stylesheets/blueprint/readme.txt +12 -0
  119. data/public/stylesheets/blueprint/screen.css +429 -0
  120. data/public/stylesheets/error_messages.css +65 -0
  121. data/public/stylesheets/formtastic.css +131 -0
  122. data/public/stylesheets/formtastic_changes.css +14 -0
  123. data/public/stylesheets/fullcalendar.css +574 -0
  124. data/public/stylesheets/fullcalendar_changes.css +0 -0
  125. data/public/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  126. data/public/stylesheets/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  127. data/public/stylesheets/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  128. data/public/stylesheets/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  129. data/public/stylesheets/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  130. data/public/stylesheets/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  131. data/public/stylesheets/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  132. data/public/stylesheets/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  133. data/public/stylesheets/smoothness/images/ui-icons_222222_256x240.png +0 -0
  134. data/public/stylesheets/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  135. data/public/stylesheets/smoothness/images/ui-icons_454545_256x240.png +0 -0
  136. data/public/stylesheets/smoothness/images/ui-icons_888888_256x240.png +0 -0
  137. data/public/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  138. data/public/stylesheets/smoothness/jquery-ui-1.7.2.custom.css +406 -0
  139. data/public/stylesheets/tablesorter/blue/asc.gif +0 -0
  140. data/public/stylesheets/tablesorter/blue/bg.gif +0 -0
  141. data/public/stylesheets/tablesorter/blue/desc.gif +0 -0
  142. data/public/stylesheets/tablesorter/blue/style.css +39 -0
  143. data/public/stylesheets/text_and_colors.css +49 -0
  144. data/spec/controllers/attendees_controller_spec.rb +27 -0
  145. data/spec/controllers/event_revisions_controller_spec.rb +86 -0
  146. data/spec/controllers/events_controller_spec.rb +168 -0
  147. data/spec/fixtures/event_calendar_events.yml +8 -0
  148. data/spec/models/deletable_instance_methods_spec.rb +61 -0
  149. data/spec/models/event_revision_spec.rb +36 -0
  150. data/spec/models/event_spec.rb +139 -0
  151. data/spec/spec_helper.rb +27 -0
  152. data/spec/spec_helpers/mocks.rb +6 -0
  153. data/vendor/plugins/searchable_by/MIT-LICENSE +20 -0
  154. data/vendor/plugins/searchable_by/README +55 -0
  155. data/vendor/plugins/searchable_by/Rakefile +23 -0
  156. data/vendor/plugins/searchable_by/init.rb +2 -0
  157. data/vendor/plugins/searchable_by/install.rb +1 -0
  158. data/vendor/plugins/searchable_by/lib/searchable_by.rb +137 -0
  159. data/vendor/plugins/searchable_by/tasks/searchable_by_tasks.rake +4 -0
  160. data/vendor/plugins/searchable_by/test/boot.rb +21 -0
  161. data/vendor/plugins/searchable_by/test/database.yml +22 -0
  162. data/vendor/plugins/searchable_by/test/fixtures/companies.yml +10 -0
  163. data/vendor/plugins/searchable_by/test/fixtures/company.rb +5 -0
  164. data/vendor/plugins/searchable_by/test/fixtures/employee.rb +5 -0
  165. data/vendor/plugins/searchable_by/test/fixtures/employees.yml +28 -0
  166. data/vendor/plugins/searchable_by/test/fixtures/schema.rb +18 -0
  167. data/vendor/plugins/searchable_by/test/helper.rb +12 -0
  168. data/vendor/plugins/searchable_by/test/lib/activerecord_test_case.rb +43 -0
  169. data/vendor/plugins/searchable_by/test/lib/activerecord_test_connector.rb +75 -0
  170. data/vendor/plugins/searchable_by/test/lib/load_fixtures.rb +9 -0
  171. data/vendor/plugins/searchable_by/test/searchable_by_test.rb +73 -0
  172. data/vendor/plugins/searchable_by/uninstall.rb +1 -0
  173. metadata +606 -0
@@ -0,0 +1,118 @@
1
+ module EventCalendar::ApplicationHelper
2
+ def link_wrapper(path, wrapper_options={}, link_options={})
3
+ tag = wrapper_options.delete(:tag) || :p
4
+ link_text = link_options.delete(:link_text) || path
5
+ highlight = wrapper_options.delete(:highlight)
6
+
7
+ unless path.blank?
8
+ if current_page?(path) && (highlight.nil? || highlight)
9
+ wrapper_options.merge!({
10
+ :class => (wrapper_options[:class] || '') + " nav_highlight"
11
+ })
12
+ end
13
+ end
14
+
15
+ unless wrapper_options.delete(:no_wrapper)
16
+ return content_tag(tag, wrapper_options) do
17
+ link_to(link_text, path, link_options)
18
+ end
19
+ else
20
+ return link_to(link_text, path, link_options)
21
+ end
22
+ end
23
+
24
+ def link_to_events(wrapper_options={}, link_options={})
25
+ link_wrapper(events_path, wrapper_options, link_options.reverse_merge!({
26
+ :link_text => 'Event Calendar'
27
+ }))
28
+ end
29
+
30
+ def link_to_new_event(wrapper_options={})
31
+ link_wrapper(new_event_path, wrapper_options, {
32
+ :link_text => "Create New Event"
33
+ })
34
+ end
35
+
36
+ def link_to_deleted_events(wrapper_options={})
37
+ link_wrapper(event_revisions_path, wrapper_options, {
38
+ :link_text => "Restore Deleted Events (#{EventRevision.deleted.count})"
39
+ })
40
+ end
41
+
42
+ def link_to_add_event_attendees(event, wrapper_options={})
43
+ link_wrapper(new_event_attendee_path(event), wrapper_options, {
44
+ :link_text => "Add <em>#{event.name}</em> Attendees".html_safe
45
+ })
46
+ end
47
+
48
+ def link_to_edit_event(event, wrapper_options={})
49
+ link_wrapper(edit_event_path(event), wrapper_options, {
50
+ :link_text => "Edit <em>#{event.name}</em>".html_safe
51
+ })
52
+ end
53
+
54
+ def link_to_delete_event(event, wrapper_options={})
55
+ link_wrapper(event_path(event), {
56
+ :highlight => false
57
+ }.merge!(wrapper_options), {
58
+ :link_text => "Delete <em>#{event.name}</em>".html_safe,
59
+ :confirm => 'Are you sure you want to permanently delete this event?',
60
+ :method => "delete"
61
+ })
62
+ end
63
+
64
+ def form_for_browse_event_revisions(event)
65
+ render :partial => 'events/browse_event_revisions', :locals => {
66
+ :event => event
67
+ }
68
+ end
69
+
70
+ def render_event_navigation(event=nil)
71
+ render :partial => 'event-calendar-shared/navigation', :locals => {
72
+ :event => event
73
+ }
74
+ end
75
+
76
+ def render_event_main_menu
77
+ render :partial => 'event-calendar-shared/main_menu'
78
+ end
79
+
80
+ def render_flash
81
+ render :partial => 'event-calendar-shared/flash', :object => flash
82
+ end
83
+
84
+ def event_calendar_stylesheet_includes
85
+ list = [
86
+ "fullcalendar",
87
+ "fullcalendar_changes",
88
+ "error_messages",
89
+ "text_and_colors",
90
+ "application",
91
+ "tablesorter/blue/style",
92
+ "smoothness/jquery-ui-1.7.2.custom.css",
93
+ "formtastic",
94
+ "formtastic_changes"
95
+ ]
96
+ list
97
+ end
98
+
99
+ def event_calendar_javascript_includes
100
+ list = [
101
+ 'jquery.tablesorter.min.js',
102
+ 'jquery-ui-1.7.2.custom.min.js',
103
+ 'jquery.string.1.0-min.js',
104
+ 'jquery.clonePosition.js',
105
+ 'lowpro.jquery.js',
106
+ 'fullcalendar.js',
107
+ 'jquery.qtip-1.0.0-rc3.js',
108
+ 'rails',
109
+ 'event_calendar_behaviors.js',
110
+ 'event_calendar.js'
111
+ ]
112
+ unless Rails.env == 'production'
113
+ list.unshift("jquery")
114
+ else
115
+ list.unshift("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js")
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,2 @@
1
+ module EventsHelper
2
+ end
@@ -0,0 +1,6 @@
1
+ class Attendee < ActiveRecord::Base
2
+ set_table_name "event_calendar_attendees"
3
+
4
+ belongs_to :event
5
+ belongs_to :participant, :polymorphic => true
6
+ end
@@ -0,0 +1,7 @@
1
+ module DeletableInstanceMethods
2
+ def restore
3
+ self.revisable_deleted_at = nil
4
+ self.revisable_is_current = true
5
+ save
6
+ end
7
+ end
@@ -0,0 +1,124 @@
1
+ class Event < ActiveRecord::Base
2
+ set_table_name "event_calendar_events"
3
+
4
+ include ActionView::Helpers::TextHelper
5
+
6
+ has_many :attendees
7
+ #has_many :contacts, :through => :attendees, :order => ["last_name, first_name"],
8
+ # :conditions => {:revisable_is_current => true}
9
+
10
+ #has_many :file_attachments
11
+
12
+ #belongs_to :modified_by_user, :class_name => 'User'
13
+
14
+ validates_presence_of :name, :event_type, :start_on
15
+
16
+ # acts_as_stripped :name
17
+
18
+ searchable_by :name, :event_type, :location, :description
19
+
20
+ acts_as_revisable :revision_class_name => 'EventRevision', :on_delete => :revise
21
+
22
+ scope :past, lambda{
23
+ where(sanitize_sql_array(["end_on < '%s'", Date.current]))
24
+ }
25
+ scope :future, lambda{
26
+ where(sanitize_sql_array(["start_on > '%s'", Date.current]))
27
+ }
28
+
29
+ validate :sane_dates
30
+
31
+ private
32
+
33
+ def sane_dates
34
+ if start_on and end_on and start_on > end_on
35
+ errors.add :end_on, "cannot be before the start date"
36
+ end
37
+ end
38
+
39
+ protected
40
+ public
41
+
42
+ def start_year
43
+ start_on.year
44
+ end
45
+
46
+ def start_month
47
+ start_on.strftime("%B")
48
+ end
49
+
50
+ def start_day
51
+ start_on.day
52
+ end
53
+
54
+ def end_year
55
+ end_on.year
56
+ end
57
+
58
+ def end_month
59
+ end_on.strftime("%B")
60
+ end
61
+
62
+ def end_day
63
+ end_on.day
64
+ end
65
+
66
+ def participants
67
+ return [] if attendees.count == 0
68
+ attendees.all.collect do |attendee|
69
+ attendee.participant
70
+ end
71
+ end
72
+
73
+ def self.existing_event_types
74
+ select('DISTINCT event_type').map(&:event_type).reject { |ev| ev.blank? }.sort
75
+ end
76
+
77
+ # def update_roster
78
+ # self.attendee_roster = attendees.collect{|a| a.contact_id}.join(',')
79
+ # end
80
+
81
+ # def drop_attendees(drop_contact_ids)
82
+ # drop_contact_ids = [*drop_contact_ids].compact.map(&:to_i)
83
+ # changeset! do |event|
84
+ # event.attendees.find(:all, {
85
+ # :select => 'id',
86
+ # :conditions => ["contact_id IN (?)", drop_contact_ids]
87
+ # }).each{|a| a.destroy && !a.destroyed?}
88
+ # event.update_roster
89
+ # event.save
90
+ # end
91
+ # end
92
+
93
+ # def add_attendees(from_contact_ids)
94
+ # changeset! do |event|
95
+ # from_contact_ids.each do |c_id|
96
+ # event.attendees.build(:contact_id => c_id)
97
+ # end
98
+ # event.update_roster
99
+ # event.save
100
+ # end
101
+ # end
102
+
103
+ def to_s
104
+ "#{name} (#{start_on} #{end_on ? ' - ' + end_on.to_s : ''})"
105
+ end
106
+
107
+ def to_hash_for_calendar(url)
108
+ # { :id => id, :title => name_and_file_count, :start => start_on, :end => end_on, :url => "/events/#{id}",
109
+ # :description => description && description.gsub("\n", "<br/>") || '',
110
+ # :location => location && location.gsub("\n", "<br/>") || '' }
111
+ { :id => id, :title => name, :start => start_on, :end => end_on, :url => url,
112
+ :description => description && description.gsub("\n", "<br/>") || '',
113
+ :location => location && location.gsub("\n", "<br/>") || '' }
114
+ end
115
+
116
+ # list all groups that had least one member in attendance at this event
117
+ # def contact_groups_represented
118
+ # @contact_groups_represented ||= contacts.map(&:contact_groups).flatten.uniq
119
+ # end
120
+
121
+ # def name_and_file_count
122
+ # "#{name} (#{pluralize(file_attachments.count, 'file')})"
123
+ # end
124
+ end
@@ -0,0 +1,9 @@
1
+ class EventRevision < ActiveRecord::Base
2
+ set_table_name "event_calendar_events"
3
+
4
+ acts_as_revision :revisable_class_name => 'Event'
5
+
6
+ include DeletableInstanceMethods
7
+
8
+ scope :deleted, where("revisable_deleted_at IS NOT NULL")
9
+ end
@@ -0,0 +1,23 @@
1
+ module Participant
2
+ @@types ||= []
3
+
4
+ def self.included(base)
5
+ @@types << base
6
+
7
+ base.instance_eval do
8
+ include Associations
9
+ end
10
+ end
11
+ def self.types
12
+ @@types.sort
13
+ end
14
+
15
+ module Associations
16
+ def self.included(base)
17
+ base.instance_eval do
18
+ has_many :attendees, {:as => :participant, :dependent => :destroy}
19
+ has_many :events, {:through => :attendees}
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,20 @@
1
+ class Participator
2
+ def self.create!(attendee_hash)
3
+ event_id = attendee_hash.delete :event_id
4
+ attendees = []
5
+ attendee_hash.each do |participant_class, participant_ids|
6
+ participant_class = participant_class.to_s.classify.constantize
7
+ if Participant.types.include?(participant_class)
8
+ participant_ids.each do |participant_id|
9
+ next if participant_id.blank? || participant_class.blank?
10
+ attendees << Attendee.create!({
11
+ :event_id => event_id,
12
+ :participant_id => participant_id,
13
+ :participant_type => participant_class
14
+ })
15
+ end
16
+ end
17
+ end
18
+ attendees
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ <h3><%= @event.name %> Attendees</h3>
2
+ <% @event.participants.group_by(&:class).map do |type, participants| %>
3
+ <h4><%= link_to(pluralize(participants.size, type.to_s), engine_path(type)) %></h4>
4
+ <ol>
5
+ <% participants.each do |participant| %>
6
+ <% name_attr = participant.attribute_names.detect{|m_attr| m_attr =~ /name/} %>
7
+ <% if participant.respond_to?(:name) %>
8
+ <li><%= link_to(participant.send(name_attr), engine_path(participant)) %></li>
9
+ <% elsif name_attr %>
10
+ <li><%= link_to(participant.name, engine_path(participant)) %></li>
11
+ <% end %>
12
+ <% end %>
13
+ </ol>
14
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <h2>Add Participants to the <%= @event.name %> Group</h2>
2
+ <%= semantic_form_for(@attendee, :url => event_attendees_path) do |form| %>
3
+ <%= form.inputs do %>
4
+ <%= form.input :event_id, :as => :hidden, :value => params[:event_id] %>
5
+ <% @participants.group_by(&:class).each do |type, participants| %>
6
+ <%= form.input type.to_s.downcase.pluralize, {
7
+ :as => :check_boxes,
8
+ :collection => participants
9
+ } %>
10
+ <% end %>
11
+ <% end %>
12
+ <%= form.submit %>
13
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <% if flash[:notice] || flash[:warning] %>
2
+ <div id="flash_message">
3
+ <div class="<%= flash[:notice] ? 'notice' : 'error' %>">
4
+ <p><%= flash[:notice] || flash[:warning] %></p>
5
+ </div>
6
+ </div>
7
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <ul>
2
+ <li><%= link_to "Events", events_path %></li>
3
+ </ul>
@@ -0,0 +1,15 @@
1
+ <h4>Manage Events</h4>
2
+
3
+ <%= link_to_new_event %>
4
+ <%= link_to_deleted_events %>
5
+
6
+ <% if defined?(event) && !event.nil? && !event.new_record? %>
7
+ <hr />
8
+
9
+ <%= link_to_add_event_attendees(event) %>
10
+ <%= link_to_edit_event(event) %>
11
+
12
+ <%= link_to_delete_event(event) %>
13
+
14
+ <%= form_for_browse_event_revisions(event) %>
15
+ <% end %>
@@ -0,0 +1,31 @@
1
+ <table class="nice_table tablesorter">
2
+ <thead>
3
+ <tr>
4
+ <th>Event</th>
5
+ <th>Location</th>
6
+ <th>Description</th>
7
+ <th style="border: 1px #CCF dashed; text-align:center">Manage</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <% for event in @deleted_events %>
12
+ <tr style="background-color: #f5c6d7;">
13
+ <td><%= link_to event.name, event_path(event) %></td>
14
+ <td><%= truncate(event.location, :length => 100) %></td>
15
+ <td><%= truncate(event.description, :length => 100) %></td>
16
+ <td><%= link_to 'restore', restore_event_revision_path(event),
17
+ :confirm => 'Are you sure you want to restore this deleted event?',
18
+ :method => "post",
19
+ :class => 'fake_button' %></td>
20
+ </tr>
21
+ <% end %>
22
+ </tbody>
23
+ </table>
24
+
25
+ <script type="text/javascript">
26
+ $(document).ready(function()
27
+ {
28
+ $(".nice_table").tablesorter( { widgets: ['zebra'], headers: { 3:{sorter: false}, 4:{sorter: false}, 5:{sorter: false}} });
29
+ }
30
+ );
31
+ </script>
@@ -0,0 +1,5 @@
1
+ <p>
2
+ <%= link_to "< Current Version", event_path(@event_revision.current_revision), :class => 'fake_button' %>
3
+ </p>
4
+ <h1>Event - Version: <%= @event_revision.revision_number %><hr /></h1>
5
+ <%= render :partial => 'events/event_details', :object => @event_revision %>
@@ -0,0 +1,19 @@
1
+ <h4>Browse Revisions (<%= event.revisable_number %>)</h4>
2
+
3
+ <% if event.revisions.empty? %>
4
+ <p><em>This is the first version of this event.</em></p>
5
+ <% else %>
6
+ <%= form_tag event_revisions_path, :method => :get do %>
7
+ <select name="id">
8
+ <% event.revisions.each do |evr| %>
9
+ <option value="<%= evr.id %>">
10
+ Version <%= evr.revisable_number %>
11
+ (<%= evr.revisable_current_at.strftime "%m/%d/%y" %>)
12
+ </option>
13
+ <% end %>
14
+ </select>
15
+ <%= submit_tag "go" %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+ <p>current version modified on <%= event.updated_at %></p>