|
@@ -3,7 +3,7 @@
|
|
@section('content')
|
|
@section('content')
|
|
<div class="p-3">
|
|
<div class="p-3">
|
|
<div class="m-0 mt-4">
|
|
<div class="m-0 mt-4">
|
|
- <div class="row">
|
|
|
|
|
|
+ <div class="row mcp-theme-1" id="pro-dashboard-container" v-cloak>
|
|
<div class="col-md-3 mcp-theme-1">
|
|
<div class="col-md-3 mcp-theme-1">
|
|
<div class="mb-4">
|
|
<div class="mb-4">
|
|
<div class="pro-dashboard-inline-calendar"></div>
|
|
<div class="pro-dashboard-inline-calendar"></div>
|
|
@@ -73,60 +73,74 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-9">
|
|
<div class="col-md-9">
|
|
- <div id='calendar'></div>
|
|
|
|
|
|
+ <div class="d-flex align-items-center mb-2">
|
|
|
|
+ <b class="large">@{{ selectedDate }}</b>
|
|
|
|
+ <div class="ml-auto">Tabs</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-for="event in events" class="align-items-start p-3 border" :class="event.dateYMD === selectedDate ? 'd-flex' : 'd-none'">
|
|
|
|
+ <div class="patient-avatar mr-3">@{{ event.clientInitials }}</div>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="font-weight-bold pb-1">
|
|
|
|
+ @{{ event.clientName }}
|
|
|
|
+ <span class="small d-inline-block pl-2 text-secondary font-weight-normal">@{{ event.clientSummary }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="pb-1">
|
|
|
|
+ @{{ event.friendlyStartTime }} - @{{ event.friendlyEndTime }}
|
|
|
|
+ /
|
|
|
|
+ <span class="d-inline-block ml- 2 text-secondary font-weight-bold">@{{ event.title }}</span>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ Status: <b class="text-secondary">@{{ event.status }}</b>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- (function() {
|
|
|
|
- var events = [];
|
|
|
|
- function init() {
|
|
|
|
- events = JSON.parse('{!! json_encode($appointments) !!}')
|
|
|
|
-
|
|
|
|
- var calendarElem = $('.pro-dashboard-inline-calendar');
|
|
|
|
- calendarElem.datepicker();
|
|
|
|
- calendarElem.on('changeDate', function() {
|
|
|
|
- onDateChange(calendarElem.datepicker('getFormattedDate'));
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- selectToday();
|
|
|
|
- }
|
|
|
|
- function onDateChange(_newDate) {
|
|
|
|
- highlightDatesWithEvents();
|
|
|
|
- console.log('Showing events for ' + _newDate);
|
|
|
|
- }
|
|
|
|
- function selectToday() {
|
|
|
|
- $('.pro-dashboard-inline-calendar table td[data-date]').removeClass('active');
|
|
|
|
- $('.pro-dashboard-inline-calendar table td[data-date="{{ $milliseconds }}"]')
|
|
|
|
- .addClass('active');
|
|
|
|
- onDateChange('{{ $milliseconds }}');
|
|
|
|
- }
|
|
|
|
- function highlightDatesWithEvents() {
|
|
|
|
- $('.pro-dashboard-inline-calendar table td[data-date]').removeAttr('has-events');
|
|
|
|
- for (let i = 0; i < events.length; i++) {
|
|
|
|
- $('.pro-dashboard-inline-calendar table td[data-date="' + events[i].milliseconds + '"]')
|
|
|
|
- .attr('has-events', 1);
|
|
|
|
|
|
+ addMCInitializer('pro-dashboard', function () {
|
|
|
|
+ new Vue({
|
|
|
|
+ el: '#pro-dashboard-container',
|
|
|
|
+ delimiters: ['@{{', '}}'],
|
|
|
|
+ data: {
|
|
|
|
+ selectedDate: '{{ date('Y-m-d') }}',
|
|
|
|
+ selectedStatus: 'CREATED',
|
|
|
|
+ events: {!! json_encode($appointments) !!},
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ onDateChange: function (_newDate) {
|
|
|
|
+ this.highlightDatesWithEvents();
|
|
|
|
+ this.selectedDate = _newDate;
|
|
|
|
+ console.log('Showing events for ' + _newDate);
|
|
|
|
+ },
|
|
|
|
+ selectToday: function () {
|
|
|
|
+ $('.pro-dashboard-inline-calendar table td[data-date]').removeClass('active');
|
|
|
|
+ $('.pro-dashboard-inline-calendar table td[data-date="{{ $milliseconds }}"]')
|
|
|
|
+ .addClass('active');
|
|
|
|
+ this.onDateChange('{{ date('Y-m-d') }}');
|
|
|
|
+ },
|
|
|
|
+ highlightDatesWithEvents: function () {
|
|
|
|
+ $('.pro-dashboard-inline-calendar table td[data-date]').removeAttr('has-events');
|
|
|
|
+ for (let i = 0; i < this.events.length; i++) {
|
|
|
|
+ $('.pro-dashboard-inline-calendar table td[data-date="' + this.events[i].milliseconds + '"]')
|
|
|
|
+ .attr('has-events', 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted: function () {
|
|
|
|
+ var calendarElem = $('.pro-dashboard-inline-calendar'), self = this;
|
|
|
|
+ calendarElem.datepicker({
|
|
|
|
+ format: 'yyyy-mm-dd'
|
|
|
|
+ });
|
|
|
|
+ calendarElem.on('changeDate', function () {
|
|
|
|
+ self.onDateChange(calendarElem.datepicker('getFormattedDate'));
|
|
|
|
+ });
|
|
|
|
+ self.selectToday();
|
|
|
|
+ console.log(this.events)
|
|
}
|
|
}
|
|
- }
|
|
|
|
- addMCInitializer('pro-dashboard', init);
|
|
|
|
- })();
|
|
|
|
- // function initializeCalendar() {
|
|
|
|
- // if (!$("#calendar").length)
|
|
|
|
- // return;
|
|
|
|
- // var calendarEl = document.getElementById("calendar");
|
|
|
|
- // var calendar = new FullCalendar.Calendar(calendarEl, {
|
|
|
|
- // initialView: "dayGridMonth",
|
|
|
|
- // headerToolbar: {
|
|
|
|
- // left: "dayGridMonth,timeGridWeek,timeGridDay",
|
|
|
|
- // center: "title",
|
|
|
|
- // right: "prevYear,prev,next,nextYear"
|
|
|
|
- // },
|
|
|
|
- // events: events
|
|
|
|
- // });
|
|
|
|
- // calendar.render();
|
|
|
|
- // }
|
|
|
|
- // initializeCalendar();
|
|
|
|
|
|
+ });
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|
|
@endsection
|
|
@endsection
|