Improve the content of the calendar event popover widget
This commit is contained in:
parent
b2015052d8
commit
e2c3137262
2 changed files with 29 additions and 15 deletions
|
@ -568,6 +568,16 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
displayEdit = vars('privileges').appointments.edit === true ? '' : 'd-none';
|
||||
displayDelete = vars('privileges').appointments.delete === true ? 'me-2' : 'd-none';
|
||||
|
||||
const customerInfo = [];
|
||||
|
||||
if (info.event.extendedProps.data.customer.first_name) {
|
||||
customerInfo.push(info.event.extendedProps.data.customer.first_name);
|
||||
}
|
||||
|
||||
if (info.event.extendedProps.data.customer.last_name) {
|
||||
customerInfo.push(info.event.extendedProps.data.customer.last_name);
|
||||
}
|
||||
|
||||
$html = $('<div/>', {
|
||||
'html': [
|
||||
$('<strong/>', {
|
||||
|
@ -644,11 +654,8 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderMapIcon(info.event.extendedProps.data.customer),
|
||||
$('<span/>', {
|
||||
'class': 'd-inline-block ms-1',
|
||||
'text':
|
||||
info.event.extendedProps.data.customer.first_name +
|
||||
' ' +
|
||||
info.event.extendedProps.data.customer.last_name
|
||||
'class': 'd-inline-block',
|
||||
'text': customerInfo.length ? customerInfo.join(' ') : '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -658,8 +665,8 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderMailIcon(info.event.extendedProps.data.customer.email),
|
||||
$('<span/>', {
|
||||
'class': 'd-inline-block ms-1',
|
||||
'text': info.event.extendedProps.data.customer.email
|
||||
'class': 'd-inline-block',
|
||||
'text': info.event.extendedProps.data.customer.email || '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -669,8 +676,8 @@ App.Utils.CalendarDefaultView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderPhoneIcon(info.event.extendedProps.data.customer.phone_number),
|
||||
$('<span/>', {
|
||||
'class': 'd-inline-block ms-1',
|
||||
'text': info.event.extendedProps.data.customer.phone_number
|
||||
'class': 'd-inline-block',
|
||||
'text': info.event.extendedProps.data.customer.phone_number || '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
|
|
@ -1348,6 +1348,16 @@ App.Utils.CalendarTableView = (function () {
|
|||
displayEdit = vars('privileges').appointments.edit === true ? '' : 'd-none';
|
||||
displayDelete = vars('privileges').appointments.delete === true ? '' : 'd-none';
|
||||
|
||||
const customerInfo = [];
|
||||
|
||||
if (info.event.extendedProps.data.customer.first_name) {
|
||||
customerInfo.push(info.event.extendedProps.data.customer.first_name);
|
||||
}
|
||||
|
||||
if (info.event.extendedProps.data.customer.last_name) {
|
||||
customerInfo.push(info.event.extendedProps.data.customer.last_name);
|
||||
}
|
||||
|
||||
$html = $('<div/>', {
|
||||
'html': [
|
||||
$('<strong/>', {
|
||||
|
@ -1424,10 +1434,7 @@ App.Utils.CalendarTableView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderMapIcon(info.event.extendedProps.data.customer),
|
||||
$('<span/>', {
|
||||
'text':
|
||||
info.event.extendedProps.data.customer.first_name +
|
||||
' ' +
|
||||
info.event.extendedProps.data.customer.last_name
|
||||
'text': customerInfo.length ? customerInfo.join(' ') : '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -1437,7 +1444,7 @@ App.Utils.CalendarTableView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderMailIcon(info.event.extendedProps.data.customer.email),
|
||||
$('<span/>', {
|
||||
'text': info.event.extendedProps.data.customer.email
|
||||
'text': info.event.extendedProps.data.customer.email || '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -1447,7 +1454,7 @@ App.Utils.CalendarTableView = (function () {
|
|||
}),
|
||||
App.Utils.CalendarEventPopover.renderPhoneIcon(info.event.extendedProps.data.customer.phone_number),
|
||||
$('<span/>', {
|
||||
'text': info.event.extendedProps.data.customer.phone_number
|
||||
'text': info.event.extendedProps.data.customer.phone_number || '-'
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
|
Loading…
Reference in a new issue