social_stream-events 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/GPL Affero license +663 -0
- data/Gemfile +9 -0
- data/README.rdoc +6 -0
- data/Rakefile +29 -0
- data/app/assets/images/btn/btn_certificate.png +0 -0
- data/app/assets/images/btn/btn_certificates.png +0 -0
- data/app/assets/images/btn/btn_edit.png +0 -0
- data/app/assets/images/btn/btn_embebed.png +0 -0
- data/app/assets/images/btn/btn_event.png +0 -0
- data/app/assets/images/btn/btn_outline.png +0 -0
- data/app/assets/images/btn/event.png +0 -0
- data/app/assets/images/btn/flyer.png +0 -0
- data/app/assets/images/btn/keynote.png +0 -0
- data/app/assets/images/btn/live.png +0 -0
- data/app/assets/images/btn/time.png +0 -0
- data/app/assets/images/btn/trash.png +0 -0
- data/app/assets/images/icons/IconsByGlyphish.txt +1 -0
- data/app/assets/images/icons/down.png +0 -0
- data/app/assets/images/icons/search.png +0 -0
- data/app/assets/images/icons/up.png +0 -0
- data/app/assets/images/logos/actor/event.png +0 -0
- data/app/assets/images/logos/contact/event.png +0 -0
- data/app/assets/images/logos/original/event.png +0 -0
- data/app/assets/images/logos/profile/event.png +0 -0
- data/app/assets/images/logos/representation/event.png +0 -0
- data/app/assets/images/tab_bottom.png +0 -0
- data/app/assets/javascripts/schedule.js +123 -0
- data/app/assets/javascripts/settings.js +20 -0
- data/app/assets/javascripts/social_stream-events.js +5 -0
- data/app/assets/stylesheets/activities.css +4 -0
- data/app/assets/stylesheets/fullcalendar.css +621 -0
- data/app/assets/stylesheets/fullcalendar.print.css +61 -0
- data/app/assets/stylesheets/settings.css +4 -0
- data/app/assets/stylesheets/social_stream-events.css +262 -0
- data/app/assets/stylesheets/tie.css +4 -0
- data/app/assets/stylesheets/users.css +4 -0
- data/app/controllers/activities_controller.rb +42 -0
- data/app/controllers/agendas_controller.rb +54 -0
- data/app/controllers/calendar_events_controller.rb +157 -0
- data/app/controllers/events_controller.rb +85 -0
- data/app/controllers/sessions_controller.rb +133 -0
- data/app/controllers/settings_controller.rb +70 -0
- data/app/helpers/event_helper.rb +12 -0
- data/app/models/agenda.rb +55 -0
- data/app/models/calendar_event.rb +191 -0
- data/app/models/calendar_event_series.rb +126 -0
- data/app/models/event.rb +131 -0
- data/app/models/session.rb +22 -0
- data/app/views/activities/_activity.html.erb +5 -0
- data/app/views/activities/_child.html.erb +18 -0
- data/app/views/activities/_comments.html.erb +3 -0
- data/app/views/activities/_index.html.erb +95 -0
- data/app/views/activities/_new.html.erb +29 -0
- data/app/views/activities/_options.html.erb +15 -0
- data/app/views/activities/_root.html.erb +37 -0
- data/app/views/activities/_wall.html.erb +5 -0
- data/app/views/activities/_walls.html.erb +34 -0
- data/app/views/activities/documents.js.erb +1 -0
- data/app/views/activities/index.js.erb +1 -0
- data/app/views/agendas/_agenda.html.erb +1 -0
- data/app/views/agendas/_edit.html.erb +136 -0
- data/app/views/agendas/_schedule.html.erb +19 -0
- data/app/views/agendas/_show.html.erb +81 -0
- data/app/views/agendas/_show_day.html.erb +6 -0
- data/app/views/agendas/edit.html.erb +24 -0
- data/app/views/agendas/event.html.erb +1 -0
- data/app/views/agendas/index.html.erb +0 -0
- data/app/views/agendas/show.html.erb +25 -0
- data/app/views/calendar_events/_calendar.html.erb +0 -0
- data/app/views/calendar_events/_edit_form.html.erb +58 -0
- data/app/views/calendar_events/_form.html.erb +65 -0
- data/app/views/calendar_events/available.html.erb +81 -0
- data/app/views/calendar_events/create.js.erb +18 -0
- data/app/views/calendar_events/edit.js.erb +1 -0
- data/app/views/calendar_events/index.html.erb +162 -0
- data/app/views/calendar_events/move.js.erb +0 -0
- data/app/views/calendar_events/new.js.erb +9 -0
- data/app/views/calendar_events/resize.js.erb +0 -0
- data/app/views/calendar_events/schedule.html.erb +143 -0
- data/app/views/documents/_mediawall.html.erb +111 -0
- data/app/views/events/_event.html.erb +10 -0
- data/app/views/events/_fields.html.erb +5 -0
- data/app/views/events/_form.html.erb +12 -0
- data/app/views/events/_jquery.html.erb +125 -0
- data/app/views/events/_manage.html.erb +35 -0
- data/app/views/events/_new.html.erb +2 -0
- data/app/views/events/_sessions_edit.html.erb +46 -0
- data/app/views/events/_sidebar_cloud.html.erb +27 -0
- data/app/views/events/_sidebar_index.html.erb +1 -0
- data/app/views/events/_sidebar_show.html.erb +5 -0
- data/app/views/events/agendas.html +1 -0
- data/app/views/events/edit.html.erb +12 -0
- data/app/views/events/index.html.erb +30 -0
- data/app/views/events/manage.html.erb +69 -0
- data/app/views/events/manage.js.erb +1 -0
- data/app/views/events/show.html.erb +34 -0
- data/app/views/kaminari/_first_page.html.erb +11 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +11 -0
- data/app/views/kaminari/_next_page.html.erb +11 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +23 -0
- data/app/views/kaminari/_prev_page.html.erb +11 -0
- data/app/views/profiles/_outline.html.erb +81 -0
- data/app/views/profiles/_profile.html.erb +40 -0
- data/app/views/sessions/_form.html.erb +41 -0
- data/app/views/sessions/_new.html.erb +63 -0
- data/app/views/sessions/_session.html.erb +1 -0
- data/app/views/sessions/_show.html.erb +27 -0
- data/app/views/sessions/create.html.erb +3 -0
- data/app/views/sessions/create.js.erb +1 -0
- data/app/views/sessions/destroy.js.erb +2 -0
- data/app/views/sessions/edit.html.erb +27 -0
- data/app/views/sessions/index.html.erb +1 -0
- data/app/views/sessions/index.js.erb +1 -0
- data/app/views/sessions/new.html.erb +27 -0
- data/app/views/settings/_contacto.html.erb +24 -0
- data/app/views/settings/_header.html.erb +8 -0
- data/app/views/settings/_index.html.erb +16 -0
- data/app/views/settings/_manage.html.erb +25 -0
- data/app/views/settings/_settings.html.erb +49 -0
- data/app/views/settings/delete_relation.js.erb +3 -0
- data/app/views/settings/index.html.erb +38 -0
- data/app/views/settings/manage.html.erb +31 -0
- data/app/views/settings/show.html.erb +15 -0
- data/app/views/settings/update_relation.js.erb +1 -0
- data/app/views/toolbar/_home.html.erb +11 -0
- data/app/views/toolbar/_logo.html.erb +23 -0
- data/app/views/toolbar/_organizer.html.erb +25 -0
- data/app/views/toolbar/_profile.html.erb +21 -0
- data/app/views/toolbar/_sponsor.html.erb +18 -0
- data/app/views/toolbar/_suscribed.html.erb +17 -0
- data/app/views/users/_index.html.erb +33 -0
- data/app/views/users/index.html.erb +46 -0
- data/config/locales/en.yml +97 -0
- data/config/routes.rb +46 -0
- data/db/20110615143707_create_social_stream_events.rb +54 -0
- data/lib/generators/social_stream/events/install_generator.rb +24 -0
- data/lib/social_stream-events.rb +15 -0
- data/lib/social_stream/events/engine.rb +8 -0
- data/lib/social_stream/migrations/events.rb +25 -0
- data/social_stream-events.gemspec +22 -0
- data/vendor/assets/javascripts/fullcalendar.js +5208 -0
- data/vendor/assets/javascripts/gcal.js +112 -0
- metadata +272 -0
@@ -0,0 +1,65 @@
|
|
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 %>
|
@@ -0,0 +1,81 @@
|
|
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: ' ◄ ', // left triangle
|
17
|
+
next: ' ► ', // right triangle
|
18
|
+
prevYear: ' << ', // <<
|
19
|
+
nextYear: ' >> ', // >>
|
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>
|
@@ -0,0 +1,18 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
page.replace_html 'event_desc', :partial => 'edit_form'
|
@@ -0,0 +1,162 @@
|
|
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: ' ◄ ', // left triangle
|
17
|
+
next: ' ► ', // right triangle
|
18
|
+
prevYear: ' << ', // <<
|
19
|
+
nextYear: ' >> ', // >>
|
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>
|
File without changes
|
File without changes
|
@@ -0,0 +1,143 @@
|
|
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
|
+
var room_id = <%=@room.id%>
|
8
|
+
$(document).ready(function(){
|
9
|
+
$('#calendar').fullCalendar({
|
10
|
+
monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio',
|
11
|
+
'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
|
12
|
+
monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun',
|
13
|
+
'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
|
14
|
+
dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
|
15
|
+
dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab'],
|
16
|
+
buttonText: {
|
17
|
+
prev: ' ◄ ', // left triangle
|
18
|
+
next: ' ► ', // right triangle
|
19
|
+
prevYear: ' << ', // <<
|
20
|
+
nextYear: ' >> ', // >>
|
21
|
+
today: 'Hoy',
|
22
|
+
month: 'Mes',
|
23
|
+
week: 'Semana',
|
24
|
+
day: 'Dia'
|
25
|
+
},
|
26
|
+
firstDay: 1,
|
27
|
+
allDayText: 'Todo el dia',
|
28
|
+
axisFormat: 'HH:mm G\'M\'\'T\' <%= escape_javascript(Time.zone.formatted_offset) %>',
|
29
|
+
ignoreTimezone: true,
|
30
|
+
allowCalEventOverlap: false,
|
31
|
+
selectable: true,
|
32
|
+
selectHelper: true,
|
33
|
+
select: function(start, end, allDay) {
|
34
|
+
var title = "No disponible";
|
35
|
+
|
36
|
+
if (dateScheduleAvailable(start, end, allDay)) {
|
37
|
+
/*
|
38
|
+
$('#calendar').fullCalendar('renderEvent', {
|
39
|
+
title: title,
|
40
|
+
start: start,
|
41
|
+
end: end,
|
42
|
+
editable: true,
|
43
|
+
allDay: allDay,
|
44
|
+
className: 'not-available'
|
45
|
+
}, false // make the event "stick"
|
46
|
+
);
|
47
|
+
*/
|
48
|
+
//createNotAvailableEvent(title, start, end, allDay, room_id);
|
49
|
+
jQuery.ajax({
|
50
|
+
data: 'start=' + start + '&end=' + end + '&room_id=' + room_id + '&allDay=' + allDay,
|
51
|
+
dataType: 'script',
|
52
|
+
type: 'get',
|
53
|
+
url: "/calendar_events/new"
|
54
|
+
});
|
55
|
+
}
|
56
|
+
$('#calendar').fullCalendar('unselect');
|
57
|
+
},
|
58
|
+
editable: true,
|
59
|
+
header: {
|
60
|
+
left: 'prev,next today',
|
61
|
+
center: 'title',
|
62
|
+
right: 'month,agendaWeek,agendaDay'
|
63
|
+
},
|
64
|
+
defaultView: 'agendaWeek',
|
65
|
+
height: 500,
|
66
|
+
columnFormat: {
|
67
|
+
month: 'ddd',
|
68
|
+
week: 'ddd d/M',
|
69
|
+
day: 'dddd d/M'
|
70
|
+
},
|
71
|
+
slotMinutes: 30,
|
72
|
+
loading: function(bool){
|
73
|
+
if (bool)
|
74
|
+
//$('#loading').show();
|
75
|
+
$('#loading').hide();
|
76
|
+
else
|
77
|
+
$('#loading').hide();
|
78
|
+
},
|
79
|
+
|
80
|
+
eventSources: [
|
81
|
+
'/calendar_events/get_schedule_events?room_id='+room_id,
|
82
|
+
'/calendar_events/get_room_reservations_events?room_id='+room_id
|
83
|
+
],
|
84
|
+
timeFormat: 'HH:mm t{ - HH:mm t} ',
|
85
|
+
dragOpacity: "0.5",
|
86
|
+
eventDrop: function(event, dayDelta, minuteDelta, allDay, revertFunc){
|
87
|
+
if (dateScheduleAvailable(event.start, event.end, allDay))
|
88
|
+
{
|
89
|
+
moveEvent(event, dayDelta, minuteDelta, allDay);
|
90
|
+
}
|
91
|
+
else
|
92
|
+
{
|
93
|
+
revertFunc();
|
94
|
+
}
|
95
|
+
},
|
96
|
+
|
97
|
+
eventResize: function(event, dayDelta, minuteDelta, revertFunc){
|
98
|
+
if (dateScheduleAvailable(event.start, event.end, false))
|
99
|
+
{
|
100
|
+
resizeEvent(event, dayDelta, minuteDelta);
|
101
|
+
}
|
102
|
+
else
|
103
|
+
{
|
104
|
+
revertFunc();
|
105
|
+
}
|
106
|
+
},
|
107
|
+
|
108
|
+
eventClick: function(event, jsEvent, view){
|
109
|
+
if (event.editable) {
|
110
|
+
showEventDetails(event);
|
111
|
+
} else {
|
112
|
+
showEventDescription(event);
|
113
|
+
}
|
114
|
+
}
|
115
|
+
// }
|
116
|
+
});
|
117
|
+
});
|
118
|
+
|
119
|
+
<% end %>
|
120
|
+
|
121
|
+
<p>
|
122
|
+
<%= link_to_remote 'Agregar horario NO disponible',
|
123
|
+
:url => {:action => :new, :params => {:room_id => @room.id}},
|
124
|
+
:before => "$('#loading').show()",
|
125
|
+
:complete => "$('#loading').hide()"
|
126
|
+
%>
|
127
|
+
</p>
|
128
|
+
|
129
|
+
<div><div id='calendar'></div></div>
|
130
|
+
|
131
|
+
<div id = "desc_dialog" style ="display:none;">
|
132
|
+
<div id = "event_desc"></div>
|
133
|
+
<br/>
|
134
|
+
<br/>
|
135
|
+
<div id = "event_actions">
|
136
|
+
<span id = "edit_event"></span>
|
137
|
+
<span id = "delete_event"></span>
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
<div id = "create_event_dialog" style ="display:none;">
|
141
|
+
<div id = "create_event">
|
142
|
+
</div>
|
143
|
+
</div>
|