social_stream 0.9.7 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +1 -0
- data/base/app/assets/javascripts/activities.js.erb +10 -2
- data/base/app/assets/stylesheets/activities.css +6 -4
- data/base/app/helpers/contacts_helper.rb +4 -2
- data/base/app/models/tie.rb +1 -1
- data/{events/app/views/activities/_index.html.erb → base/app/views/activities/_filter.html.erb} +1 -12
- data/base/app/views/activities/_options.html.erb +9 -6
- data/base/app/views/comments/_new.html.erb +16 -15
- data/base/app/views/profiles/_profile.html.erb +4 -0
- data/base/app/views/settings/_contacts.html.erb +16 -0
- data/base/app/views/settings/_index.html.erb +1 -0
- data/base/app/views/toolbar/_logo.html.erb +7 -0
- data/base/app/views/toolbar/_profile.html.erb +8 -1
- data/base/config/locales/en.yml +7 -23
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/tasks/db/populate.rake +1 -1
- data/events/config/locales/en.yml +0 -9
- data/events/config/routes.rb +0 -16
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +2 -1
- metadata +40 -73
- data/base/lib/tasks/resque.rake +0 -3
- data/events/app/assets/javascripts/settings.js +0 -20
- data/events/app/assets/stylesheets/activities.css +0 -4
- data/events/app/assets/stylesheets/settings.css +0 -4
- data/events/app/assets/stylesheets/tie.css +0 -4
- data/events/app/assets/stylesheets/users.css +0 -4
- data/events/app/controllers/activities_controller.rb +0 -42
- data/events/app/controllers/calendar_events_controller.rb +0 -157
- data/events/app/controllers/settings_controller.rb +0 -70
- data/events/app/views/activities/_activity.html.erb +0 -5
- data/events/app/views/activities/_child.html.erb +0 -18
- data/events/app/views/activities/_comments.html.erb +0 -3
- data/events/app/views/activities/_options.html.erb +0 -15
- data/events/app/views/activities/_root.html.erb +0 -37
- data/events/app/views/activities/_wall.html.erb +0 -5
- data/events/app/views/activities/_walls.html.erb +0 -34
- data/events/app/views/activities/documents.js.erb +0 -1
- data/events/app/views/activities/index.js.erb +0 -1
- data/events/app/views/calendar_events/_calendar.html.erb +0 -0
- data/events/app/views/calendar_events/_edit_form.html.erb +0 -58
- data/events/app/views/calendar_events/_form.html.erb +0 -65
- data/events/app/views/calendar_events/available.html.erb +0 -81
- data/events/app/views/calendar_events/create.js.erb +0 -18
- data/events/app/views/calendar_events/edit.js.erb +0 -1
- data/events/app/views/calendar_events/index.html.erb +0 -162
- data/events/app/views/calendar_events/move.js.erb +0 -0
- data/events/app/views/calendar_events/new.js.erb +0 -9
- data/events/app/views/calendar_events/resize.js.erb +0 -0
- data/events/app/views/calendar_events/schedule.html.erb +0 -143
- data/events/app/views/kaminari/_first_page.html.erb +0 -11
- data/events/app/views/kaminari/_gap.html.erb +0 -8
- data/events/app/views/kaminari/_last_page.html.erb +0 -11
- data/events/app/views/kaminari/_next_page.html.erb +0 -11
- data/events/app/views/kaminari/_page.html.erb +0 -12
- data/events/app/views/kaminari/_paginator.html.erb +0 -23
- data/events/app/views/kaminari/_prev_page.html.erb +0 -11
- data/events/app/views/profiles/_profile.html.erb +0 -40
- data/events/app/views/settings/_contacto.html.erb +0 -24
- data/events/app/views/settings/_header.html.erb +0 -8
- data/events/app/views/settings/_index.html.erb +0 -16
- data/events/app/views/settings/_manage.html.erb +0 -25
- data/events/app/views/settings/_settings.html.erb +0 -49
- data/events/app/views/settings/delete_relation.js.erb +0 -3
- data/events/app/views/settings/index.html.erb +0 -38
- data/events/app/views/settings/manage.html.erb +0 -31
- data/events/app/views/settings/show.html.erb +0 -15
- data/events/app/views/settings/update_relation.js.erb +0 -1
- data/events/app/views/toolbar/_home.html.erb +0 -11
- data/events/app/views/toolbar/_logo.html.erb +0 -23
- data/events/app/views/toolbar/_profile.html.erb +0 -21
data/social_stream.gemspec
CHANGED
@@ -11,8 +11,9 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.files = `git ls-files`.split("\n")
|
12
12
|
|
13
13
|
# Gem dependencies
|
14
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.9.
|
14
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.9.11')
|
15
15
|
s.add_runtime_dependency('social_stream-documents', '~> 0.2.8')
|
16
|
+
s.add_runtime_dependency('social_stream-events', '~> 0.0.4')
|
16
17
|
|
17
18
|
# Development Gem dependencies
|
18
19
|
#
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- GING - DIT - UPM
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-09-
|
19
|
+
date: 2011-09-29 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 45
|
31
31
|
segments:
|
32
32
|
- 0
|
33
33
|
- 9
|
34
|
-
-
|
35
|
-
version: 0.9.
|
34
|
+
- 11
|
35
|
+
version: 0.9.11
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -52,9 +52,25 @@ dependencies:
|
|
52
52
|
type: :runtime
|
53
53
|
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: social_stream-events
|
56
56
|
prerelease: false
|
57
57
|
requirement: &id003 !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 23
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
- 0
|
66
|
+
- 4
|
67
|
+
version: 0.0.4
|
68
|
+
type: :runtime
|
69
|
+
version_requirements: *id003
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: capybara
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
58
74
|
none: false
|
59
75
|
requirements:
|
60
76
|
- - ~>
|
@@ -66,11 +82,11 @@ dependencies:
|
|
66
82
|
- 9
|
67
83
|
version: 0.3.9
|
68
84
|
type: :development
|
69
|
-
version_requirements: *
|
85
|
+
version_requirements: *id004
|
70
86
|
- !ruby/object:Gem::Dependency
|
71
87
|
name: sqlite3-ruby
|
72
88
|
prerelease: false
|
73
|
-
requirement: &
|
89
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
74
90
|
none: false
|
75
91
|
requirements:
|
76
92
|
- - ">="
|
@@ -80,11 +96,11 @@ dependencies:
|
|
80
96
|
- 0
|
81
97
|
version: "0"
|
82
98
|
type: :development
|
83
|
-
version_requirements: *
|
99
|
+
version_requirements: *id005
|
84
100
|
- !ruby/object:Gem::Dependency
|
85
101
|
name: ruby-debug
|
86
102
|
prerelease: false
|
87
|
-
requirement: &
|
103
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
88
104
|
none: false
|
89
105
|
requirements:
|
90
106
|
- - ~>
|
@@ -96,11 +112,11 @@ dependencies:
|
|
96
112
|
- 3
|
97
113
|
version: 0.10.3
|
98
114
|
type: :development
|
99
|
-
version_requirements: *
|
115
|
+
version_requirements: *id006
|
100
116
|
- !ruby/object:Gem::Dependency
|
101
117
|
name: rspec-rails
|
102
118
|
prerelease: false
|
103
|
-
requirement: &
|
119
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
104
120
|
none: false
|
105
121
|
requirements:
|
106
122
|
- - ~>
|
@@ -112,11 +128,11 @@ dependencies:
|
|
112
128
|
- 0
|
113
129
|
version: 2.5.0
|
114
130
|
type: :development
|
115
|
-
version_requirements: *
|
131
|
+
version_requirements: *id007
|
116
132
|
- !ruby/object:Gem::Dependency
|
117
133
|
name: factory_girl
|
118
134
|
prerelease: false
|
119
|
-
requirement: &
|
135
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
120
136
|
none: false
|
121
137
|
requirements:
|
122
138
|
- - ~>
|
@@ -128,11 +144,11 @@ dependencies:
|
|
128
144
|
- 2
|
129
145
|
version: 1.3.2
|
130
146
|
type: :development
|
131
|
-
version_requirements: *
|
147
|
+
version_requirements: *id008
|
132
148
|
- !ruby/object:Gem::Dependency
|
133
149
|
name: forgery
|
134
150
|
prerelease: false
|
135
|
-
requirement: &
|
151
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
136
152
|
none: false
|
137
153
|
requirements:
|
138
154
|
- - ~>
|
@@ -144,11 +160,11 @@ dependencies:
|
|
144
160
|
- 6
|
145
161
|
version: 0.3.6
|
146
162
|
type: :development
|
147
|
-
version_requirements: *
|
163
|
+
version_requirements: *id009
|
148
164
|
- !ruby/object:Gem::Dependency
|
149
165
|
name: ci_reporter
|
150
166
|
prerelease: false
|
151
|
-
requirement: &
|
167
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
152
168
|
none: false
|
153
169
|
requirements:
|
154
170
|
- - ~>
|
@@ -160,7 +176,7 @@ dependencies:
|
|
160
176
|
- 4
|
161
177
|
version: 1.6.4
|
162
178
|
type: :development
|
163
|
-
version_requirements: *
|
179
|
+
version_requirements: *id010
|
164
180
|
description: Ruby on Rails engine supporting social networking features and activity streams.
|
165
181
|
email:
|
166
182
|
executables: []
|
@@ -447,6 +463,7 @@ files:
|
|
447
463
|
- base/app/views/activities/_activity.html.erb
|
448
464
|
- base/app/views/activities/_child.html.erb
|
449
465
|
- base/app/views/activities/_comments.html.erb
|
466
|
+
- base/app/views/activities/_filter.html.erb
|
450
467
|
- base/app/views/activities/_index.html.erb
|
451
468
|
- base/app/views/activities/_new.html.erb
|
452
469
|
- base/app/views/activities/_options.html.erb
|
@@ -587,6 +604,7 @@ files:
|
|
587
604
|
- base/app/views/search/index.html.erb
|
588
605
|
- base/app/views/search/index.js.erb
|
589
606
|
- base/app/views/settings/_api_key.html.erb
|
607
|
+
- base/app/views/settings/_contacts.html.erb
|
590
608
|
- base/app/views/settings/_index.html.erb
|
591
609
|
- base/app/views/settings/_notifications.html.erb
|
592
610
|
- base/app/views/settings/index.html.erb
|
@@ -643,7 +661,6 @@ files:
|
|
643
661
|
- base/lib/social_stream/test_helpers/controllers.rb
|
644
662
|
- base/lib/social_stream/toolbar_config/base.rb
|
645
663
|
- base/lib/tasks/db/populate.rake
|
646
|
-
- base/lib/tasks/resque.rake
|
647
664
|
- base/lib/tasks/workers.rake
|
648
665
|
- base/social_stream-base.gemspec
|
649
666
|
- base/spec/controllers/comments_controller_spec.rb
|
@@ -956,35 +973,17 @@ files:
|
|
956
973
|
- events/app/assets/images/logos/representation/event.png
|
957
974
|
- events/app/assets/images/tab_bottom.png
|
958
975
|
- events/app/assets/javascripts/schedule.js
|
959
|
-
- events/app/assets/javascripts/settings.js
|
960
976
|
- events/app/assets/javascripts/social_stream-events.js
|
961
|
-
- events/app/assets/stylesheets/activities.css
|
962
977
|
- events/app/assets/stylesheets/fullcalendar.css
|
963
978
|
- events/app/assets/stylesheets/fullcalendar.print.css
|
964
|
-
- events/app/assets/stylesheets/settings.css
|
965
979
|
- events/app/assets/stylesheets/social_stream-events.css
|
966
|
-
- events/app/assets/stylesheets/tie.css
|
967
|
-
- events/app/assets/stylesheets/users.css
|
968
|
-
- events/app/controllers/activities_controller.rb
|
969
980
|
- events/app/controllers/agendas_controller.rb
|
970
|
-
- events/app/controllers/calendar_events_controller.rb
|
971
981
|
- events/app/controllers/events_controller.rb
|
972
982
|
- events/app/controllers/sessions_controller.rb
|
973
|
-
- events/app/controllers/settings_controller.rb
|
974
983
|
- events/app/helpers/event_helper.rb
|
975
984
|
- events/app/models/agenda.rb
|
976
985
|
- events/app/models/event.rb
|
977
986
|
- events/app/models/session.rb
|
978
|
-
- events/app/views/activities/_activity.html.erb
|
979
|
-
- events/app/views/activities/_child.html.erb
|
980
|
-
- events/app/views/activities/_comments.html.erb
|
981
|
-
- events/app/views/activities/_index.html.erb
|
982
|
-
- events/app/views/activities/_options.html.erb
|
983
|
-
- events/app/views/activities/_root.html.erb
|
984
|
-
- events/app/views/activities/_wall.html.erb
|
985
|
-
- events/app/views/activities/_walls.html.erb
|
986
|
-
- events/app/views/activities/documents.js.erb
|
987
|
-
- events/app/views/activities/index.js.erb
|
988
987
|
- events/app/views/agendas/_agenda.html.erb
|
989
988
|
- events/app/views/agendas/_edit.html.erb
|
990
989
|
- events/app/views/agendas/_schedule.html.erb
|
@@ -994,17 +993,6 @@ files:
|
|
994
993
|
- events/app/views/agendas/event.html.erb
|
995
994
|
- events/app/views/agendas/index.html.erb
|
996
995
|
- events/app/views/agendas/show.html.erb
|
997
|
-
- events/app/views/calendar_events/_calendar.html.erb
|
998
|
-
- events/app/views/calendar_events/_edit_form.html.erb
|
999
|
-
- events/app/views/calendar_events/_form.html.erb
|
1000
|
-
- events/app/views/calendar_events/available.html.erb
|
1001
|
-
- events/app/views/calendar_events/create.js.erb
|
1002
|
-
- events/app/views/calendar_events/edit.js.erb
|
1003
|
-
- events/app/views/calendar_events/index.html.erb
|
1004
|
-
- events/app/views/calendar_events/move.js.erb
|
1005
|
-
- events/app/views/calendar_events/new.js.erb
|
1006
|
-
- events/app/views/calendar_events/resize.js.erb
|
1007
|
-
- events/app/views/calendar_events/schedule.html.erb
|
1008
996
|
- events/app/views/documents/_mediawall.html.erb
|
1009
997
|
- events/app/views/events/_event.html.erb
|
1010
998
|
- events/app/views/events/_event_with_details.html.erb
|
@@ -1023,15 +1011,7 @@ files:
|
|
1023
1011
|
- events/app/views/events/manage.html.erb
|
1024
1012
|
- events/app/views/events/manage.js.erb
|
1025
1013
|
- events/app/views/events/show.html.erb
|
1026
|
-
- events/app/views/kaminari/_first_page.html.erb
|
1027
|
-
- events/app/views/kaminari/_gap.html.erb
|
1028
|
-
- events/app/views/kaminari/_last_page.html.erb
|
1029
|
-
- events/app/views/kaminari/_next_page.html.erb
|
1030
|
-
- events/app/views/kaminari/_page.html.erb
|
1031
|
-
- events/app/views/kaminari/_paginator.html.erb
|
1032
|
-
- events/app/views/kaminari/_prev_page.html.erb
|
1033
1014
|
- events/app/views/profiles/_outline.html.erb
|
1034
|
-
- events/app/views/profiles/_profile.html.erb
|
1035
1015
|
- events/app/views/sessions/_form.html.erb
|
1036
1016
|
- events/app/views/sessions/_new.html.erb
|
1037
1017
|
- events/app/views/sessions/_session.html.erb
|
@@ -1043,20 +1023,7 @@ files:
|
|
1043
1023
|
- events/app/views/sessions/index.html.erb
|
1044
1024
|
- events/app/views/sessions/index.js.erb
|
1045
1025
|
- events/app/views/sessions/new.html.erb
|
1046
|
-
- events/app/views/settings/_contacto.html.erb
|
1047
|
-
- events/app/views/settings/_header.html.erb
|
1048
|
-
- events/app/views/settings/_index.html.erb
|
1049
|
-
- events/app/views/settings/_manage.html.erb
|
1050
|
-
- events/app/views/settings/_settings.html.erb
|
1051
|
-
- events/app/views/settings/delete_relation.js.erb
|
1052
|
-
- events/app/views/settings/index.html.erb
|
1053
|
-
- events/app/views/settings/manage.html.erb
|
1054
|
-
- events/app/views/settings/show.html.erb
|
1055
|
-
- events/app/views/settings/update_relation.js.erb
|
1056
|
-
- events/app/views/toolbar/_home.html.erb
|
1057
|
-
- events/app/views/toolbar/_logo.html.erb
|
1058
1026
|
- events/app/views/toolbar/_organizer.html.erb
|
1059
|
-
- events/app/views/toolbar/_profile.html.erb
|
1060
1027
|
- events/app/views/toolbar/_sponsor.html.erb
|
1061
1028
|
- events/app/views/toolbar/_suscribed.html.erb
|
1062
1029
|
- events/config/locales/en.yml
|
data/base/lib/tasks/resque.rake
DELETED
@@ -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
|