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.
Files changed (74) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +1 -0
  3. data/base/app/assets/javascripts/activities.js.erb +10 -2
  4. data/base/app/assets/stylesheets/activities.css +6 -4
  5. data/base/app/helpers/contacts_helper.rb +4 -2
  6. data/base/app/models/tie.rb +1 -1
  7. data/{events/app/views/activities/_index.html.erb → base/app/views/activities/_filter.html.erb} +1 -12
  8. data/base/app/views/activities/_options.html.erb +9 -6
  9. data/base/app/views/comments/_new.html.erb +16 -15
  10. data/base/app/views/profiles/_profile.html.erb +4 -0
  11. data/base/app/views/settings/_contacts.html.erb +16 -0
  12. data/base/app/views/settings/_index.html.erb +1 -0
  13. data/base/app/views/toolbar/_logo.html.erb +7 -0
  14. data/base/app/views/toolbar/_profile.html.erb +8 -1
  15. data/base/config/locales/en.yml +7 -23
  16. data/base/lib/social_stream/base/version.rb +1 -1
  17. data/base/lib/tasks/db/populate.rake +1 -1
  18. data/events/config/locales/en.yml +0 -9
  19. data/events/config/routes.rb +0 -16
  20. data/events/lib/social_stream/events/version.rb +1 -1
  21. data/events/social_stream-events.gemspec +1 -1
  22. data/lib/social_stream/version.rb +1 -1
  23. data/social_stream.gemspec +2 -1
  24. metadata +40 -73
  25. data/base/lib/tasks/resque.rake +0 -3
  26. data/events/app/assets/javascripts/settings.js +0 -20
  27. data/events/app/assets/stylesheets/activities.css +0 -4
  28. data/events/app/assets/stylesheets/settings.css +0 -4
  29. data/events/app/assets/stylesheets/tie.css +0 -4
  30. data/events/app/assets/stylesheets/users.css +0 -4
  31. data/events/app/controllers/activities_controller.rb +0 -42
  32. data/events/app/controllers/calendar_events_controller.rb +0 -157
  33. data/events/app/controllers/settings_controller.rb +0 -70
  34. data/events/app/views/activities/_activity.html.erb +0 -5
  35. data/events/app/views/activities/_child.html.erb +0 -18
  36. data/events/app/views/activities/_comments.html.erb +0 -3
  37. data/events/app/views/activities/_options.html.erb +0 -15
  38. data/events/app/views/activities/_root.html.erb +0 -37
  39. data/events/app/views/activities/_wall.html.erb +0 -5
  40. data/events/app/views/activities/_walls.html.erb +0 -34
  41. data/events/app/views/activities/documents.js.erb +0 -1
  42. data/events/app/views/activities/index.js.erb +0 -1
  43. data/events/app/views/calendar_events/_calendar.html.erb +0 -0
  44. data/events/app/views/calendar_events/_edit_form.html.erb +0 -58
  45. data/events/app/views/calendar_events/_form.html.erb +0 -65
  46. data/events/app/views/calendar_events/available.html.erb +0 -81
  47. data/events/app/views/calendar_events/create.js.erb +0 -18
  48. data/events/app/views/calendar_events/edit.js.erb +0 -1
  49. data/events/app/views/calendar_events/index.html.erb +0 -162
  50. data/events/app/views/calendar_events/move.js.erb +0 -0
  51. data/events/app/views/calendar_events/new.js.erb +0 -9
  52. data/events/app/views/calendar_events/resize.js.erb +0 -0
  53. data/events/app/views/calendar_events/schedule.html.erb +0 -143
  54. data/events/app/views/kaminari/_first_page.html.erb +0 -11
  55. data/events/app/views/kaminari/_gap.html.erb +0 -8
  56. data/events/app/views/kaminari/_last_page.html.erb +0 -11
  57. data/events/app/views/kaminari/_next_page.html.erb +0 -11
  58. data/events/app/views/kaminari/_page.html.erb +0 -12
  59. data/events/app/views/kaminari/_paginator.html.erb +0 -23
  60. data/events/app/views/kaminari/_prev_page.html.erb +0 -11
  61. data/events/app/views/profiles/_profile.html.erb +0 -40
  62. data/events/app/views/settings/_contacto.html.erb +0 -24
  63. data/events/app/views/settings/_header.html.erb +0 -8
  64. data/events/app/views/settings/_index.html.erb +0 -16
  65. data/events/app/views/settings/_manage.html.erb +0 -25
  66. data/events/app/views/settings/_settings.html.erb +0 -49
  67. data/events/app/views/settings/delete_relation.js.erb +0 -3
  68. data/events/app/views/settings/index.html.erb +0 -38
  69. data/events/app/views/settings/manage.html.erb +0 -31
  70. data/events/app/views/settings/show.html.erb +0 -15
  71. data/events/app/views/settings/update_relation.js.erb +0 -1
  72. data/events/app/views/toolbar/_home.html.erb +0 -11
  73. data/events/app/views/toolbar/_logo.html.erb +0 -23
  74. data/events/app/views/toolbar/_profile.html.erb +0 -21
@@ -1,70 +0,0 @@
1
- class SettingsController < InheritedResources::Base
2
-
3
- respond_to :html, :js
4
- #before_filter :authenticate_user!
5
- def show
6
-
7
- end
8
-
9
- def manage
10
-
11
- # @cs_ = Actor.joins('INNER JOIN contacts ON contacts.receiver_id = actors.id INNER JOIN ties ON ties.contact_id = contacts.id INNER JOIN relations ON relations.id = ties.relation_id').where(:subject_type => ['User', 'Group', 'Event'], :contacts=>{:sender_id => current_subject}, :relations=>{:type => 'Relation::Custom'}).page(params[:page]).per(10)
12
-
13
- @cs = current_subject.contact_subjects(:direction => :sent)
14
- @cs = Kaminari.paginate_array(@cs).page(params[:page]).per(10)
15
- # @cs_page = Paginator.new(self, cs.length, 10, 1)
16
- # @offset = 0
17
- # @cs= cs[offset..(offset + 10 -1)]
18
-
19
- end
20
-
21
- def delete_relation
22
- @receiver = Actor.find params[:id]
23
- logger.info "antes del each"
24
- contact=Contact.where(["sender_id="+current_subject.id.to_s+" and receiver_id="+@receiver.id.to_s])
25
- logger.info "cs:"+current_subject.name+"receiver:"+@receiver.name
26
- tie_to_delete=contact.first.ties
27
- logger.info "antes del if"
28
- tie_x=tie_to_delete.first
29
- if tie_x != nil
30
- tie_x.destroy
31
- end
32
- @cs = current_subject.contact_subjects(:direction => :sent)
33
- @cs = Kaminari.paginate_array(@cs).page(params[:page]).per(10)
34
- respond_to do |format|
35
- format.js {render :layout => false}
36
- end
37
- # redirect_to "/settings/manage"
38
- end
39
-
40
- def update_relation
41
- @receiver = Actor.find params[:id]
42
- relations = params['manage']
43
- logger.info "antes del each"
44
- relations.each do |x,y|
45
- relation_id = y
46
- contacto=Contact.where(["sender_id="+current_subject.id.to_s+" and receiver_id="+@receiver.id.to_s])
47
- logger.info "cs:"+current_subject.name+"receiver:"+@receiver.name
48
- tie_a_editar=contacto.first.ties
49
- logger.info "antes del if"
50
- tie_x=tie_a_editar.first
51
- if tie_x != nil
52
- logger.info "dentro del if"
53
- tie_x.relation_id=relation_id
54
- tie_x.save
55
- logger.info "luego del save"
56
- else
57
- logger.info "dentro del else"
58
- nuevo_tie=Tie.new
59
- nuevo_tie.contact_id=contacto.first.id
60
- nuevo_tie.relation_id=relation_id
61
- nuevo_tie.save
62
- end
63
- end
64
- respond_to do |format|
65
- format.js {render :layout => false}
66
- end
67
-
68
- # redirect_to "/settings/manage"
69
- end
70
- end
@@ -1,5 +0,0 @@
1
- <% if activity.is_root? %>
2
- <%= render :partial => "activities/root", :locals => { :activity => activity } %>
3
- <% else %>
4
- <%= render :partial => "activities/child", :locals => { :activity => activity } %>
5
- <% end %>
@@ -1,18 +0,0 @@
1
- <%= div_for activity, :class => "subactivity" do %>
2
- <div class="actor_logo_subactivity">
3
- <%= link_to image_tag(activity.sender_subject.logo.url(:actor),
4
- :alt => activity.sender_subject.name),
5
- activity.sender_subject %>
6
- </div>
7
- <div class="activity_content">
8
- <div class="actor_name-activity_objects">
9
- <%= link_to(activity.sender_subject.name, activity.sender_subject) %>
10
- <span class="subactivity_objects">
11
- <%= render activity.activity_objects %>
12
- </span>
13
- </div>
14
- <%= render :partial => 'activities/options',
15
- :locals => { :activity => activity } %>
16
- </div>
17
- <% end %>
18
- <div class="space_comments"></div>
@@ -1,3 +0,0 @@
1
- <div class="activity_comments" id="comments_<%= dom_id(activity) %>">
2
- <%= render activity.comments %>
3
- </div>
@@ -1,15 +0,0 @@
1
- <div class="activity_options">
2
- <ul class="activity_options" >
3
- <% if user_signed_in? %>
4
- <li><div class="security"><%= image_tag('btn/btn_security.png', :title => activity.audience_in_words(current_subject)) %></div></li>
5
- <% end %>
6
- <li><div class="post_time_ago"><%= t('time.ago', :time => time_ago_in_words(activity.created_at)) %></div></li>
7
- <% if activity.is_root? && user_signed_in? %>
8
- <li><div class="verb_comment"> · <%= link_to t('activity.to_comment'), "#", :class => "to_comment" %> </div></li>
9
- <% end %>
10
- <li><div class="verb_like" id="like_<%= dom_id(activity) %>"> · <%= link_like(activity)%></div></li>
11
- <% if activity.delete_object_by?(current_subject) %>
12
- <li><div class="verb_delete"> · <%= link_to t('activity.delete'), activity.direct_object , :confirm => t('confirm_delete', :scope => activity.direct_object.class.to_s.underscore), :method => :delete, :remote => true %> </div></li>
13
- <% end %>
14
- </ul>
15
- </div>
@@ -1,37 +0,0 @@
1
- <%= div_for activity, :class => 'super_activity' do %>
2
-
3
- <div class="actor_logo">
4
- <%= link_to image_tag(activity.sender_subject.logo.url(:actor),
5
- :alt => activity.sender_subject.name),
6
- activity.sender_subject %>
7
- </div>
8
-
9
- <div class="activity_content">
10
-
11
- <div class="actor_name">
12
- <%= activity.title(self)%>
13
- </div>
14
-
15
- <div class="activity_objects">
16
- <%= render activity.activity_objects %>
17
- </div>
18
-
19
- <%= render :partial => 'activities/options',
20
- :locals => { :activity => activity } %>
21
-
22
- <%= render :partial => 'activities/comments',
23
- :locals => { :activity => activity } %>
24
-
25
- <%= render :partial => 'comments/new',
26
- :locals => { :activity => activity } %>
27
-
28
- </div>
29
-
30
- <div class="space_activities">
31
- <% if activity.activity_objects.count > 1 %>
32
- <div class="space_sub"></div>
33
- <%else %>
34
- <div class="#"></div>
35
- <%end%>
36
- </div>
37
- <% end %>
@@ -1,5 +0,0 @@
1
- <div id="wall">
2
- <%= render activities %>
3
- <%= paginate activities %>
4
- </div>
5
-
@@ -1,34 +0,0 @@
1
- <% content_for :javascript do %>
2
- $("#tabs").tabs({
3
- ajaxOptions: {
4
- dataType: "script",
5
- success: function(data) { eval(data); }
6
- }
7
- });
8
- <% end %>
9
-
10
- <div id="tabs" class="block">
11
- <ul class="activity_tabs">
12
- <li><%= link_to "<span>#{ h truncate_name owner.name }</span>".html_safe, "#wall-profile" %></li>
13
-
14
- <% owner.relation_customs.sort.each do |r| %>
15
- <li><%= link_to "<span>#{ h r.name }</span>".html_safe,
16
- polymorphic_path([ owner, Activity.new ], :section => r.id, :wall => true),
17
- :title => "wall-#{ r.id }" %></li>
18
- <% end %>
19
- </ul>
20
-
21
- <div id="wall-profile">
22
- <%= render :partial => 'activities/index',
23
- :locals => { :owner => owner,
24
- :activities => owner.wall(:profile,
25
- :for => current_subject).
26
- page(params[:page]) } %>
27
- </div>
28
-
29
- <% owner.relation_customs.sort.each do |r| %>
30
- <div id="wall-<%= r.id %>"></div>
31
- <% end %>
32
- </div>
33
-
34
-
@@ -1 +0,0 @@
1
- $('#wall').html("<%= escape_javascript render(:partial => 'wall', :locals => { :owner => parent, :activities => @activities }) %>");
@@ -1 +0,0 @@
1
- $('#wall-<%= params[:section] || "profile" %>').html("<%= escape_javascript render(:partial => 'index', :locals => { :owner => parent, :activities => @activities }) %>");
File without changes
@@ -1,58 +0,0 @@
1
- <%remote_form_for @event, :url => {:action => :update} , :before => "$('#updating_events').show();", :complete => "$('#updating_events').hide();" do |f| %>
2
- <p>
3
- <%=f.label :title, "Titulo" %>
4
- <br/>
5
- <%=f.text_field :title %>
6
- </p>
7
- <p>
8
- <%=f.label :description, "Descripcion" %>
9
- <br/>
10
- <%=f.text_area :description, :rows => 4, :cols => 30 %>
11
- </p>
12
- <p>
13
- <%=f.label :starttime, 'Inicio' %>
14
- <br/>
15
- <%=f.datetime_select :starttime, :minute_step => 30 %>
16
- </p>
17
- <p>
18
- <%=f.label :endtime, 'Fin' %>
19
- <br/>
20
- <%=f.datetime_select :endtime, :minute_step => 30 %>
21
- </p>
22
- <p>
23
- <%=f.label :all_day, "Todo el día" %>
24
- <%=f.check_box :all_day %>
25
- </p>
26
- <% #if @event.calendar_event_series
27
- %>
28
- <%period = (@event.calendar_event_series)?@event.calendar_event_series.period : nil -%>
29
- <p>
30
- <%=f.label :period, "Repetir" %>
31
- <%=f.select :period, CalendarEvent::REPEATS,{:selected => period}, :onchange => "showPeriodAndFrequency(this.value);" %>
32
- </p>
33
- <%frequency = (@event.calendar_event_series)?@event.calendar_event_series.frequency : nil -%>
34
- <p id = "frequency" style = "display:<%(period)? '' : 'none'%>;">
35
- <%=f.label :frequency, "Repetir cada" %>
36
- <%=f.select :frequency, (1..30).to_a, {:selected => frequency} %> <span id = "period"></span>
37
- </p>
38
- <p>
39
- <%=f.label :starttime, 'Repetir hasta' %>
40
- <br/>
41
- <%= select_date Date.current, :prefix => :repeat_until, :order => [:year, :month, :day] %>
42
- </p>
43
- <% #end
44
- %>
45
- <%=f.hidden_field :id, :value => @event.id%>
46
- <%=f.hidden_field :commit_button, :value => ""%>
47
- <p>
48
- <%if @event.calendar_event_series -%>
49
- <%=f.submit 'Actualizar solo esta instancia', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%>
50
- <%=f.submit 'Actualizar todas las instancias', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%>
51
- <%=f.submit 'Actualizar todas las instancias siguientes', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%>
52
- <%else-%>
53
- <%=f.submit 'Guardar', :onclick => "document.getElementById('calendar_event_commit_button').value = this.value"%>
54
- <%end-%>
55
-
56
- <span id = "updating_events" style = "display:none;">Updating, Please wait...</span>
57
- </p>
58
- <%end %>
@@ -1,65 +0,0 @@
1
- <% #remote_form_for @event, :url => {:action => :create}, :before => "$('#creating_events').show();", :complete => "$('#creating_events').hide();" do |f|
2
- %>
3
- <% remote_form_for @event, :url => {:action => :create}, :complete => "$('#create_event_dialog').dialog('destroy');" do |f| %>
4
-
5
- <!--
6
- <p>
7
- <%=f.label :title %>
8
- <br/>
9
- <%=f.text_field :title %>
10
- </p>
11
- -->
12
- <%=f.hidden_field :title, :value => "No disponible" %>
13
- <!--
14
- <p>
15
- <%=f.label :description %>
16
- <br/>
17
- <%=f.text_area :description, :rows => 4, :cols => 30 %>
18
- </p>
19
- -->
20
- <%=f.hidden_field :description, :value => "No disponible" %>
21
- <p>
22
- <%=f.label :starttime, 'Inicio' %>
23
- <br/>
24
- <%=f.datetime_select :starttime, :minute_step => 30 %>
25
- </p>
26
- <p>
27
- <%=f.label :endtime, 'Fin' %>
28
- <br/>
29
- <%=f.datetime_select :endtime, :minute_step => 30 %>
30
- </p>
31
- <p>
32
- <%=f.label :all_day, "Todo el día" %>
33
- <%=f.check_box :all_day %>
34
- </p>
35
- <p>
36
- <%=f.label :period, "Repetir" %>
37
- <%=f.select :period, CalendarEvent::REPEATS,{}, :onchange => "showPeriodAndFrequency(this.value);" %>
38
- </p>
39
- <div id = "frequency" style = "display:none;">
40
- <p>
41
- <%=f.label :frequency, "Repetir cada" %>
42
- <%=f.select :frequency, (1..30).to_a %> <span id = "period"></span>
43
- </p>
44
- <p>
45
- <%=f.label :starttime, 'Repetir hasta' %>
46
- <%=check_box_tag :repeat, 1, false, :onchange => "showRepeatUntil(this.checked);" %>
47
- <span id="repeat_until" style = "display:none;">
48
- <%= select_date nil, {:prefix => :repeat_until, :include_blank => true}, :order => [:year, :month, :day] %>
49
- </span>
50
- </p>
51
- </div>
52
- <!--
53
- <p>
54
- <%=f.label :starttime, 'Repetir hasta' %>
55
- <br/>
56
- <%= select_date Date.current, :prefix => :repeat_until, :order => [:year, :month, :day] %>
57
- </p>
58
- -->
59
-
60
- <%=f.hidden_field :object_id, :value => @room.id %>
61
- <%=f.hidden_field :object_type, :value => 'Room' %>
62
- <p>
63
- <%=f.submit 'Agregar' %> <span id = "creating_events" style = "display:none;">Agregando, espere por favor...</span>
64
- </p>
65
- <%end %>
@@ -1,81 +0,0 @@
1
- <% content_for :headers do -%>
2
- <%= javascript_include_tag :defaults, 'jquery', 'jquery-ui', 'fullcalendar' %>
3
- <%= stylesheet_link_tag 'jquery-ui', 'fullcalendar' %>
4
- <% end -%>
5
-
6
- <% content_for :javascript do %>
7
- $(document).ready(function(){
8
- $('#calendar').fullCalendar({
9
- monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
10
- 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
11
- monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
12
- 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
13
- dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
14
- dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
15
- buttonText: {
16
- prev: '&nbsp;&#9668;&nbsp;', // left triangle
17
- next: '&nbsp;&#9658;&nbsp;', // right triangle
18
- prevYear: '&nbsp;&lt;&lt;&nbsp;', // <<
19
- nextYear: '&nbsp;&gt;&gt;&nbsp;', // >>
20
- today: 'Hoy',
21
- month: 'Mes',
22
- week: 'Semana',
23
- day: 'Dia'
24
- },
25
- firstDay: 1,
26
- allDayText: 'Todo el dia',
27
- axisFormat: 'HH:mm G\'M\'\'T\' <%= escape_javascript(Time.zone.formatted_offset) %>',
28
- ignoreTimezone: true,
29
- allowCalEventOverlap: false,
30
- header: {
31
- left: 'prev,next today',
32
- center: 'title',
33
- right: 'month,agendaWeek,agendaDay'
34
- },
35
- defaultView: 'agendaWeek',
36
- height: 500,
37
- columnFormat: {
38
- month: 'ddd',
39
- week: 'ddd d/M',
40
- day: 'dddd d/M'
41
- },
42
- slotMinutes: 30,
43
- loading: function(bool){
44
- if (bool)
45
- //$('#loading').show();
46
- $('#loading').hide();
47
- else
48
- $('#loading').hide();
49
- },
50
-
51
- //events: "/calendar_events/get_events",
52
- events: "/calendar_events/get_room_events?room_id=<%=@room.id%>&calendar_events=<%=params[:calendar_events]%>",
53
- timeFormat: 'HH:mm t{ - HH:mm t} ',
54
- dragOpacity: "0.5",
55
- eventClick: function(event, jsEvent, view){
56
- if (event.editable) {
57
- showEventDetails(event);
58
- } else {
59
- showEventDescription(event);
60
- }
61
- }
62
- });
63
- });
64
-
65
- <% end %>
66
-
67
- <div><div id='calendar'></div></div>
68
-
69
- <div id = "desc_dialog" style ="display:none;">
70
- <div id = "event_desc"></div>
71
- <br/>
72
- <br/>
73
- <div id = "event_actions">
74
- <span id = "edit_event"></span>
75
- <span id = "delete_event"></span>
76
- </div>
77
- </div>
78
- <div id = "create_event_dialog" style ="display:none;">
79
- <div id = "create_event">
80
- </div>
81
- </div>
@@ -1,18 +0,0 @@
1
- if @event
2
- if @event.save
3
- page<<"if (parent.$('#reservation_calendar_events')) { parent.$('#reservation_calendar_events').val(parent.$('#reservation_calendar_events').val() + ' ' + #{@event.id}) };"
4
- page<<"$('#calendar').fullCalendar( 'refetchEvents' )"
5
- #page<<"$('#create_event_dialog').dialog('destroy')"
6
- else
7
- page.alert @event.errors.full_messages(',').join("\n")
8
- end
9
- end
10
-
11
- if @event_series
12
- if @event_series.save
13
- page<<"$('#calendar').fullCalendar( 'refetchEvents' )"
14
- #page<<"$('#create_event_dialog').dialog('destroy')"
15
- else
16
- page.alert @event_series.errors.full_messages(',').join("\n")
17
- end
18
- end
@@ -1 +0,0 @@
1
- page.replace_html 'event_desc', :partial => 'edit_form'
@@ -1,162 +0,0 @@
1
- <% content_for :headers do -%>
2
- <%= javascript_include_tag :defaults, 'jquery', 'jquery-ui', 'fullcalendar' %>
3
- <%= stylesheet_link_tag 'jquery-ui', 'fullcalendar' %>
4
- <% end -%>
5
-
6
- <% content_for :javascript do %>
7
- $(document).ready(function(){
8
- $('#calendar').fullCalendar({
9
- monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
10
- 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
11
- monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
12
- 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
13
- dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
14
- dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
15
- buttonText: {
16
- prev: '&nbsp;&#9668;&nbsp;', // left triangle
17
- next: '&nbsp;&#9658;&nbsp;', // right triangle
18
- prevYear: '&nbsp;&lt;&lt;&nbsp;', // <<
19
- nextYear: '&nbsp;&gt;&gt;&nbsp;', // >>
20
- today: 'Hoy',
21
- month: 'Mes',
22
- week: 'Semana',
23
- day: 'Dia'
24
- },
25
- firstDay: 1,
26
- allDayText: 'Todo el dia',
27
- axisFormat: 'HH:mm G\'M\'\'T\' <%= escape_javascript(Time.zone.formatted_offset) %>',
28
- ignoreTimezone: true,
29
- allowCalEventOverlap: false,
30
- selectable: true,
31
- selectHelper: true,
32
- select: function(start, end, allDay) {
33
- var title = "<%= escape_javascript(params[:reservation][:title])%>";
34
-
35
- if (dateAvailable(start, end, allDay)) {
36
- $('#calendar').fullCalendar('renderEvent', {
37
- title: title,
38
- start: start,
39
- end: end,
40
- editable: true,
41
- allDay: allDay
42
- }, false
43
- );
44
- createReservationEvent(title, start, end, allDay);
45
- }
46
- $('#calendar').fullCalendar('unselect');
47
- },
48
- editable: true,
49
- header: {
50
- left: 'prev,next today',
51
- center: 'title',
52
- right: 'month,agendaWeek,agendaDay'
53
- },
54
- defaultView: 'agendaWeek',
55
- height: 500,
56
- columnFormat: {
57
- month: 'ddd',
58
- week: 'ddd d/M',
59
- day: 'dddd d/M'
60
- },
61
- slotMinutes: 30,
62
- loading: function(bool){
63
- if (bool)
64
- //$('#loading').show();
65
- $('#loading').hide();
66
- else
67
- $('#loading').hide();
68
- },
69
-
70
- //events: "/calendar_events/get_events",
71
- eventSources: [
72
- "/calendar_events/get_room_events?room_id=<%=@room.id%>",
73
- <% if @rooms %>
74
- "/calendar_events/get_others_events?room_ids="+$('#room_ids').val(),
75
- <% end %>
76
- function(start, end, callback) {
77
- $.ajax({
78
- url: '/calendar_events/get_calendar_events',
79
- dataType: 'json',
80
- data: {
81
- start: Math.round(start.getTime() / 1000),
82
- end: Math.round(end.getTime() / 1000),
83
- calendar_events: parent.$('#reservation_calendar_events').val()
84
- },
85
- success: function(events) {
86
- callback(events);
87
- }
88
- });
89
- }
90
- ],
91
- timeFormat: 'HH:mm t{ - HH:mm t} ',
92
- dragOpacity: "0.5",
93
- eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc){
94
- if (dateAvailable(event.start, event.end, allDay))
95
- {
96
- moveEvent(event, dayDelta, minuteDelta, allDay);
97
- }
98
- else
99
- {
100
- revertFunc();
101
- }
102
- },
103
-
104
- eventResize: function(event, dayDelta, minuteDelta, revertFunc){
105
- if (dateAvailable(event.start, event.end, false))
106
- {
107
- resizeEvent(event, dayDelta, minuteDelta);
108
- }
109
- else
110
- {
111
- revertFunc();
112
- }
113
- },
114
-
115
- eventClick: function(event, jsEvent, view){
116
- if (event.editable) {
117
- showEventDetails(event);
118
- } else {
119
- showEventDescription(event);
120
- }
121
- }
122
- });
123
- });
124
-
125
- <% end %>
126
-
127
- <p>
128
- <% link_to_remote 'Create Event',
129
- :url => {:action => :new},
130
- :before => "$('#loading').show()",
131
- :complete => "$('#loading').hide()"
132
- %>
133
-
134
- <%= select_tag :room_ids,
135
- "<option>Seleccione otras salas</option>" +
136
- options_for_select(Room.find(:all, :order => "country, space_id, name").select {|y| y.id != @room.id && !y.space.nil? }.collect {|x| ["#{x.country}, #{x.space.name}, #{x.name}", x.id]}, @rooms ? @rooms.collect {|z| z.id } : ""),
137
- :multiple =>true, :size => 3, :style => "font-size: 10px;", :onchange => "parent.$('#fancy_frame').attr('src', '/calendar_events?reservation[room_id]=#{@room.id}&reservation[title]=#{params[:reservation][:title]}&calendar_events=#{params[:calendar_events]}&room_ids='+$('#room_ids').val());"
138
- %>
139
- <br />
140
- <% if @rooms %>
141
- Aula seleccionada(s):
142
- <% @rooms.each do |room| %>
143
- <span style="font-size: 10px;"><%= "#{room.country}, #{room.space.name}, #{room.name}" %></span>
144
- <% end %>
145
- <% end %>
146
- </p>
147
-
148
- <div><div id='calendar'></div></div>
149
-
150
- <div id = "desc_dialog" style ="display:none;">
151
- <div id = "event_desc"></div>
152
- <br/>
153
- <br/>
154
- <div id = "event_actions">
155
- <span id = "edit_event"></span>
156
- <span id = "delete_event"></span>
157
- </div>
158
- </div>
159
- <div id = "create_event_dialog" style ="display:none;">
160
- <div id = "create_event">
161
- </div>
162
- </div>