social_stream 0.12.4 → 0.12.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. data/base/app/assets/stylesheets/base.css.scss +2 -1
  2. data/base/app/assets/stylesheets/footer.css.scss +1 -1
  3. data/base/app/assets/stylesheets/header.css.scss +3 -3
  4. data/base/app/assets/stylesheets/messages.css.scss +1 -0
  5. data/base/app/helpers/subjects_helper.rb +1 -1
  6. data/base/app/models/activity.rb +1 -4
  7. data/base/app/views/message_mailer/new_message_email.html.erb +1 -1
  8. data/base/app/views/message_mailer/new_message_email.text.erb +1 -1
  9. data/base/app/views/message_mailer/reply_message_email.html.erb +1 -1
  10. data/base/app/views/message_mailer/reply_message_email.text.erb +1 -1
  11. data/base/app/views/notification_mailer/new_notification_email.html.erb +5 -11
  12. data/base/app/views/notification_mailer/new_notification_email.text.erb +3 -2
  13. data/base/app/views/notifications/_notification.html.erb +2 -4
  14. data/base/app/views/notifications/activities/_follow.html.erb +10 -0
  15. data/base/app/views/notifications/activities/_follow.text.erb +8 -0
  16. data/base/app/views/notifications/activities/_like.html.erb +30 -0
  17. data/base/app/views/notifications/activities/_like.text.erb +23 -0
  18. data/base/app/views/notifications/activities/_make-friend.html.erb +10 -0
  19. data/base/app/views/notifications/activities/_make-friend.text.erb +7 -0
  20. data/base/app/views/notifications/activities/_post.html.erb +22 -0
  21. data/base/app/views/notifications/activities/_post.text.erb +17 -0
  22. data/base/app/views/notifications/activities/_update.html.erb +18 -0
  23. data/base/app/views/notifications/activities/_update.text.erb +15 -0
  24. data/base/app/views/notifications/index.js.erb +1 -1
  25. data/base/config/locales/en.yml +29 -13
  26. data/base/config/locales/es.yml +29 -13
  27. data/base/lib/mailboxer/notification_decoder.rb +11 -9
  28. data/base/lib/social_stream/base/version.rb +1 -1
  29. data/base/spec/factories/activity.rb +25 -0
  30. data/documents/app/assets/javascripts/documents.js.erb +12 -8
  31. data/documents/app/assets/stylesheets/show.css.scss +5 -2
  32. data/documents/app/views/common/_document_info.html.erb +34 -28
  33. data/documents/app/views/common/_edit_form.html.erb +2 -2
  34. data/documents/config/locales/en.yml +12 -3
  35. data/documents/config/locales/es.yml +11 -2
  36. data/documents/lib/social_stream/documents/version.rb +1 -1
  37. data/documents/social_stream-documents.gemspec +1 -1
  38. data/events/app/assets/javascripts/schedule.js +11 -11
  39. data/events/app/controllers/agendas_controller.rb +2 -2
  40. data/events/app/controllers/events_controller.rb +0 -4
  41. data/events/app/controllers/sessions_controller.rb +47 -34
  42. data/events/app/models/agenda.rb +5 -5
  43. data/events/app/models/event.rb +22 -13
  44. data/events/app/models/session.rb +1 -1
  45. data/events/app/views/agendas/_schedule.html.erb +2 -2
  46. data/events/app/views/agendas/_show.html.erb +1 -1
  47. data/events/app/views/events/_event.html.erb +4 -4
  48. data/events/app/views/events/_sessions_edit.html.erb +6 -6
  49. data/events/app/views/events/new.html.erb +1 -0
  50. data/events/app/views/sessions/_form.html.erb +4 -4
  51. data/events/app/views/sessions/_new.html.erb +2 -2
  52. data/events/app/views/sessions/_show.html.erb +2 -2
  53. data/events/config/locales/en.yml +17 -0
  54. data/events/config/locales/es.yml +17 -0
  55. data/events/db/migrate/20110910161707_create_social_stream_events.rb +4 -4
  56. data/events/db/migrate/20111102145626_add_more_fields_to_events.rb +1 -1
  57. data/events/db/migrate/20111104165944_add_more_fields_to_sessions.rb +13 -0
  58. data/events/db/migrate/20111104182420_add_details_to_events.rb +44 -0
  59. data/events/lib/social_stream/events/version.rb +1 -1
  60. data/events/social_stream-events.gemspec +1 -1
  61. data/events/vendor/assets/javascripts/jquery.ad-gallery.js +7 -7
  62. data/events/vendor/assets/javascripts/jquery.ad-gallery.pack.js +1 -1
  63. data/lib/social_stream/version.rb +1 -1
  64. data/presence/app/assets/images/emoticons/beer.png +0 -0
  65. data/presence/app/assets/images/emoticons/clock.png +0 -0
  66. data/presence/app/assets/images/emoticons/face-raspberry.png +0 -0
  67. data/presence/app/assets/images/emoticons/face-sad.png +0 -0
  68. data/presence/app/assets/images/emoticons/face-smile.png +0 -0
  69. data/presence/app/assets/images/emoticons/face-tired.png +0 -0
  70. data/presence/app/assets/images/emoticons/face-wink.png +0 -0
  71. data/presence/app/assets/images/emoticons/present.png +0 -0
  72. data/presence/app/assets/images/emoticons/rain.png +0 -0
  73. data/presence/app/assets/images/emoticons/sun.png +0 -0
  74. data/presence/app/assets/javascripts/xmpp_client.js.erb +417 -38
  75. data/presence/app/assets/stylesheets/chat.css +20 -0
  76. data/presence/app/helpers/xmpp_helper.rb +1 -1
  77. data/presence/app/views/xmpp/_chat.html.erb +2 -0
  78. data/presence/app/views/xmpp/_chat_off.html.erb +13 -5
  79. data/presence/lib/social_stream/presence/engine.rb +1 -1
  80. data/presence/lib/social_stream/presence/version.rb +1 -1
  81. data/social_stream.gemspec +3 -3
  82. metadata +36 -28
  83. data/base/app/assets/images/boxy/boxy-ne.png +0 -0
  84. data/base/app/assets/images/boxy/boxy-nw.png +0 -0
  85. data/base/app/assets/images/boxy/boxy-se.png +0 -0
  86. data/base/app/assets/images/boxy/boxy-sw.png +0 -0
  87. data/base/app/mailers/notification_mailer.rb +0 -34
  88. data/base/app/views/notifications/activities/_follow_body.html.erb +0 -2
  89. data/base/app/views/notifications/activities/_follow_subject.html.erb +0 -5
  90. data/base/app/views/notifications/activities/_like_body.html.erb +0 -5
  91. data/base/app/views/notifications/activities/_like_subject.html.erb +0 -9
  92. data/base/app/views/notifications/activities/_make-friend_body.html.erb +0 -2
  93. data/base/app/views/notifications/activities/_make-friend_subject.html.erb +0 -5
  94. data/base/app/views/notifications/activities/_post_body.html.erb +0 -6
  95. data/base/app/views/notifications/activities/_post_subject.html.erb +0 -6
  96. data/base/app/views/notifications/activities/_update_body.html.erb +0 -5
  97. data/base/app/views/notifications/activities/_update_subject.html.erb +0 -5
@@ -1,7 +1,32 @@
1
+ # Helpers for building the post activity
2
+ #
3
+ class ActivityObjectSpecHelper < ActiveRecord::Base
4
+ set_table_name "activity_objects"
5
+ end
6
+
7
+ class PostSpecHelper < ActiveRecord::Base
8
+ set_table_name "posts"
9
+
10
+ belongs_to :activity_object_spec_helper, :foreign_key => "activity_object_id"
11
+ end
12
+
13
+ Factory.define :activity_object_spec_helper do |a|
14
+ a.object_type "Post"
15
+ end
16
+
17
+ Factory.define :post_spec_helper do |p|
18
+ p.association :activity_object_spec_helper
19
+ p.text "Post spec helper"
20
+ end
21
+
22
+ #
23
+ ## End of helpers
24
+
1
25
  Factory.define :activity do |a|
2
26
  a.contact { Factory(:friend).contact }
3
27
  a.activity_verb { ActivityVerb["post"] }
4
28
  a.relation_ids { |b| Array(b.sender.relation_custom('friend').id) }
29
+ a.activity_object_ids { Array(Factory(:post_spec_helper).activity_object_spec_helper.id) }
5
30
  end
6
31
 
7
32
  Factory.define :self_activity, :parent => :activity do |a|
@@ -49,14 +49,18 @@ showAllDocumentComments = function(id){
49
49
  $("#"+id).children(".hide_show_comments").hide();
50
50
  };
51
51
 
52
- toggleDocumentEdit = function(){
53
- if($("#document_edit").css("display")=="none"){
54
- $("#document_edit").show("slow");
55
- $("#document_edit_action").addClass("selected");
56
-
57
- }else{
58
- $("#document_edit").hide("slow");
59
- $("#document_edit_action").removeClass("selected");
52
+
53
+ toggleDocumentMenu = function(name){
54
+ $(".document_menu").each(function(){
55
+ console.log($(this));
56
+ if($(this).css("display")!="none"){
57
+ $(this).slideToggle("slow");
58
+ $("#" + $(this).attr('id') + "_action").removeClass("selected");
59
+ }
60
+ });
61
+ if($("#document_" + name).css("display")=="none"){
62
+ $("#document_" + name).slideToggle("slow");
63
+ $("#document_" + name + "_action").addClass("selected");
60
64
  }
61
65
  }
62
66
 
@@ -35,6 +35,7 @@
35
35
  #document_info .right{
36
36
  float: right;
37
37
  margin-right: 30px;
38
+ text-align: right;
38
39
  }
39
40
  #document_info .left{
40
41
  float: left;
@@ -56,8 +57,10 @@
56
57
  width: 16px;
57
58
  height: 16px;
58
59
  }
59
-
60
- #document_edit {
60
+ #document_details {
61
+ padding: 10px 0px;
62
+ }
63
+ #document_edit, #document_details {
61
64
  margin: 5px 5px 0px 5px;
62
65
  border: thin solid $separation-color;
63
66
  background: $secondary-color;
@@ -1,37 +1,43 @@
1
1
  <div id="document_info">
2
- <div class="left">
3
- <div id="date_labels">
4
- <div class="details">
5
- <%= t('document.info.date.created_at') %>
6
- </div>
7
- <div class="details">
8
- <%= t('document.info.date.updated_at') %>
9
- </div>
10
- </div>
11
- <div id="dates">
12
- <div class="date">
13
- <%= I18n.localize document.created_at, :format => :long %>
14
- </div>
15
- <div class="date">
16
- <%= I18n.localize document.updated_at, :format => :long %>
17
- </div>
18
- </div>
19
- </div>
20
- <div class="right">
21
- <div id="like_count">
22
- <%= document.like_count %> <span class="details">likes</span>
23
- </div>
24
- </div>
25
- <br class="clearfloat" />
26
2
  <div id="actions">
3
+ <%= link_to content_tag(:span,image_tag("btn/btn_write.png") + t('document.actions.details'), :class => :action, :id => :document_details_action), "javascript:toggleDocumentMenu('details');" %>
27
4
  <%= link_to content_tag(:span,image_tag("btn/download.png") + t('document.actions.download'), :class => :action), download_document_path(document) %>
28
5
  <% if document.post_activity.edit_object_by?(current_subject) %>
29
- <%= link_to content_tag(:span,image_tag("btn/edit.png") + t('document.actions.edit'), :class => :action, :id => :document_edit_action), "javascript:toggleDocumentEdit();" %>
6
+ <%= link_to content_tag(:span,image_tag("btn/edit.png") + t('document.actions.edit'), :class => :action, :id => :document_edit_action), "javascript:toggleDocumentMenu('edit');" %>
30
7
  <% end %>
31
8
  <% if document.post_activity.delete_object_by?(current_subject) %>
32
- <%= link_to content_tag(:span,image_tag("btn/error.png") + t('document.actions.delete'), :class => :action), document.post_activity.direct_object , :confirm => t('confirm_delete',
33
- :scope => document.post_activity.direct_object.class.to_s.underscore), :method => :delete %>
9
+ <%= link_to content_tag(:span,image_tag("btn/error.png") + t('document.actions.delete'), :class => :action), document.post_activity.direct_object , :confirm => t('confirm_delete',
10
+ :scope => document.post_activity.direct_object.class.to_s.underscore), :method => :delete %>
34
11
  <% end %>
35
12
  </div>
13
+ <div id="document_details" class="document_menu" style="display:none;">
14
+ <div class="left">
15
+ <div id="date_labels">
16
+ <div class="details">
17
+ <%= t('document.info.date.created_at') %>
18
+ </div>
19
+ <div class="details">
20
+ <%= t('document.info.date.updated_at') %>
21
+ </div>
22
+ </div>
23
+ <div id="dates">
24
+ <div class="date">
25
+ <%= I18n.localize document.created_at, :format => :long %>
26
+ </div>
27
+ <div class="date">
28
+ <%= I18n.localize document.updated_at, :format => :long %>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <div class="right">
33
+ <div id="like_count">
34
+ <%= document.like_count %> <span class="details">likes</span>
35
+ </div>
36
+ <div id="file_size">
37
+ <span class="details">Size </span> <%= number_to_human_size document.file_file_size %>
38
+ </div>
39
+ </div>
40
+ <br class="clearfloat" />
41
+ </div>
36
42
  </div>
37
- <%= render :partial => "common/edit_form", :locals => {:document => document} %>
43
+ <%= render :partial => "common/edit_form", :locals => {:document => document} %>
@@ -1,4 +1,4 @@
1
- <div class="block" id="document_edit" style="display:none;">
1
+ <div class="block document_menu" id="document_edit" style="display:none;">
2
2
  <%= form_for(document, :html => { :method => :put }) do |f| %>
3
3
  <% if document and document.errors.any? %>
4
4
  <%= javascript_tag do %>
@@ -51,7 +51,7 @@
51
51
  <% if params[:editing].present? and params[:editing].eql?"true" and document.post_activity.edit_object_by?(current_subject) %>
52
52
  <%= javascript_tag do %>
53
53
  $(document).ready(function(){
54
- toggleDocumentEdit();
54
+ toggleDocumentMenu('edit');
55
55
  });
56
56
  <% end %>
57
57
  <% end %>
@@ -4,11 +4,14 @@ en:
4
4
  title: "Audios"
5
5
  mine: "My audios"
6
6
  msg: "Uploaded an audio:"
7
+ name: "audio"
7
8
  not_mine: "Audios"
9
+ one: "an audio"
8
10
  processing: "Processing audio clip"
9
11
  document:
10
12
  actions:
11
13
  delete: "Delete"
14
+ details: "Details"
12
15
  download: "Download"
13
16
  edit: "Edit"
14
17
  all: "All documents"
@@ -27,7 +30,9 @@ en:
27
30
  title: "Title"
28
31
  mine: "My documents"
29
32
  msg: "Uploaded a document:"
33
+ name: "file"
30
34
  not_mine: "Documents"
35
+ one: "a file"
31
36
  simple_all: "All"
32
37
  title: "Documents"
33
38
  picture:
@@ -35,9 +40,11 @@ en:
35
40
  title: "Pictures"
36
41
  mine: "My pictures"
37
42
  msg: "Uploaded a picture:"
43
+ name: "picture"
38
44
  not_mine: "Pictures"
45
+ one: "a picture"
39
46
  repository:
40
- title: "Repository"
47
+ title: "Files"
41
48
  order:
42
49
  by: "Order by"
43
50
  last_modified: "Last modified"
@@ -45,7 +52,7 @@ en:
45
52
  resource:
46
53
  all: "All Resources"
47
54
  confirm_delete: "Delete resource?"
48
- title: "Repository"
55
+ title: "Files"
49
56
  mine: "My resources"
50
57
  msg: "Uploaded a resource:"
51
58
  not_mine: "Resources"
@@ -53,6 +60,8 @@ en:
53
60
  confirm_delete: "Delete video?"
54
61
  title: "Videos"
55
62
  mine: "My videos"
56
- msg: "Uploaded a video:"
63
+ msg: "Uploaded a video:"
64
+ name: "video"
57
65
  not_mine: "Videos"
66
+ one: "a video"
58
67
  processing: "Processing video"
@@ -4,11 +4,14 @@ es:
4
4
  title: "Audios"
5
5
  mine: "Mis audios"
6
6
  msg: "Subió un audio:"
7
+ name: "archivo de audio"
7
8
  not_mine: "Audios"
9
+ one: "un archivo de audio"
8
10
  processing: "Procesando fichero de audio..."
9
11
  document:
10
12
  actions:
11
13
  delete: "Borrar"
14
+ details: "Detalles"
12
15
  download: "Descargar"
13
16
  edit: "Editar"
14
17
  all: "Todos los documentos"
@@ -27,7 +30,9 @@ es:
27
30
  title: "Título"
28
31
  mine: "Mis documentos"
29
32
  msg: "Subió un documento:"
33
+ name: "documento"
30
34
  not_mine: "Documentos"
35
+ one: "un documento"
31
36
  simple_all: "Todos"
32
37
  title: "Documentos"
33
38
  picture:
@@ -35,9 +40,11 @@ es:
35
40
  title: "Imágenes"
36
41
  mine: "Mis imágenes"
37
42
  msg: "Subió una imagen:"
43
+ name: "imagen"
38
44
  not_mine: "Imágenes"
45
+ one: "una imagen"
39
46
  repository:
40
- title: "Repositorio"
47
+ title: "Archivos"
41
48
  order:
42
49
  by: "Ordenar por"
43
50
  last_modified: "Última modificación"
@@ -45,7 +52,7 @@ es:
45
52
  resource:
46
53
  all: "Todos los recursos"
47
54
  confirm_delete: "¿Borrar recursos?"
48
- title: "Repositorio"
55
+ title: "Archivos"
49
56
  mine: "Mis recursos"
50
57
  msg: "Subió un recurso:"
51
58
  not_mine: "Recursos"
@@ -54,5 +61,7 @@ es:
54
61
  title: "Vídeos"
55
62
  mine: "Mis vídeos"
56
63
  msg: "Subió un vídeo:"
64
+ name: "vídeo"
57
65
  not_mine: "Vídeos"
66
+ one: "un vídeo"
58
67
  processing: "Procesando vídeo..."
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "0.4.3".freeze
3
+ VERSION = "0.4.4".freeze
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n")
13
13
 
14
14
  # Gem dependencies
15
- s.add_runtime_dependency('social_stream-base', '~> 0.9.27')
15
+ s.add_runtime_dependency('social_stream-base', '~> 0.9.28')
16
16
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.7.0')
17
17
  s.add_runtime_dependency('paperclip','2.3.11')
18
18
  s.add_runtime_dependency('delayed_paperclip','>= 0.7.2')
@@ -7,8 +7,8 @@ function createSessionEvent(title, start, end, event_id,receiver){
7
7
  data:
8
8
  'session[title]='+title+
9
9
  '&session[_contact_id]='+receiver+
10
- '&session[start_at]='+start.toString().substring(0, 24)+
11
- '&session[end_at]='+end.toString().substring(0, 24)+
10
+ '&session[initDate]='+start.toString().substring(0, 24)+
11
+ '&session[endDate]='+end.toString().substring(0, 24)+
12
12
  '&event_id='+event_id,
13
13
  dataType: 'script',
14
14
  type: 'POST',
@@ -81,9 +81,9 @@ function deleteSession(session_id, delete_all){
81
81
  function dateScheduleAvailable(start, end, allDay){
82
82
  return $('#calendar').fullCalendar('clientEvents', function(session)
83
83
  {
84
- if ((session.start_at < start && start < session.end_at) ||
85
- (session.start_at < end && end < session.end_at) ||
86
- (compareDate(session.start_at, start) && (session.allDay || allDay))
84
+ if ((session.initDate < start && start < session.endDate) ||
85
+ (session.initDate < end && end < session.endDate) ||
86
+ (compareDate(session.initDate, start) && (session.allDay || allDay))
87
87
  )
88
88
  {
89
89
  return true;
@@ -95,17 +95,17 @@ function dateScheduleAvailable(start, end, allDay){
95
95
  function dateAvailable(start, end, allDay){
96
96
  return $('#calendar').fullCalendar('clientEvents', function(session)
97
97
  {
98
- if (session.start_at < start && start < session.end_at)
98
+ if (session.initDate < start && start < session.endDate)
99
99
  return true;
100
- else if (session.start_at < end && end < session.end_at)
100
+ else if (session.initDate < end && end < session.endDate)
101
101
  return true;
102
- else if (session.start_at > start && (session.end_at && session.end_at < end))
102
+ else if (session.initDate > start && (session.endDate && session.endDate < end))
103
103
  return true;
104
- else if (compareDateWithMinutes(session.start_at, start))
104
+ else if (compareDateWithMinutes(session.initDate, start))
105
105
  return true;
106
- else if (session.end_at && compareDateWithMinutes(session.end_at, end))
106
+ else if (session.endDate && compareDateWithMinutes(session.endDate, end))
107
107
  return true;
108
- else if (compareDate(session.start_at, start) && (session.allDay || allDay))
108
+ else if (compareDate(session.initDate, start) && (session.allDay || allDay))
109
109
  return true;
110
110
  else
111
111
  return false;
@@ -25,8 +25,8 @@ class AgendasController < InheritedResources::Base
25
25
  sessions << {:id => session.id,
26
26
  :title => session.title,
27
27
  :description => session.description || "Some cool description here...",
28
- :start => "#{session.start_at.iso8601}",
29
- :end => "#{session.end_at.iso8601}",
28
+ :start => "#{session.initDate.iso8601}",
29
+ :end => "#{session.endDate.iso8601}",
30
30
  :allDay => false,
31
31
  :recurring => false,
32
32
  :editable => true
@@ -15,14 +15,11 @@ class EventsController < InheritedResources::Base
15
15
  self.current_subject = @event
16
16
  redirect_to [current_subject, :profile]
17
17
  }
18
-
19
18
  end
20
-
21
19
  end
22
20
 
23
21
  def edit
24
22
  @event = Event.find(params[:id])
25
-
26
23
  end
27
24
 
28
25
  def index
@@ -77,7 +74,6 @@ class EventsController < InheritedResources::Base
77
74
 
78
75
  def set_founder
79
76
  return unless user_signed_in?
80
-
81
77
  params[:event] ||= {}
82
78
  params[:event][:_founder] ||= current_subject.slug
83
79
  end
@@ -8,6 +8,7 @@ class SessionsController < InheritedResources::Base
8
8
 
9
9
  end
10
10
 
11
+
11
12
  def edit
12
13
  @event= Event.find_by_id(params[:id_event])
13
14
  @session= Session.find_by_id(params[:id])
@@ -21,16 +22,16 @@ class SessionsController < InheritedResources::Base
21
22
  @session.update_attributes(params[:session])
22
23
  # @session = Session.new (params[:session])
23
24
  # @session.save
24
- if @event.start_at.nil?
25
- @event.start_at = @session.start_at
26
- @event.end_at = @session.end_at
25
+ if @event.initDate.nil?
26
+ @event.initDate = @session.initDate
27
+ @event.endDate = @session.endDate
27
28
  @event.save
28
29
  else
29
- if @event.start_at > @session.start_at
30
- @event.start_at = @session.start_at
30
+ if @event.initDate > @session.initDate
31
+ @event.initDate = @session.initDate
31
32
  end
32
- if @event.end_at < @session.end_at
33
- @event.end_at = @session.end_at
33
+ if @event.endDate < @session.endDate
34
+ @event.endDate = @session.endDate
34
35
  end
35
36
  @event.save
36
37
  end
@@ -41,18 +42,30 @@ class SessionsController < InheritedResources::Base
41
42
  @event = Event.find_by_id(params[:event_id])
42
43
  params[:session][:agenda_id]=@event.agenda.id
43
44
  @session = Session.new (params[:session])
44
- @session.save
45
45
 
46
- if @event.start_at.nil?
47
- @event.start_at = @session.start_at
48
- @event.end_at = @session.end_at
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
49
62
  @event.save
50
63
  else
51
- if @event.start_at > @session.start_at
52
- @event.start_at = @session.start_at
64
+ if @event.initDate > @session.initDate
65
+ @event.initDate = @session.initDate
53
66
  end
54
- if @event.end_at < @session.end_at
55
- @event.end_at = @session.end_at
67
+ if @event.endDate < @session.endDate
68
+ @event.endDate = @session.endDate
56
69
  end
57
70
  @event.save
58
71
  end
@@ -70,21 +83,21 @@ class SessionsController < InheritedResources::Base
70
83
  def move
71
84
  @session = Session.find_by_id(params[:id])
72
85
  if @session
73
- @session.start_at = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.start_at))
74
- @session.end_at = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.end_at))
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))
75
88
  @session.save
76
89
  end
77
90
 
78
- if @event.start_at.nil?
79
- @event.start_at = @session.start_at
80
- @event.end_at = @session.end_at
91
+ if @event.initDate.nil?
92
+ @event.initDate = @session.initDate
93
+ @event.endDate = @session.endDate
81
94
  @event.save
82
95
  else
83
- if @event.start_at > @session.start_at
84
- @event.start_at = @session.start_at
96
+ if @event.initDate > @session.initDate
97
+ @event.initDate = @session.initDate
85
98
  end
86
- if @event.end_at < @session.end_at
87
- @event.end_at = @session.end_at
99
+ if @event.endDate < @session.endDate
100
+ @event.endDate = @session.endDate
88
101
  end
89
102
  @event.save
90
103
  end
@@ -95,7 +108,7 @@ class SessionsController < InheritedResources::Base
95
108
  def resize
96
109
  @session = Session.find(params[:id])
97
110
  if @session
98
- @session.end_at = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.end_at))
111
+ @session.endDate = (params[:minute_delta].to_i).minutes.from_now((params[:day_delta].to_i).days.from_now(@session.endDate))
99
112
  @session.save
100
113
  end
101
114
  end
@@ -104,18 +117,18 @@ class SessionsController < InheritedResources::Base
104
117
  def destroy
105
118
  @session = Session.find(params[:id])
106
119
  @event = @session.event
107
- start_at=@session.start_at
108
- end_at=@session.end_at
120
+ initDate=@session.initDate
121
+ endDate=@session.endDate
109
122
  @session.destroy
110
123
 
111
- if !@event.start_at.nil?
112
- if start_at < @event.start_at
113
- #changing the start_at of the event
114
- @event.start_at = @event.sessions.order("start_at ASC").map{|x| x.start_at}.first
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
115
128
  end
116
- if end_at > @event.end_at
117
- #changing the end_at of the event
118
- @event.end_at = @event.sessions.order("end_at DESC").map{|x| x.end_at}.first
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
119
132
  end
120
133
  @event.save
121
134
  end
@@ -19,22 +19,22 @@ class Agenda < ActiveRecord::Base
19
19
 
20
20
 
21
21
  def start_date
22
- event.start_at
22
+ event.initDate
23
23
  end
24
24
 
25
25
  def end_date
26
- event.end_at
26
+ event.endDate
27
27
  end
28
28
 
29
29
  def getSessions(id,time_start,time_end)
30
- @sessions = sessions.where( "start_at >= '#{time_start.to_formatted_s(:db)}' AND
31
- end_at <= '#{time_end.to_formatted_s(:db)}' ")
30
+ @sessions = sessions.where( "initDate >= '#{time_start.to_formatted_s(:db)}' AND
31
+ endDate <= '#{time_end.to_formatted_s(:db)}' ")
32
32
  end
33
33
 
34
34
  def contents_for_day(i)
35
35
 
36
36
  @sessions = sessions.where(
37
- "start_at >= :day_start AND start_at < :day_end", {:day_start => start_date.to_date + (i-1).day,
37
+ "initDate >= :day_start AND initDate < :day_end", {:day_start => start_date.to_date + (i-1).day,
38
38
  :day_end => start_date.to_date + i.day})
39
39
 
40
40
 
@@ -1,6 +1,6 @@
1
1
  class Event < ActiveRecord::Base
2
2
  include SocialStream::Models::Subject
3
- acts_as_conference_manager_event
3
+ #acts_as_conference_manager_event
4
4
 
5
5
  has_one :agenda, :dependent => :destroy
6
6
  has_many :sessions, :through => :agenda
@@ -15,9 +15,12 @@ class Event < ActiveRecord::Base
15
15
  after_create :create_agenda
16
16
 
17
17
  scope :live_events, lambda {
18
- where("events.start_at <= ? AND events.end_at > ?", Time.zone.now, Time.zone.now)
18
+ where("events.initDate <= ? AND events.endDate > ?", Time.zone.now, Time.zone.now)
19
19
  }
20
-
20
+
21
+ VC_MODE = [:in_person, :telemeeting, :teleconference, :teleclass]
22
+ RECORDING_TYPE = [:automatic, :manual, :none]
23
+
21
24
  #acts_as_conference_manager_event
22
25
  def profile!
23
26
  actor!.profile || actor!.build_profile
@@ -57,7 +60,7 @@ class Event < ActiveRecord::Base
57
60
 
58
61
  def days
59
62
  if has_date?
60
- (end_at.to_date - start_at.to_date).to_i + 1
63
+ (endDate.to_date - initDate.to_date).to_i + 1
61
64
  else
62
65
  return 0
63
66
  end
@@ -66,7 +69,7 @@ class Event < ActiveRecord::Base
66
69
  #method to know if this event is happening now
67
70
  def is_happening_now?
68
71
  #first we check if start date is past and end date is future
69
- if has_date? && start_at.past? && end_at.future?
72
+ if has_date? && initDate.past? && endDate.future?
70
73
  true
71
74
  else
72
75
  return false
@@ -84,7 +87,7 @@ class Event < ActiveRecord::Base
84
87
  if is_happening_now?
85
88
  #now we check the sessions
86
89
  agenda.agenda_entries.each do |session|
87
- return entry if entry.start_at.past? && entry.end_time.future?
90
+ return entry if entry.initDate.past? && entry.end_time.future?
88
91
  end
89
92
  end
90
93
  return nil
@@ -92,41 +95,47 @@ class Event < ActiveRecord::Base
92
95
 
93
96
  #method to know if an event happens in the future
94
97
  def future?
95
- return has_date? && start_at.future?
98
+ return has_date? && initDate.future?
96
99
  end
97
100
 
98
101
 
99
102
  #method to know if an event happens in the past
100
103
  def past?
101
- return has_date? && end_at.past?
104
+ return has_date? && endDate.past?
102
105
  end
103
106
 
104
107
 
105
108
  def has_date?
106
- start_at
109
+ initDate
110
+ end
111
+
112
+ def isabel_bw
113
+ 256
107
114
  end
108
115
 
109
116
  def get_formatted_date
110
117
  has_date? ?
111
- I18n::localize(start_at, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
118
+ I18n::localize(initDate, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
112
119
  I18n::t('date.undefined')
113
120
  end
114
121
 
115
122
  def get_formatted_day
116
123
  has_date? ?
117
- I18n::localize(start_at, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
124
+ I18n::localize(initDate, :format => "%A, %d %b %Y #{I18n::translate('date.at')} %H:%M. #{get_formatted_timezone}") :
118
125
  I18n::t('date.undefined')
119
126
  end
120
127
 
121
128
  def get_formatted_timezone
122
129
  has_date? ?
123
- "#{Time.zone.name} (#{start_at.zone}, GMT #{start_at.formatted_offset})" :
130
+ "#{Time.zone.name} (#{initDate.zone}, GMT #{initDate.formatted_offset})" :
124
131
  I18n::t('date.undefined')
125
132
  end
126
133
 
127
134
  #method to get the starting hour of an event in the correct format
128
135
  def get_formatted_hour
129
- has_date? ? start_at.strftime("%H:%M") : I18n::t('date.undefined')
136
+ has_date? ? initDate.strftime("%H:%M") : I18n::t('date.undefined')
130
137
  end
131
138
 
139
+
140
+
132
141
  end
@@ -9,7 +9,7 @@ class Session < ActiveRecord::Base
9
9
 
10
10
  acts_as_conference_manager_session
11
11
  def to_fullcalendar_json
12
- "{title: '#{name}', start: new Date(#{start_at.year},#{start_at.month-1},#{start_at.day},#{start_at.hour},#{start_at.min}),end: new Date(#{end_at.year},#{end_at.month-1},#{end_at.day},#{end_at.hour},#{end_at.min}),allDay: false}"
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
13
  end
14
14
 
15
15
  def sanitize_for_fullcalendar(string)