social_stream-events 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +9 -2
- data/GPL Affero license b/data/GPL Affero → license +0 -0
- data/Gemfile +1 -5
- data/README.rdoc +0 -0
- data/Rakefile +7 -0
- data/app/assets/images/btn/btn_certificate.png +0 -0
- data/app/assets/images/btn/btn_certificates.png +0 -0
- data/app/assets/images/btn/btn_edit.png +0 -0
- data/app/assets/images/btn/btn_embebed.png +0 -0
- data/app/assets/images/btn/btn_event.png +0 -0
- data/app/assets/images/btn/btn_outline.png +0 -0
- data/app/assets/images/btn/event.png +0 -0
- data/app/assets/images/btn/flyer.png +0 -0
- data/app/assets/images/btn/keynote.png +0 -0
- data/app/assets/images/btn/live.png +0 -0
- data/app/assets/images/btn/time.png +0 -0
- data/app/assets/images/btn/trash.png +0 -0
- data/app/assets/images/icons/IconsByGlyphish.txt +0 -0
- data/app/assets/images/icons/down.png +0 -0
- data/app/assets/images/icons/search.png +0 -0
- data/app/assets/images/icons/up.png +0 -0
- data/app/assets/images/logos/actor/event.png +0 -0
- data/app/assets/images/logos/contact/event.png +0 -0
- data/app/assets/images/logos/original/event.png +0 -0
- data/app/assets/images/logos/profile/event.png +0 -0
- data/app/assets/images/logos/representation/event.png +0 -0
- data/app/assets/images/tab_bottom.png +0 -0
- data/app/assets/javascripts/schedule.js +0 -0
- data/app/assets/javascripts/social_stream-events.js +0 -0
- data/app/assets/stylesheets/fullcalendar.css +0 -0
- data/app/assets/stylesheets/fullcalendar.print.css +0 -0
- data/app/assets/stylesheets/social_stream-events.css +1 -5
- data/app/controllers/agendas_controller.rb +0 -0
- data/app/controllers/events_controller.rb +0 -0
- data/app/controllers/sessions_controller.rb +0 -0
- data/app/helpers/event_helper.rb +0 -0
- data/app/models/agenda.rb +0 -0
- data/app/models/event.rb +0 -0
- data/app/models/session.rb +0 -0
- data/app/views/agendas/_agenda.html.erb +0 -0
- data/app/views/agendas/_edit.html.erb +0 -0
- data/app/views/agendas/_schedule.html.erb +0 -0
- data/app/views/agendas/_show.html.erb +0 -0
- data/app/views/agendas/_show_day.html.erb +0 -0
- data/app/views/agendas/edit.html.erb +0 -0
- data/app/views/agendas/event.html.erb +0 -0
- data/app/views/agendas/index.html.erb +0 -0
- data/app/views/agendas/show.html.erb +0 -0
- data/app/views/documents/_mediawall.html.erb +0 -0
- data/app/views/events/_event.html.erb +0 -0
- data/app/views/events/_event_with_details.html.erb +2 -0
- data/app/views/events/_form.html.erb +0 -0
- data/app/views/events/_jquery.html.erb +0 -0
- data/app/views/events/_manage.html.erb +0 -0
- data/app/views/events/_new_activity.html.erb +2 -0
- data/app/views/events/{_fields.html.erb → _new_activity_fields.html.erb} +0 -0
- data/app/views/events/_sessions_edit.html.erb +0 -0
- data/app/views/events/_sidebar_cloud.html.erb +0 -0
- data/app/views/events/_sidebar_index.html.erb +0 -0
- data/app/views/events/_sidebar_show.html.erb +0 -0
- data/app/views/events/agendas.html +0 -0
- data/app/views/events/edit.html.erb +0 -0
- data/app/views/events/index.html.erb +0 -0
- data/app/views/events/manage.html.erb +0 -0
- data/app/views/events/manage.js.erb +0 -0
- data/app/views/events/show.html.erb +0 -0
- data/app/views/profiles/_outline.html.erb +0 -0
- data/app/views/sessions/_form.html.erb +0 -0
- data/app/views/sessions/_new.html.erb +0 -0
- data/app/views/sessions/_session.html.erb +0 -0
- data/app/views/sessions/_show.html.erb +0 -0
- data/app/views/sessions/create.html.erb +0 -0
- data/app/views/sessions/create.js.erb +0 -0
- data/app/views/sessions/destroy.js.erb +0 -0
- data/app/views/sessions/edit.html.erb +0 -0
- data/app/views/sessions/index.html.erb +0 -0
- data/app/views/sessions/index.js.erb +0 -0
- data/app/views/sessions/new.html.erb +0 -0
- data/app/views/toolbar/_organizer.html.erb +0 -0
- data/app/views/toolbar/_sponsor.html.erb +0 -0
- data/app/views/toolbar/_suscribed.html.erb +0 -0
- data/config/locales/en.yml +0 -9
- data/config/routes.rb +0 -16
- data/db/{20110615143707_create_social_stream_events.rb → migrate/20110910161707_create_social_stream_events.rb} +0 -0
- data/lib/generators/social_stream/events/install_generator.rb +0 -0
- data/lib/social_stream-events.rb +6 -1
- data/lib/social_stream/events/engine.rb +5 -2
- data/lib/social_stream/events/version.rb +5 -0
- data/lib/social_stream/migrations/events.rb +2 -19
- data/lib/social_stream/toolbar_config/events.rb +40 -0
- data/social_stream-events.gemspec +5 -2
- data/vendor/assets/javascripts/fullcalendar.js +0 -0
- data/vendor/assets/javascripts/gcal.js +0 -0
- metadata +36 -88
- data/app/assets/javascripts/settings.js +0 -20
- data/app/assets/stylesheets/activities.css +0 -4
- data/app/assets/stylesheets/settings.css +0 -4
- data/app/assets/stylesheets/tie.css +0 -4
- data/app/assets/stylesheets/users.css +0 -4
- data/app/controllers/activities_controller.rb +0 -42
- data/app/controllers/calendar_events_controller.rb +0 -157
- data/app/controllers/settings_controller.rb +0 -70
- data/app/models/calendar_event.rb +0 -191
- data/app/models/calendar_event_series.rb +0 -126
- data/app/views/activities/_activity.html.erb +0 -5
- data/app/views/activities/_child.html.erb +0 -18
- data/app/views/activities/_comments.html.erb +0 -3
- data/app/views/activities/_index.html.erb +0 -94
- data/app/views/activities/_new.html.erb +0 -29
- data/app/views/activities/_options.html.erb +0 -15
- data/app/views/activities/_root.html.erb +0 -37
- data/app/views/activities/_wall.html.erb +0 -5
- data/app/views/activities/_walls.html.erb +0 -34
- data/app/views/activities/documents.js.erb +0 -1
- data/app/views/activities/index.js.erb +0 -1
- data/app/views/calendar_events/_calendar.html.erb +0 -0
- data/app/views/calendar_events/_edit_form.html.erb +0 -58
- data/app/views/calendar_events/_form.html.erb +0 -65
- data/app/views/calendar_events/available.html.erb +0 -81
- data/app/views/calendar_events/create.js.erb +0 -18
- data/app/views/calendar_events/edit.js.erb +0 -1
- data/app/views/calendar_events/index.html.erb +0 -162
- data/app/views/calendar_events/move.js.erb +0 -0
- data/app/views/calendar_events/new.js.erb +0 -9
- data/app/views/calendar_events/resize.js.erb +0 -0
- data/app/views/calendar_events/schedule.html.erb +0 -143
- data/app/views/events/_new.html.erb +0 -2
- data/app/views/kaminari/_first_page.html.erb +0 -11
- data/app/views/kaminari/_gap.html.erb +0 -8
- data/app/views/kaminari/_last_page.html.erb +0 -11
- data/app/views/kaminari/_next_page.html.erb +0 -11
- data/app/views/kaminari/_page.html.erb +0 -12
- data/app/views/kaminari/_paginator.html.erb +0 -23
- data/app/views/kaminari/_prev_page.html.erb +0 -11
- data/app/views/profiles/_profile.html.erb +0 -40
- data/app/views/settings/_contacto.html.erb +0 -24
- data/app/views/settings/_header.html.erb +0 -8
- data/app/views/settings/_index.html.erb +0 -16
- data/app/views/settings/_manage.html.erb +0 -25
- data/app/views/settings/_settings.html.erb +0 -49
- data/app/views/settings/delete_relation.js.erb +0 -3
- data/app/views/settings/index.html.erb +0 -38
- data/app/views/settings/manage.html.erb +0 -31
- data/app/views/settings/show.html.erb +0 -15
- data/app/views/settings/update_relation.js.erb +0 -1
- data/app/views/toolbar/_home.html.erb +0 -11
- data/app/views/toolbar/_logo.html.erb +0 -23
- data/app/views/toolbar/_profile.html.erb +0 -21
- data/app/views/users/_index.html.erb +0 -33
- data/app/views/users/index.html.erb +0 -46
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 4
|
10
|
+
version: 0.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Diego Carrera
|
@@ -17,27 +17,29 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-09-
|
20
|
+
date: 2011-09-29 00:00:00 +02:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
24
|
+
prerelease: false
|
25
|
+
type: :runtime
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
27
|
none: false
|
26
28
|
requirements:
|
27
29
|
- - ~>
|
28
30
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
31
|
+
hash: 45
|
30
32
|
segments:
|
31
33
|
- 0
|
32
34
|
- 9
|
33
|
-
-
|
34
|
-
version: 0.9.
|
35
|
-
requirement: *id001
|
35
|
+
- 11
|
36
|
+
version: 0.9.11
|
36
37
|
name: social_stream-base
|
37
|
-
|
38
|
-
type: :runtime
|
38
|
+
version_requirements: *id001
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
|
-
|
40
|
+
prerelease: false
|
41
|
+
type: :development
|
42
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
43
|
none: false
|
42
44
|
requirements:
|
43
45
|
- - ">="
|
@@ -46,12 +48,12 @@ dependencies:
|
|
46
48
|
segments:
|
47
49
|
- 0
|
48
50
|
version: "0"
|
49
|
-
requirement: *id002
|
50
51
|
name: sqlite3-ruby
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
51
54
|
prerelease: false
|
52
55
|
type: :development
|
53
|
-
|
54
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
57
|
none: false
|
56
58
|
requirements:
|
57
59
|
- - ~>
|
@@ -62,12 +64,12 @@ dependencies:
|
|
62
64
|
- 10
|
63
65
|
- 3
|
64
66
|
version: 0.10.3
|
65
|
-
requirement: *id003
|
66
67
|
name: ruby-debug
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
67
70
|
prerelease: false
|
68
71
|
type: :development
|
69
|
-
|
70
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
73
|
none: false
|
72
74
|
requirements:
|
73
75
|
- - ~>
|
@@ -78,12 +80,12 @@ dependencies:
|
|
78
80
|
- 6
|
79
81
|
- 0
|
80
82
|
version: 2.6.0
|
81
|
-
requirement: *id004
|
82
83
|
name: rspec-rails
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
83
86
|
prerelease: false
|
84
87
|
type: :development
|
85
|
-
|
86
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
87
89
|
none: false
|
88
90
|
requirements:
|
89
91
|
- - ~>
|
@@ -94,12 +96,12 @@ dependencies:
|
|
94
96
|
- 3
|
95
97
|
- 2
|
96
98
|
version: 1.3.2
|
97
|
-
requirement: *id005
|
98
99
|
name: factory_girl
|
100
|
+
version_requirements: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
99
102
|
prerelease: false
|
100
103
|
type: :development
|
101
|
-
|
102
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
103
105
|
none: false
|
104
106
|
requirements:
|
105
107
|
- - ~>
|
@@ -110,12 +112,12 @@ dependencies:
|
|
110
112
|
- 3
|
111
113
|
- 6
|
112
114
|
version: 0.3.6
|
113
|
-
requirement: *id006
|
114
115
|
name: forgery
|
116
|
+
version_requirements: *id006
|
117
|
+
- !ruby/object:Gem::Dependency
|
115
118
|
prerelease: false
|
116
119
|
type: :development
|
117
|
-
|
118
|
-
version_requirements: &id007 !ruby/object:Gem::Requirement
|
120
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
119
121
|
none: false
|
120
122
|
requirements:
|
121
123
|
- - ~>
|
@@ -126,10 +128,8 @@ dependencies:
|
|
126
128
|
- 3
|
127
129
|
- 9
|
128
130
|
version: 0.3.9
|
129
|
-
requirement: *id007
|
130
131
|
name: capybara
|
131
|
-
|
132
|
-
type: :development
|
132
|
+
version_requirements: *id007
|
133
133
|
description: |-
|
134
134
|
Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.
|
135
135
|
|
@@ -170,38 +170,17 @@ files:
|
|
170
170
|
- app/assets/images/logos/representation/event.png
|
171
171
|
- app/assets/images/tab_bottom.png
|
172
172
|
- app/assets/javascripts/schedule.js
|
173
|
-
- app/assets/javascripts/settings.js
|
174
173
|
- app/assets/javascripts/social_stream-events.js
|
175
|
-
- app/assets/stylesheets/activities.css
|
176
174
|
- app/assets/stylesheets/fullcalendar.css
|
177
175
|
- app/assets/stylesheets/fullcalendar.print.css
|
178
|
-
- app/assets/stylesheets/settings.css
|
179
176
|
- app/assets/stylesheets/social_stream-events.css
|
180
|
-
- app/assets/stylesheets/tie.css
|
181
|
-
- app/assets/stylesheets/users.css
|
182
|
-
- app/controllers/activities_controller.rb
|
183
177
|
- app/controllers/agendas_controller.rb
|
184
|
-
- app/controllers/calendar_events_controller.rb
|
185
178
|
- app/controllers/events_controller.rb
|
186
179
|
- app/controllers/sessions_controller.rb
|
187
|
-
- app/controllers/settings_controller.rb
|
188
180
|
- app/helpers/event_helper.rb
|
189
181
|
- app/models/agenda.rb
|
190
|
-
- app/models/calendar_event.rb
|
191
|
-
- app/models/calendar_event_series.rb
|
192
182
|
- app/models/event.rb
|
193
183
|
- app/models/session.rb
|
194
|
-
- app/views/activities/_activity.html.erb
|
195
|
-
- app/views/activities/_child.html.erb
|
196
|
-
- app/views/activities/_comments.html.erb
|
197
|
-
- app/views/activities/_index.html.erb
|
198
|
-
- app/views/activities/_new.html.erb
|
199
|
-
- app/views/activities/_options.html.erb
|
200
|
-
- app/views/activities/_root.html.erb
|
201
|
-
- app/views/activities/_wall.html.erb
|
202
|
-
- app/views/activities/_walls.html.erb
|
203
|
-
- app/views/activities/documents.js.erb
|
204
|
-
- app/views/activities/index.js.erb
|
205
184
|
- app/views/agendas/_agenda.html.erb
|
206
185
|
- app/views/agendas/_edit.html.erb
|
207
186
|
- app/views/agendas/_schedule.html.erb
|
@@ -211,24 +190,14 @@ files:
|
|
211
190
|
- app/views/agendas/event.html.erb
|
212
191
|
- app/views/agendas/index.html.erb
|
213
192
|
- app/views/agendas/show.html.erb
|
214
|
-
- app/views/calendar_events/_calendar.html.erb
|
215
|
-
- app/views/calendar_events/_edit_form.html.erb
|
216
|
-
- app/views/calendar_events/_form.html.erb
|
217
|
-
- app/views/calendar_events/available.html.erb
|
218
|
-
- app/views/calendar_events/create.js.erb
|
219
|
-
- app/views/calendar_events/edit.js.erb
|
220
|
-
- app/views/calendar_events/index.html.erb
|
221
|
-
- app/views/calendar_events/move.js.erb
|
222
|
-
- app/views/calendar_events/new.js.erb
|
223
|
-
- app/views/calendar_events/resize.js.erb
|
224
|
-
- app/views/calendar_events/schedule.html.erb
|
225
193
|
- app/views/documents/_mediawall.html.erb
|
226
194
|
- app/views/events/_event.html.erb
|
227
|
-
- app/views/events/
|
195
|
+
- app/views/events/_event_with_details.html.erb
|
228
196
|
- app/views/events/_form.html.erb
|
229
197
|
- app/views/events/_jquery.html.erb
|
230
198
|
- app/views/events/_manage.html.erb
|
231
|
-
- app/views/events/
|
199
|
+
- app/views/events/_new_activity.html.erb
|
200
|
+
- app/views/events/_new_activity_fields.html.erb
|
232
201
|
- app/views/events/_sessions_edit.html.erb
|
233
202
|
- app/views/events/_sidebar_cloud.html.erb
|
234
203
|
- app/views/events/_sidebar_index.html.erb
|
@@ -239,15 +208,7 @@ files:
|
|
239
208
|
- app/views/events/manage.html.erb
|
240
209
|
- app/views/events/manage.js.erb
|
241
210
|
- app/views/events/show.html.erb
|
242
|
-
- app/views/kaminari/_first_page.html.erb
|
243
|
-
- app/views/kaminari/_gap.html.erb
|
244
|
-
- app/views/kaminari/_last_page.html.erb
|
245
|
-
- app/views/kaminari/_next_page.html.erb
|
246
|
-
- app/views/kaminari/_page.html.erb
|
247
|
-
- app/views/kaminari/_paginator.html.erb
|
248
|
-
- app/views/kaminari/_prev_page.html.erb
|
249
211
|
- app/views/profiles/_outline.html.erb
|
250
|
-
- app/views/profiles/_profile.html.erb
|
251
212
|
- app/views/sessions/_form.html.erb
|
252
213
|
- app/views/sessions/_new.html.erb
|
253
214
|
- app/views/sessions/_session.html.erb
|
@@ -259,31 +220,18 @@ files:
|
|
259
220
|
- app/views/sessions/index.html.erb
|
260
221
|
- app/views/sessions/index.js.erb
|
261
222
|
- app/views/sessions/new.html.erb
|
262
|
-
- app/views/settings/_contacto.html.erb
|
263
|
-
- app/views/settings/_header.html.erb
|
264
|
-
- app/views/settings/_index.html.erb
|
265
|
-
- app/views/settings/_manage.html.erb
|
266
|
-
- app/views/settings/_settings.html.erb
|
267
|
-
- app/views/settings/delete_relation.js.erb
|
268
|
-
- app/views/settings/index.html.erb
|
269
|
-
- app/views/settings/manage.html.erb
|
270
|
-
- app/views/settings/show.html.erb
|
271
|
-
- app/views/settings/update_relation.js.erb
|
272
|
-
- app/views/toolbar/_home.html.erb
|
273
|
-
- app/views/toolbar/_logo.html.erb
|
274
223
|
- app/views/toolbar/_organizer.html.erb
|
275
|
-
- app/views/toolbar/_profile.html.erb
|
276
224
|
- app/views/toolbar/_sponsor.html.erb
|
277
225
|
- app/views/toolbar/_suscribed.html.erb
|
278
|
-
- app/views/users/_index.html.erb
|
279
|
-
- app/views/users/index.html.erb
|
280
226
|
- config/locales/en.yml
|
281
227
|
- config/routes.rb
|
282
|
-
- db/
|
228
|
+
- db/migrate/20110910161707_create_social_stream_events.rb
|
283
229
|
- lib/generators/social_stream/events/install_generator.rb
|
284
230
|
- lib/social_stream-events.rb
|
285
231
|
- lib/social_stream/events/engine.rb
|
232
|
+
- lib/social_stream/events/version.rb
|
286
233
|
- lib/social_stream/migrations/events.rb
|
234
|
+
- lib/social_stream/toolbar_config/events.rb
|
287
235
|
- social_stream-events.gemspec
|
288
236
|
- vendor/assets/javascripts/fullcalendar.js
|
289
237
|
- vendor/assets/javascripts/gcal.js
|
@@ -1,20 +0,0 @@
|
|
1
|
-
// Place all the behaviors and hooks related to the matching controller here.
|
2
|
-
// All this logic will automatically be available in application.js.
|
3
|
-
var contact_manage_open = false;
|
4
|
-
closeSettings = function() {
|
5
|
-
$("#contact_settings_content").hide("slow");
|
6
|
-
$("#contact_settings_briefing").show("slow");
|
7
|
-
contact_manage_open = false;
|
8
|
-
}
|
9
|
-
showContactSettings = function() {
|
10
|
-
if (contact_manage_open) {
|
11
|
-
$("#contact_settings_content").hide("slow");
|
12
|
-
$("#contact_settings_briefing").show("slow");
|
13
|
-
contact_manage_open = false;
|
14
|
-
} else {
|
15
|
-
closeAllSettings();
|
16
|
-
$("#contact_settings_content").show("slow");
|
17
|
-
$("#contact_settings_briefing").hide("slow");
|
18
|
-
contact_manage_open = true;
|
19
|
-
}
|
20
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
class ActivitiesController < InheritedResources::Base
|
2
|
-
belongs_to_subjects
|
3
|
-
actions :index
|
4
|
-
|
5
|
-
respond_to :js
|
6
|
-
|
7
|
-
def documents
|
8
|
-
object_types = params[:types]
|
9
|
-
if object_types.nil? || object_types == "all"
|
10
|
-
# @activities=ActivityObject.where("object_type in :list",:list=> object_types).order("updated_at DESC").
|
11
|
-
logger.debug("es nil u all")
|
12
|
-
# @activities=ActivityObject.
|
13
|
-
# page(params[:page]).
|
14
|
-
# per(params[:per])
|
15
|
-
@activities=current_subject.wall(:home).page(params[:page])
|
16
|
-
else
|
17
|
-
logger.debug("tiene valores el arreglo")
|
18
|
-
# @activities=ActivityObject.where(:object_type => object_types).order("updated_at DESC").
|
19
|
-
# page(params[:page]).
|
20
|
-
# per(params[:per])
|
21
|
-
@activities=current_subject.wall(:home).joins(:activity_objects).where(:activity_objects=>{:object_type => object_types}).order("updated_at DESC").page(params[:page])
|
22
|
-
end
|
23
|
-
#@activities = profile_subject.wall(:profile,
|
24
|
-
# :for => current_subject,
|
25
|
-
# :object_type => object_types).#Array(self.class.index_object_type)).
|
26
|
-
# page(params[:page]).
|
27
|
-
# per(params[:per])
|
28
|
-
end
|
29
|
-
|
30
|
-
protected
|
31
|
-
|
32
|
-
def collection
|
33
|
-
rel = params[:section].to_i if params[:section].present?
|
34
|
-
|
35
|
-
# should be activities.page(params[:page], :count => { :select => 'activity.id', :distinct => true }) but it is not working in Rails 3.0.3
|
36
|
-
@activities ||= association_chain[-1].
|
37
|
-
wall(:profile,
|
38
|
-
:for => current_subject,
|
39
|
-
:relation => rel).
|
40
|
-
page(params[:page])
|
41
|
-
end
|
42
|
-
end
|
@@ -1,157 +0,0 @@
|
|
1
|
-
class CalendarEventsController < InheritedResources::Base
|
2
|
-
|
3
|
-
def new
|
4
|
-
starttime = params[:start]
|
5
|
-
endtime = params[:end]
|
6
|
-
allDay = params[:allDay]
|
7
|
-
@room = Room.find(params[:room_id])
|
8
|
-
logger.error "starttime => #{starttime}, endtime => #{endtime}, all_day => #{allDay}"
|
9
|
-
@event = CalendarEvent.new(:starttime => starttime ? starttime[0,20].strip : "", :endtime => endtime ? endtime[0,20].strip : "", :all_day => allDay, :period => "Does not repeat")
|
10
|
-
end
|
11
|
-
|
12
|
-
def create
|
13
|
-
if params[:calendar_event][:period] == "Does not repeat"
|
14
|
-
@event = CalendarEvent.new(params[:calendar_event])
|
15
|
-
else
|
16
|
-
#@event_series = EventSeries.new(:frequency => params[:event][:frequency], :period => params[:event][:repeats], :starttime => params[:event][:starttime], :endtime => params[:event][:endtime], :all_day => params[:event][:all_day])
|
17
|
-
@event_series = CalendarEventSeries.new(params[:calendar_event])
|
18
|
-
if (params[:repeat_until][:year] != "" && params[:repeat_until][:month] != "" && params[:repeat_until][:day] != "")
|
19
|
-
@event_series.repeat_until = Date.civil(params[:repeat_until][:year].to_i, params[:repeat_until][:month].to_i, params[:repeat_until][:day].to_i)
|
20
|
-
@event_series.save
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def index
|
26
|
-
|
27
|
-
end
|
28
|
-
|
29
|
-
def get_calendar_events
|
30
|
-
events = []
|
31
|
-
# Current reservations
|
32
|
-
if params[:calendar_events] != nil
|
33
|
-
calendar_events_ids = params[:calendar_events].strip().split(' ')
|
34
|
-
@calendar_events = CalendarEvent.find(calendar_events_ids)
|
35
|
-
@calendar_events.each do |event|
|
36
|
-
events << {:id => event.id, :title => event.title,
|
37
|
-
:description => event.description || "Some cool description here...",
|
38
|
-
:start => event.starttime.in_time_zone(Time.zone).to_s[0,20].strip,
|
39
|
-
:end => event.endtime.in_time_zone(Time.zone).to_s[0,20].strip,
|
40
|
-
:allDay => event.all_day,
|
41
|
-
:editable => true,
|
42
|
-
:recurring => (event.calendar_event_series_id)? true: false}
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
render :text => events.to_json
|
47
|
-
end
|
48
|
-
|
49
|
-
def get_events
|
50
|
-
@events = CalendarEvent.find(:all, :conditions => ["starttime >= '#{Time.at(params['start'].to_i).to_formatted_s(:db)}' and endtime <= '#{Time.at(params['end'].to_i).to_formatted_s(:db)}'"] )
|
51
|
-
events = []
|
52
|
-
@events.each do |event|
|
53
|
-
events << {:id => event.id, :title => event.title, :description => event.description || "Some cool description here...", :start => "#{event.starttime.iso8601}", :end => "#{event.endtime.iso8601}", :allDay => event.all_day, :recurring => (event.calendar_event_series_id)? true: false}
|
54
|
-
end
|
55
|
-
render :text => events.to_json
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
|
-
def move
|
60
|
-
@event = CalendarEvent.find_by_id params[:id]
|
61
|
-
if @event
|
62
|
-
@event.starttime = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@event.starttime))
|
63
|
-
@event.endtime = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@event.endtime))
|
64
|
-
@event.all_day = params[:all_day]
|
65
|
-
@event.save
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def resize
|
70
|
-
@event = CalendarEvent.find_by_id params[:id]
|
71
|
-
if @event
|
72
|
-
@event.endtime = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@event.endtime))
|
73
|
-
@event.save
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def edit
|
78
|
-
@event = CalendarEvent.find_by_id(params[:id])
|
79
|
-
end
|
80
|
-
|
81
|
-
def update
|
82
|
-
@event = CalendarEvent.find_by_id(params[:calendar_event][:id])
|
83
|
-
if params[:calendar_event][:commit_button] == "Actualizar todas las instancias"
|
84
|
-
@events = @event.calendar_event_series.calendar_events #.find(:all, :conditions => ["starttime > '#{@event.starttime.to_formatted_s(:db)}' "])
|
85
|
-
@event.update_calendar_events(@events, params[:calendar_event])
|
86
|
-
elsif params[:calendar_event][:commit_button] == "Actualizar todas las instancias siguientes"
|
87
|
-
@events = @event.calendar_event_series.calendar_events.find(:all, :conditions => ["starttime > '#{@event.starttime.to_formatted_s(:db)}' "])
|
88
|
-
@event.update_calendar_events(@events, params[:calendar_event])
|
89
|
-
else
|
90
|
-
@event.attributes = params[:calendar_event]
|
91
|
-
if params[:calendar_event][:period] != "Does not repeat"
|
92
|
-
@event_series = CalendarEventSeries.new(params[:calendar_event])
|
93
|
-
@event_series.repeat_until = Date.civil(params[:repeat_until][:year].to_i, params[:repeat_until][:month].to_i, params[:repeat_until][:day].to_i)
|
94
|
-
@event_series.object_type = @event.object_type
|
95
|
-
@event_series.object_id = @event.object_id
|
96
|
-
@event_series.save
|
97
|
-
|
98
|
-
@event.calendar_event_series = @event_series
|
99
|
-
end
|
100
|
-
@event.save
|
101
|
-
end
|
102
|
-
|
103
|
-
render :update do |page|
|
104
|
-
page<<"$('#calendar').fullCalendar( 'refetchEvents' )"
|
105
|
-
page<<"$('#desc_dialog').dialog('destroy')"
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
def destroy
|
111
|
-
@event = CalendarEvent.find_by_id(params[:id])
|
112
|
-
if params[:delete_all] == 'true'
|
113
|
-
@event.calendar_event_series.destroy
|
114
|
-
elsif params[:delete_all] == 'future'
|
115
|
-
@events = @event.calendar_event_series.calendar_events.find(:all, :conditions => ["starttime > '#{@event.starttime.to_formatted_s(:db)}' "])
|
116
|
-
@event.calendar_event_series.calendar_events.delete(@events)
|
117
|
-
else
|
118
|
-
@event.destroy
|
119
|
-
end
|
120
|
-
|
121
|
-
render :update do |page|
|
122
|
-
page<<"if (parent.$('#reservation_calendar_events').val()) { parent.$('#reservation_calendar_events').val(parent.$('#reservation_calendar_events').val().replace('#{@event.id}','')) };"
|
123
|
-
page<<"$('#calendar').fullCalendar( 'refetchEvents' )"
|
124
|
-
page<<"$('#desc_dialog').dialog('destroy')"
|
125
|
-
end
|
126
|
-
|
127
|
-
end
|
128
|
-
|
129
|
-
def show
|
130
|
-
calendar_events_ids = params[:calendar_events].strip().split(' ')
|
131
|
-
calendar_events = CalendarEvent.find(calendar_events_ids)
|
132
|
-
@schedules = ""
|
133
|
-
|
134
|
-
calendar_events.sort {|a,b| a.starttime <=> b.starttime}.each do |calendar_event|
|
135
|
-
@schedules += "<li id='calendar_schedule_#{calendar_event.id}' class='bit-box' rel='#{calendar_event.id}'>" +
|
136
|
-
"#{calendar_event}"+
|
137
|
-
"<a class='closebutton' href='#' "+
|
138
|
-
"onclick='$.ajax({url: \\\"/calendar_events/delete?id=#{calendar_event.id}\\\"});'>" +
|
139
|
-
"</a></li>"
|
140
|
-
end
|
141
|
-
render :update do |page|
|
142
|
-
page << "$('#holder_schedules').html(\""+@schedules+"\");"
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
def delete
|
147
|
-
calendar_event = CalendarEvent.find_by_id(params[:id])
|
148
|
-
calendar_event.destroy
|
149
|
-
|
150
|
-
render :update do |page|
|
151
|
-
page << "if ($('#reservation_calendar_events').val()) { $('#reservation_calendar_events').val($('#reservation_calendar_events').val().replace('#{calendar_event.id}','')); }"
|
152
|
-
page << "$.ajax({url: '/calendar_events/show?calendar_events='+$('#reservation_calendar_events').val()})"
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
|
157
|
-
end
|