4113 |
efrain |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
$routeEvents = $this->url('calendar/events');
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
$this->headLink()->appendStylesheet($this->basePath('vendors/fullcalendar/fullcalendar.css'));
|
|
|
7 |
//$this->headLink()->appendStylesheet($this->basePath('vendors/fullcalendar-scheduler/dist/scheduler.css'));
|
|
|
8 |
//$this->headLink()->appendStylesheet($this->basePath('vendors/iCheck/skins/flat/green.css'));
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/lib/moment.min.js'));
|
|
|
12 |
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/fullcalendar.js'));
|
|
|
13 |
$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar/locale/es-us.js'));
|
|
|
14 |
//$this->inlineScript()->appendFile($this->basePath('vendors/fullcalendar-scheduler/dist/scheduler.js'));
|
|
|
15 |
//$this->inlineScript()->appendFile($this->basePath('vendors/iCheck/icheck.min.js'));
|
|
|
16 |
$this->inlineScript()->appendFile($this->basePath('vendors/popper/umd/popper.js'));
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
$defaultDate = date('Y-m-d');
|
|
|
20 |
|
|
|
21 |
$this->inlineScript()->captureStart();
|
|
|
22 |
echo <<<JS
|
|
|
23 |
jQuery( document ).ready(function( $ ) {
|
|
|
24 |
|
|
|
25 |
var data_resources = new Array();
|
|
|
26 |
var data_events = new Array();
|
|
|
27 |
|
|
|
28 |
$('#calendar').fullCalendar({
|
|
|
29 |
header: {
|
|
|
30 |
left: 'prev,next today',
|
|
|
31 |
center: 'title',
|
|
|
32 |
right: 'month,agendaWeek,agendaDay,listWeek'
|
|
|
33 |
},
|
|
|
34 |
defaultDate: '$defaultDate',
|
|
|
35 |
editable: true,
|
|
|
36 |
navLinks: true, // can click day/week names to navigate views
|
|
|
37 |
eventLimit: true, // allow "more" link when too many events
|
|
|
38 |
events: {
|
|
|
39 |
url: '$routeEvents',
|
|
|
40 |
error: function() {
|
|
|
41 |
$('#script-warning').show();
|
|
|
42 |
}
|
|
|
43 |
}
|
|
|
44 |
,eventRender: function(eventObj, \$el) {
|
|
|
45 |
$('.popover').remove();
|
|
|
46 |
\$el.popover({
|
4148 |
efrain |
47 |
title: eventObj.title,
|
4141 |
efrain |
48 |
content: eventObj.agenda,
|
4113 |
efrain |
49 |
trigger: 'hover',
|
|
|
50 |
placement: 'top',
|
|
|
51 |
container: 'body',
|
|
|
52 |
popperOptions : {
|
|
|
53 |
removeOnDestroy: true
|
|
|
54 |
},
|
|
|
55 |
options : {
|
|
|
56 |
removeOnDestroy: true
|
|
|
57 |
},
|
|
|
58 |
html: true
|
|
|
59 |
});
|
4141 |
efrain |
60 |
},
|
4113 |
efrain |
61 |
|
|
|
62 |
});
|
|
|
63 |
|
4131 |
efrain |
64 |
|
|
|
65 |
|
4113 |
efrain |
66 |
});
|
|
|
67 |
JS;
|
|
|
68 |
$this->inlineScript()->captureEnd();
|
4188 |
stevensc |
69 |
$this->inlineScript()->appendFile('/react-bundles/calendar/calendarBundle.js');
|
4113 |
efrain |
70 |
?>
|
|
|
71 |
<section class="info-page">
|
4188 |
stevensc |
72 |
<div class="container">
|
|
|
73 |
<div class="row">
|
|
|
74 |
<div id="calendar" class="col-12 col-md-8"></div>
|
|
|
75 |
<div id="calendar-events" class="col-12 col-md-4"></div>
|
|
|
76 |
</div>
|
|
|
77 |
</div>
|
4192 |
stevensc |
78 |
</section>
|
|
|
79 |
<script>
|
|
|
80 |
const isMobile = Boolean(window.innerWidth < 768)
|
|
|
81 |
const row = document.querySelector('.container .row')
|
|
|
82 |
|
|
|
83 |
if (isMobile) row.setAttribute('style', 'gap: 1rem;')
|
|
|
84 |
</script>
|