social_stream 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/assets/images/btn/btn_play.png +0 -0
- data/base/app/assets/stylesheets/messages.css.scss +4 -2
- data/base/app/models/activity_object.rb +5 -0
- data/base/app/views/activity_objects/_activity_object.html.erb +1 -1
- data/base/app/views/groups/_show.html.erb +5 -3
- data/base/app/views/notifications/activities/_like.html.erb +1 -1
- data/base/app/views/notifications/activities/_like.text.erb +1 -1
- data/base/app/views/posts/_post_global_search.html.erb +2 -2
- data/base/app/views/users/_show.html.erb +6 -3
- data/base/config/locales/en.yml +3 -1
- data/base/config/locales/es.yml +1 -0
- data/base/lib/generators/social_stream/base/templates/relations.yml +0 -13
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/social_stream-base.gemspec +0 -2
- data/base/spec/dummy/config/relations.yml +0 -13
- data/documents/app/views/common_documents/_show.html.erb +1 -1
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/social_stream-documents.gemspec +1 -1
- data/events/README.rdoc +1 -4
- data/events/app/assets/javascripts/social_stream-events.js +0 -4
- data/events/app/assets/stylesheets/social_stream-events.css +0 -273
- data/events/config/locales/en.yml +0 -115
- data/events/config/locales/es.yml +0 -115
- data/events/config/routes.rb +0 -28
- data/events/db/migrate/20111209120019_reset_events.rb +18 -0
- data/events/lib/social_stream/events/engine.rb +0 -5
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/lib/social_stream-events.rb +0 -18
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/app/assets/javascripts/linkser.js.erb +59 -0
- data/linkser/app/assets/javascripts/social_stream-linkser.js +2 -1
- data/linkser/app/assets/stylesheets/linkser.css.scss +19 -0
- data/linkser/app/controllers/linkser_controller.rb +1 -8
- data/linkser/app/models/link.rb +17 -9
- data/linkser/app/views/links/_link.html.erb +15 -2
- data/linkser/app/views/links/_link_preview.html.erb +3 -0
- data/linkser/lib/social_stream/linkser/version.rb +1 -1
- data/linkser/social_stream-linkser.gemspec +1 -1
- data/presence/ejabberd/ejabberd_files.zip +0 -0
- data/presence/ejabberd/ejabberd_scripts/set_script_header.sh +112 -0
- data/presence/ejabberd/installer.sh +267 -0
- data/presence/ejabberd/mod_sspresence/mod_sspresence.beam +0 -0
- data/presence/ejabberd/mod_sspresence/mod_sspresence.erl +29 -101
- data/presence/lib/generators/social_stream/presence/install_generator.rb +1 -1
- data/presence/lib/generators/social_stream/presence/templates/initializer.rb +6 -4
- data/presence/lib/social_stream/presence/xmpp_server_order.rb +119 -4
- data/presence/lib/social_stream-presence.rb +2 -1
- data/presence/lib/tasks/presence/installer.rake +100 -0
- data/presence/social_stream-presence.gemspec +2 -0
- data/social_stream.gemspec +4 -4
- data/spec/dummy/config/relations.yml +0 -13
- metadata +22 -104
- data/events/GPL Affero license +0 -663
- data/events/app/assets/images/btn/btn_certificate.png +0 -0
- data/events/app/assets/images/btn/btn_certificates.png +0 -0
- data/events/app/assets/images/btn/btn_edit.png +0 -0
- data/events/app/assets/images/btn/btn_embebed.png +0 -0
- data/events/app/assets/images/btn/btn_event.png +0 -0
- data/events/app/assets/images/btn/btn_outline.png +0 -0
- data/events/app/assets/images/btn/event.png +0 -0
- data/events/app/assets/images/btn/flyer.png +0 -0
- data/events/app/assets/images/btn/keynote.png +0 -0
- data/events/app/assets/images/btn/live.png +0 -0
- data/events/app/assets/images/btn/time.png +0 -0
- data/events/app/assets/images/btn/trash.png +0 -0
- data/events/app/assets/images/frontpage/thumbs/tvideo_1_happy.jpg +0 -0
- data/events/app/assets/images/frontpage/thumbs/tvideo_2_kostas.jpg +0 -0
- data/events/app/assets/images/frontpage/thumbs/tvideo_3_colin.jpg +0 -0
- data/events/app/assets/images/frontpage/thumbs/tvideo_4_romilla.jpg +0 -0
- data/events/app/assets/images/frontpage/video_1_happy.jpg +0 -0
- data/events/app/assets/images/frontpage/video_2_kostas.jpg +0 -0
- data/events/app/assets/images/frontpage/video_3_colin.jpg +0 -0
- data/events/app/assets/images/frontpage/video_4_romilla.jpg +0 -0
- data/events/app/assets/images/icons/IconsByGlyphish.txt +0 -1
- data/events/app/assets/images/icons/down.png +0 -0
- data/events/app/assets/images/icons/search.png +0 -0
- data/events/app/assets/images/icons/up.png +0 -0
- data/events/app/assets/images/logos/actor/event.png +0 -0
- data/events/app/assets/images/logos/contact/event.png +0 -0
- data/events/app/assets/images/logos/original/event.png +0 -0
- data/events/app/assets/images/logos/profile/event.png +0 -0
- data/events/app/assets/images/logos/representation/event.png +0 -0
- data/events/app/assets/images/tab_bottom.png +0 -0
- data/events/app/assets/javascripts/schedule.js +0 -123
- data/events/app/controllers/agendas_controller.rb +0 -54
- data/events/app/controllers/events_controller.rb +0 -81
- data/events/app/controllers/sessions_controller.rb +0 -146
- data/events/app/helpers/event_helper.rb +0 -12
- data/events/app/models/agenda.rb +0 -55
- data/events/app/models/event.rb +0 -141
- data/events/app/models/session.rb +0 -23
- data/events/app/views/agendas/_agenda.html.erb +0 -1
- data/events/app/views/agendas/_edit.html.erb +0 -136
- data/events/app/views/agendas/_schedule.html.erb +0 -19
- data/events/app/views/agendas/_show.html.erb +0 -81
- data/events/app/views/agendas/_show_day.html.erb +0 -6
- data/events/app/views/agendas/edit.html.erb +0 -24
- data/events/app/views/agendas/event.html.erb +0 -1
- data/events/app/views/agendas/index.html.erb +0 -0
- data/events/app/views/agendas/show.html.erb +0 -25
- data/events/app/views/documents/_mediawall.html.erb +0 -111
- data/events/app/views/events/_event.html.erb +0 -10
- data/events/app/views/events/_event_focus_search.html.erb +0 -2
- data/events/app/views/events/_event_global_search.html.erb +0 -2
- data/events/app/views/events/_event_with_details.html.erb +0 -2
- data/events/app/views/events/_form.html.erb +0 -12
- data/events/app/views/events/_manage.html.erb +0 -35
- data/events/app/views/events/_new_activity.html.erb +0 -2
- data/events/app/views/events/_new_activity_fields.html.erb +0 -10
- data/events/app/views/events/_sessions_edit.html.erb +0 -46
- data/events/app/views/events/_sidebar_cloud.html.erb +0 -27
- data/events/app/views/events/_sidebar_index.html.erb +0 -1
- data/events/app/views/events/_sidebar_show.html.erb +0 -5
- data/events/app/views/events/agendas.html +0 -1
- data/events/app/views/events/edit.html.erb +0 -12
- data/events/app/views/events/index.html.erb +0 -30
- data/events/app/views/events/manage.html.erb +0 -69
- data/events/app/views/events/manage.js.erb +0 -1
- data/events/app/views/events/new.html.erb +0 -1
- data/events/app/views/events/show.html.erb +0 -38
- data/events/app/views/frontpage/_caracteristics.html.erb +0 -73
- data/events/app/views/frontpage/index.html.erb +0 -72
- data/events/app/views/profiles/_outline.html.erb +0 -81
- data/events/app/views/sessions/_form.html.erb +0 -41
- data/events/app/views/sessions/_new.html.erb +0 -63
- data/events/app/views/sessions/_session.html.erb +0 -1
- data/events/app/views/sessions/_show.html.erb +0 -27
- data/events/app/views/sessions/create.html.erb +0 -3
- data/events/app/views/sessions/create.js.erb +0 -1
- data/events/app/views/sessions/destroy.js.erb +0 -2
- data/events/app/views/sessions/edit.html.erb +0 -27
- data/events/app/views/sessions/index.html.erb +0 -1
- data/events/app/views/sessions/index.js.erb +0 -1
- data/events/app/views/sessions/new.html.erb +0 -27
- data/events/app/views/toolbar/_organizer.html.erb +0 -25
- data/events/app/views/toolbar/_sponsor.html.erb +0 -18
- data/events/app/views/toolbar/_suscribed.html.erb +0 -17
- data/linkser/app/views/links/_link_with_details.html.erb +0 -4
- data/linkser/app/views/posts/_new_activity_fields.erb +0 -53
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
Search icon by http://glyphish.com/
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,123 +0,0 @@
|
|
1
|
-
|
2
|
-
// Place your application-specific JavaScript functions and classes here
|
3
|
-
// This file is automatically included by javascript_include_tag :defaults
|
4
|
-
|
5
|
-
function createSessionEvent(title, start, end, event_id,receiver){
|
6
|
-
jQuery.ajax({
|
7
|
-
data:
|
8
|
-
'session[title]='+title+
|
9
|
-
'&session[_contact_id]='+receiver+
|
10
|
-
'&session[initDate]='+start.toString().substring(0, 24)+
|
11
|
-
'&session[endDate]='+end.toString().substring(0, 24)+
|
12
|
-
'&event_id='+event_id,
|
13
|
-
dataType: 'script',
|
14
|
-
type: 'POST',
|
15
|
-
url: '/events/'+event_id+'/sessions/create'
|
16
|
-
});
|
17
|
-
}
|
18
|
-
|
19
|
-
function moveSession(session, dayDelta, minuteDelta, allDay){
|
20
|
-
|
21
|
-
jQuery.ajax({
|
22
|
-
data: 'id=' + session.id + '&title=' + session.title + '&day_delta=' + dayDelta + '&minute_delta=' + minuteDelta + '&all_day=' + allDay,
|
23
|
-
dataType: 'script',
|
24
|
-
type: 'post',
|
25
|
-
url: '/sessions/'+session.id+'/move'
|
26
|
-
|
27
|
-
});
|
28
|
-
}
|
29
|
-
|
30
|
-
function resizeSession(session, dayDelta, minuteDelta){
|
31
|
-
jQuery.ajax({
|
32
|
-
data: 'id=' + session.id + '&title=' + session.title + '&day_delta=' + dayDelta + '&minute_delta=' + minuteDelta,
|
33
|
-
dataType: 'script',
|
34
|
-
type: 'post',
|
35
|
-
url: '/sessions/'+session.id+'/resize'
|
36
|
-
});
|
37
|
-
}
|
38
|
-
|
39
|
-
function showSessionDetails(session){
|
40
|
-
$('#event_desc').html(session.description);
|
41
|
-
//$('#edit_event').html("<a href = 'javascript:void(0);' onclick ='editSession(" + session.id + ")'>Editar</a>");
|
42
|
-
|
43
|
-
title = session.title;
|
44
|
-
$('#delete_event').html("<a href = 'javascript:void(0);' onclick ='deleteSession(" + session.id + ", " + false + ")'>Eliminar</a>");
|
45
|
-
|
46
|
-
$('#desc_dialog').dialog({
|
47
|
-
title: title,
|
48
|
-
modal: true,
|
49
|
-
width: 500,
|
50
|
-
close: function(session, ui){
|
51
|
-
$('#desc_dialog').dialog('destroy')
|
52
|
-
}
|
53
|
-
});
|
54
|
-
}
|
55
|
-
|
56
|
-
function showSessionDescription(event){
|
57
|
-
$('#event_desc').html(event.description);
|
58
|
-
$('#edit_event').html("");
|
59
|
-
$('#delete_event').html("");
|
60
|
-
|
61
|
-
$('#desc_dialog').dialog({
|
62
|
-
title: event.title,
|
63
|
-
modal: true,
|
64
|
-
width: 500,
|
65
|
-
close: function(event, ui){
|
66
|
-
$('#desc_dialog').dialog('destroy')
|
67
|
-
}
|
68
|
-
});
|
69
|
-
}
|
70
|
-
|
71
|
-
function deleteSession(session_id, delete_all){
|
72
|
-
jQuery.ajax({
|
73
|
-
data: 'id=' + session_id + '&delete_all='+delete_all,
|
74
|
-
dataType: 'script',
|
75
|
-
type: 'post',
|
76
|
-
url: '/sessions/'+session_id+'/destroy'
|
77
|
-
});
|
78
|
-
}
|
79
|
-
|
80
|
-
|
81
|
-
function dateScheduleAvailable(start, end, allDay){
|
82
|
-
return $('#calendar').fullCalendar('clientEvents', function(session)
|
83
|
-
{
|
84
|
-
if ((session.initDate < start && start < session.endDate) ||
|
85
|
-
(session.initDate < end && end < session.endDate) ||
|
86
|
-
(compareDate(session.initDate, start) && (session.allDay || allDay))
|
87
|
-
)
|
88
|
-
{
|
89
|
-
return true;
|
90
|
-
}
|
91
|
-
return false;
|
92
|
-
}) == '';
|
93
|
-
}
|
94
|
-
|
95
|
-
function dateAvailable(start, end, allDay){
|
96
|
-
return $('#calendar').fullCalendar('clientEvents', function(session)
|
97
|
-
{
|
98
|
-
if (session.initDate < start && start < session.endDate)
|
99
|
-
return true;
|
100
|
-
else if (session.initDate < end && end < session.endDate)
|
101
|
-
return true;
|
102
|
-
else if (session.initDate > start && (session.endDate && session.endDate < end))
|
103
|
-
return true;
|
104
|
-
else if (compareDateWithMinutes(session.initDate, start))
|
105
|
-
return true;
|
106
|
-
else if (session.endDate && compareDateWithMinutes(session.endDate, end))
|
107
|
-
return true;
|
108
|
-
else if (compareDate(session.initDate, start) && (session.allDay || allDay))
|
109
|
-
return true;
|
110
|
-
else
|
111
|
-
return false;
|
112
|
-
}) == '' && (start >= new Date(new Date().getTime() + 5*60*1000) && start <= new Date(new Date().getTime() + 3*30*24*60*60*1000));
|
113
|
-
}
|
114
|
-
|
115
|
-
function compareDate(date1, date2)
|
116
|
-
{
|
117
|
-
return $.fullCalendar.formatDate(date1, "yyyy-MM-dd") == $.fullCalendar.formatDate(date2, "yyyy-MM-dd");
|
118
|
-
}
|
119
|
-
|
120
|
-
function compareDateWithMinutes(date1, date2)
|
121
|
-
{
|
122
|
-
return $.fullCalendar.formatDate(date1, "yyyy-MM-dd HH:mm") == $.fullCalendar.formatDate(date2, "yyyy-MM-dd HH:mm");
|
123
|
-
}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
class AgendasController < InheritedResources::Base
|
2
|
-
#protect_from_forgery
|
3
|
-
|
4
|
-
def schedule
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
def index
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
def edit
|
13
|
-
@event = Event.find_by_slug(params[:id])
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def get_sessions()
|
19
|
-
@event = Event.find_by_slug(params[:id])
|
20
|
-
@agenda = Agenda.find_by_id(@event.agenda.id)
|
21
|
-
@sessions = @agenda.getSessions(@event.id,Time.at(params['start'].to_i),Time.at(params['end'].to_i))
|
22
|
-
|
23
|
-
sessions = []
|
24
|
-
@sessions.each do |session|
|
25
|
-
sessions << {:id => session.id,
|
26
|
-
:title => session.title,
|
27
|
-
:description => session.description || "Some cool description here...",
|
28
|
-
:start => "#{session.initDate.iso8601}",
|
29
|
-
:end => "#{session.endDate.iso8601}",
|
30
|
-
:allDay => false,
|
31
|
-
:recurring => false,
|
32
|
-
:editable => true
|
33
|
-
}
|
34
|
-
end
|
35
|
-
render :text => sessions.to_json
|
36
|
-
end
|
37
|
-
|
38
|
-
def show
|
39
|
-
@event = Event.find_by_slug(params[:id])
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
def create
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
|
@@ -1,81 +0,0 @@
|
|
1
|
-
class EventsController < InheritedResources::Base
|
2
|
-
# Set group founder to current_subject
|
3
|
-
# Must do before authorization
|
4
|
-
#before_filter :authenticate_user!
|
5
|
-
|
6
|
-
before_filter :set_founder, :only => :create
|
7
|
-
|
8
|
-
#load_and_authorize_resource
|
9
|
-
|
10
|
-
respond_to :html, :js
|
11
|
-
|
12
|
-
def create
|
13
|
-
create! do |success, failure|
|
14
|
-
success.html {
|
15
|
-
self.current_subject = @event
|
16
|
-
redirect_to [current_subject, :profile]
|
17
|
-
}
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def edit
|
22
|
-
@event = Event.find(params[:id])
|
23
|
-
end
|
24
|
-
|
25
|
-
def index
|
26
|
-
@events = Event.most(params[:most]).
|
27
|
-
alphabetic.
|
28
|
-
letter(params[:letter]).
|
29
|
-
name_search(params[:search]).
|
30
|
-
tagged_with(params[:tag]).
|
31
|
-
page(params[:page]).per(10)
|
32
|
-
end
|
33
|
-
|
34
|
-
def manage
|
35
|
-
if params[:live].nil?
|
36
|
-
@events = Event.
|
37
|
-
most(params[:most]).
|
38
|
-
alphabetic.letter(params[:letter]).
|
39
|
-
name_search(params[:search]).
|
40
|
-
tagged_with(params[:tag]).
|
41
|
-
page(params[:page]).per(10)
|
42
|
-
else
|
43
|
-
@events = Event.
|
44
|
-
live_events().
|
45
|
-
alphabetic.letter(params[:letter]).
|
46
|
-
name_search(params[:search]).
|
47
|
-
tagged_with(params[:tag]).
|
48
|
-
page(params[:page]).per(10)
|
49
|
-
#@groups = Group.most(params[:most]).
|
50
|
-
# alphabetic.
|
51
|
-
# letter(params[:letter]).
|
52
|
-
# name_search(params[:search]).
|
53
|
-
# tagged_with(params[:tag]).
|
54
|
-
# page(params[:page]).per(10)
|
55
|
-
end
|
56
|
-
index! do |format|
|
57
|
-
format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def outline
|
62
|
-
|
63
|
-
end
|
64
|
-
|
65
|
-
protected
|
66
|
-
|
67
|
-
# Overwrite resource method to support slug
|
68
|
-
# See InheritedResources::BaseHelpers#resource
|
69
|
-
def resource
|
70
|
-
@event ||= end_of_association_chain.find_by_slug!(params[:id])
|
71
|
-
end
|
72
|
-
|
73
|
-
private
|
74
|
-
|
75
|
-
def set_founder
|
76
|
-
return unless user_signed_in?
|
77
|
-
params[:event] ||= {}
|
78
|
-
params[:event][:_founder] ||= current_subject.slug
|
79
|
-
end
|
80
|
-
|
81
|
-
end
|
@@ -1,146 +0,0 @@
|
|
1
|
-
class SessionsController < InheritedResources::Base
|
2
|
-
|
3
|
-
before_filter :authenticate_user!
|
4
|
-
|
5
|
-
def new
|
6
|
-
@event= Event.find_by_id(params[:id])
|
7
|
-
@session= Session.new
|
8
|
-
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
def edit
|
13
|
-
@event= Event.find_by_id(params[:id_event])
|
14
|
-
@session= Session.find_by_id(params[:id])
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
def update
|
19
|
-
@event = Event.find_by_id(params[:id_event])
|
20
|
-
params[:session][:agenda_id]=@event.agenda.id
|
21
|
-
@session = Session.find_by_id(params[:id])
|
22
|
-
@session.update_attributes(params[:session])
|
23
|
-
# @session = Session.new (params[:session])
|
24
|
-
# @session.save
|
25
|
-
if @event.initDate.nil?
|
26
|
-
@event.initDate = @session.initDate
|
27
|
-
@event.endDate = @session.endDate
|
28
|
-
@event.save
|
29
|
-
else
|
30
|
-
if @event.initDate > @session.initDate
|
31
|
-
@event.initDate = @session.initDate
|
32
|
-
end
|
33
|
-
if @event.endDate < @session.endDate
|
34
|
-
@event.endDate = @session.endDate
|
35
|
-
end
|
36
|
-
@event.save
|
37
|
-
end
|
38
|
-
redirect_to "/agendas/"+@event.slug
|
39
|
-
end
|
40
|
-
|
41
|
-
def create
|
42
|
-
@event = Event.find_by_id(params[:event_id])
|
43
|
-
params[:session][:agenda_id]=@event.agenda.id
|
44
|
-
@session = Session.new (params[:session])
|
45
|
-
|
46
|
-
# default configuration for VC server
|
47
|
-
@event.vc_mode = Event::VC_MODE.index(:in_person)
|
48
|
-
@session.cm_streaming = @event.streaming_by_default # this param is to set streamming url for vc-event
|
49
|
-
@session.cm_recording = true #this param is only true if recording is automatic
|
50
|
-
|
51
|
-
#debugger
|
52
|
-
|
53
|
-
begin
|
54
|
-
@session.save
|
55
|
-
rescue StandardError => e
|
56
|
-
@session.errors[:base]<<(e.to_s)
|
57
|
-
end
|
58
|
-
|
59
|
-
if @event.initDate.nil?
|
60
|
-
@event.initDate = @session.initDate
|
61
|
-
@event.endDate = @session.endDate
|
62
|
-
@event.save
|
63
|
-
else
|
64
|
-
if @event.initDate > @session.initDate
|
65
|
-
@event.initDate = @session.initDate
|
66
|
-
end
|
67
|
-
if @event.endDate < @session.endDate
|
68
|
-
@event.endDate = @session.endDate
|
69
|
-
end
|
70
|
-
@event.save
|
71
|
-
end
|
72
|
-
# render :json => @session
|
73
|
-
redirect_to "/agendas/"+@event.slug
|
74
|
-
end
|
75
|
-
|
76
|
-
def index
|
77
|
-
@event = Event.find_by_slug(params[:event_id])
|
78
|
-
respond_to do |format|
|
79
|
-
format.html
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def move
|
84
|
-
@session = Session.find_by_id(params[:id])
|
85
|
-
if @session
|
86
|
-
@session.initDate = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.initDate))
|
87
|
-
@session.endDate = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.endDate))
|
88
|
-
@session.save
|
89
|
-
end
|
90
|
-
|
91
|
-
if @event.initDate.nil?
|
92
|
-
@event.initDate = @session.initDate
|
93
|
-
@event.endDate = @session.endDate
|
94
|
-
@event.save
|
95
|
-
else
|
96
|
-
if @event.initDate > @session.initDate
|
97
|
-
@event.initDate = @session.initDate
|
98
|
-
end
|
99
|
-
if @event.endDate < @session.endDate
|
100
|
-
@event.endDate = @session.endDate
|
101
|
-
end
|
102
|
-
@event.save
|
103
|
-
end
|
104
|
-
|
105
|
-
render :json => @session
|
106
|
-
end
|
107
|
-
|
108
|
-
def resize
|
109
|
-
@session = Session.find(params[:id])
|
110
|
-
if @session
|
111
|
-
@session.endDate = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.endDate))
|
112
|
-
@session.save
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
|
117
|
-
def destroy
|
118
|
-
@session = Session.find(params[:id])
|
119
|
-
@event = @session.event
|
120
|
-
initDate=@session.initDate
|
121
|
-
endDate=@session.endDate
|
122
|
-
@session.destroy
|
123
|
-
|
124
|
-
if !@event.initDate.nil?
|
125
|
-
if initDate < @event.initDate
|
126
|
-
#changing the initDate of the event
|
127
|
-
@event.initDate = @event.sessions.order("initDate ASC").map{|x| x.initDate}.first
|
128
|
-
end
|
129
|
-
if endDate > @event.endDate
|
130
|
-
#changing the endDate of the event
|
131
|
-
@event.endDate = @event.sessions.order("endDate DESC").map{|x| x.endDate}.first
|
132
|
-
end
|
133
|
-
@event.save
|
134
|
-
end
|
135
|
-
redirect_to "/agendas/"+@event.slug
|
136
|
-
end
|
137
|
-
|
138
|
-
|
139
|
-
def show
|
140
|
-
@event = Event.find_by_slug(params[:id])
|
141
|
-
|
142
|
-
end
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
end
|
data/events/app/models/agenda.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
class Agenda < ActiveRecord::Base
|
2
|
-
include SocialStream::Models::Object
|
3
|
-
|
4
|
-
belongs_to :event
|
5
|
-
has_many :sessions, :dependent => :destroy
|
6
|
-
|
7
|
-
validates_presence_of :event_id
|
8
|
-
|
9
|
-
# Fullcalendar slot values
|
10
|
-
SLOT_VALUES=[5,15,30]
|
11
|
-
|
12
|
-
=begin
|
13
|
-
def to_fullcalendar_json
|
14
|
-
sessions.map(&:to_fullcalendar_json).join(", ")
|
15
|
-
|
16
|
-
"[#{sessions.map(&:to_fullcalendar_json).join(", ")}]"
|
17
|
-
end
|
18
|
-
=end
|
19
|
-
|
20
|
-
|
21
|
-
def start_date
|
22
|
-
event.initDate
|
23
|
-
end
|
24
|
-
|
25
|
-
def end_date
|
26
|
-
event.endDate
|
27
|
-
end
|
28
|
-
|
29
|
-
def getSessions(id,time_start,time_end)
|
30
|
-
@sessions = sessions.where( "initDate >= '#{time_start.to_formatted_s(:db)}' AND
|
31
|
-
endDate <= '#{time_end.to_formatted_s(:db)}' ")
|
32
|
-
end
|
33
|
-
|
34
|
-
def contents_for_day(i)
|
35
|
-
|
36
|
-
@sessions = sessions.where(
|
37
|
-
"initDate >= :day_start AND initDate < :day_end", {:day_start => start_date.to_date + (i-1).day,
|
38
|
-
:day_end => start_date.to_date + i.day})
|
39
|
-
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
def self.next_time_slot_for_drop_down
|
44
|
-
if Time.zone.now.min > 40
|
45
|
-
Time.zone.parse("#{Time.zone.now.hour + 1}:00")
|
46
|
-
else
|
47
|
-
Time.zone.parse("#{Time.zone.now.hour}:#{(Time.zone.now.min.to_f/SLOT_VALUES[1]).ceil*SLOT_VALUES[1]}")
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
data/events/app/models/event.rb
DELETED
@@ -1,141 +0,0 @@
|
|
1
|
-
class Event < ActiveRecord::Base
|
2
|
-
include SocialStream::Models::Subject
|
3
|
-
#acts_as_conference_manager_event
|
4
|
-
|
5
|
-
has_one :agenda, :dependent => :destroy
|
6
|
-
has_many :sessions, :through => :agenda
|
7
|
-
|
8
|
-
attr_accessor :_founder
|
9
|
-
attr_accessor :_participants
|
10
|
-
|
11
|
-
delegate :description, :description=, :to => :profile!
|
12
|
-
|
13
|
-
after_create :create_founder
|
14
|
-
after_create :create_participants
|
15
|
-
after_create :create_agenda
|
16
|
-
|
17
|
-
scope :live_events, lambda {
|
18
|
-
where("events.initDate <= ? AND events.endDate > ?", Time.zone.now, Time.zone.now)
|
19
|
-
}
|
20
|
-
|
21
|
-
VC_MODE = [:in_person, :telemeeting, :teleconference, :teleclass]
|
22
|
-
RECORDING_TYPE = [:automatic, :manual, :none]
|
23
|
-
|
24
|
-
#acts_as_conference_manager_event
|
25
|
-
def profile!
|
26
|
-
actor!.profile || actor!.build_profile
|
27
|
-
end
|
28
|
-
|
29
|
-
def followers
|
30
|
-
contact_subjects(:subject_type => :user, :direction => :received)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Creates the ties between the group and the founder
|
34
|
-
def create_founder
|
35
|
-
founder =
|
36
|
-
Actor.find_by_slug(_founder) || raise("Cannot create event without founder")
|
37
|
-
|
38
|
-
sent_contacts.create! :receiver => founder,
|
39
|
-
:relation_ids => Array(relation_customs.sort.first.id)
|
40
|
-
end
|
41
|
-
|
42
|
-
# Creates the ties between the group and the participants
|
43
|
-
def create_participants
|
44
|
-
return if @_participants.blank?
|
45
|
-
|
46
|
-
@_participants.each do |participant|
|
47
|
-
|
48
|
-
participant_actor = Actor.find(participant)
|
49
|
-
|
50
|
-
sent_contacts.create! :receiver => participant_actor,
|
51
|
-
:relation_ids => Array(relation_customs.sort.first.id)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
def create_agenda
|
56
|
-
agenda = Agenda.new
|
57
|
-
agenda._contact_id = self._contact_id
|
58
|
-
self.agenda = agenda
|
59
|
-
end
|
60
|
-
|
61
|
-
def days
|
62
|
-
if has_date?
|
63
|
-
(endDate.to_date - initDate.to_date).to_i + 1
|
64
|
-
else
|
65
|
-
return 0
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
#method to know if this event is happening now
|
70
|
-
def is_happening_now?
|
71
|
-
#first we check if start date is past and end date is future
|
72
|
-
if has_date? && initDate.past? && endDate.future?
|
73
|
-
true
|
74
|
-
else
|
75
|
-
return false
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
|
80
|
-
#method to know if this event has any session now
|
81
|
-
def has_session_now?
|
82
|
-
get_session_now
|
83
|
-
end
|
84
|
-
|
85
|
-
def get_session_now
|
86
|
-
#first we check if start date is past and end date is future
|
87
|
-
if is_happening_now?
|
88
|
-
#now we check the sessions
|
89
|
-
agenda.agenda_entries.each do |session|
|
90
|
-
return entry if entry.initDate.past? && entry.end_time.future?
|
91
|
-
end
|
92
|
-
end
|
93
|
-
return nil
|
94
|
-
end
|
95
|
-
|
96
|
-
#method to know if an event happens in the future
|
97
|
-
def future?
|
98
|
-
return has_date? && initDate.future?
|
99
|
-
end
|
100
|
-
|
101
|
-
|
102
|
-
#method to know if an event happens in the past
|
103
|
-
def past?
|
104
|
-
return has_date? && endDate.past?
|
105
|
-
end
|
106
|
-
|
107
|
-
|
108
|
-
def has_date?
|
109
|
-
initDate
|
110
|
-
end
|
111
|
-
|
112
|
-
def isabel_bw
|
113
|
-
256
|
114
|
-
end
|
115
|
-
|
116
|
-
def get_formatted_date
|
117
|
-
has_date? ?
|
118
|
-
I18n::localize(initDate, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
|
119
|
-
I18n::t('date.undefined')
|
120
|
-
end
|
121
|
-
|
122
|
-
def get_formatted_day
|
123
|
-
has_date? ?
|
124
|
-
I18n::localize(initDate, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
|
125
|
-
I18n::t('date.undefined')
|
126
|
-
end
|
127
|
-
|
128
|
-
def get_formatted_timezone
|
129
|
-
has_date? ?
|
130
|
-
"#{Time.zone.name} (#{initDate.zone}, GMT #{initDate.formatted_offset})" :
|
131
|
-
I18n::t('date.undefined')
|
132
|
-
end
|
133
|
-
|
134
|
-
#method to get the starting hour of an event in the correct format
|
135
|
-
def get_formatted_hour
|
136
|
-
has_date? ? initDate.strftime("%H:%M") : I18n::t('date.undefined')
|
137
|
-
end
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
class Session < ActiveRecord::Base
|
2
|
-
include SocialStream::Models::Object
|
3
|
-
acts_as_conference_manager_session
|
4
|
-
|
5
|
-
belongs_to :agenda
|
6
|
-
has_one :event, :through => :agenda
|
7
|
-
|
8
|
-
validates_presence_of :agenda_id
|
9
|
-
|
10
|
-
acts_as_conference_manager_session
|
11
|
-
def to_fullcalendar_json
|
12
|
-
"{title: '#{name}', start: new Date(#{initDate.year},#{initDate.month-1},#{initDate.day},#{initDate.hour},#{initDate.min}),end: new Date(#{endDate.year},#{endDate.month-1},#{endDate.day},#{endDate.hour},#{endDate.min}),allDay: false}"
|
13
|
-
end
|
14
|
-
|
15
|
-
def sanitize_for_fullcalendar(string)
|
16
|
-
string.gsub("\r","").gsub("\n","<br />").gsub(/["]/, '\'')
|
17
|
-
end
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|