| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<templates xml:space="preserve"> |
| 3 |
|
| 4 |
<t t-name="web.CalendarCommonPopover"> |
| 5 |
<t t-if="env.isSmall"> |
| 6 |
<Dialog title="props.record.title" contentClass="'o_calendar_color_'+ props.record.colorIndex"> |
| 7 |
<t t-call="{{ constructor.subTemplates.body }}" /> |
| 8 |
<t t-set-slot="footer"> |
| 9 |
<t t-call="{{ constructor.subTemplates.footer }}" /> |
| 10 |
</t> |
| 11 |
</Dialog> |
| 12 |
</t> |
| 13 |
<t t-else=""> |
| 14 |
<t t-call="{{ constructor.subTemplates.popover }}" /> |
| 15 |
</t> |
| 16 |
</t> |
| 17 |
|
| 18 |
<t t-name="web.CalendarCommonPopover.popover"> |
| 19 |
<div class="card-header d-flex justify-content-between py-2 pe-2"> |
| 20 |
<span class="popover-header border-0 text-truncate"> |
| 21 |
<i t-if="props.record.titleIcon" t-attf-class="me-2 {{props.record.titleIcon}}"/> |
| 22 |
<span t-esc="props.record.title" t-att-data-tooltip="props.record.title"/> |
| 23 |
</span> |
| 24 |
<span class="o_cw_popover_close ms-4 mt-2 me-2" t-on-click.stop="() => props.close()"> |
| 25 |
<i class="fc-close fc-icon fc-icon-x" /> |
| 26 |
</span> |
| 27 |
</div> |
| 28 |
<div class="o_cw_body"> |
| 29 |
<t t-call="{{ constructor.subTemplates.body }}" /> |
| 30 |
<div t-if="hasFooter" class="card-footer d-flex gap-1 border-top"> |
| 31 |
<t t-call="{{ constructor.subTemplates.footer }}" /> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
</t> |
| 35 |
|
| 36 |
<t t-name="web.CalendarCommonPopover.body"> |
| 37 |
<ul class="list-group list-group-flush"> |
| 38 |
<li t-if="date" class="list-group-item"> |
| 39 |
<i class="fa fa-fw fa-calendar text-400" /> |
| 40 |
<span class="fw-bold ms-2" t-esc="date" /> <small t-if="dateDuration != 'All day'"><b t-esc="dateDuration" /></small> |
| 41 |
</li> |
| 42 |
<li t-if="time" class="list-group-item"> |
| 43 |
<i class="fa fa-fw fa-clock-o text-400" /> |
| 44 |
<span class="fw-bold ms-2" t-esc="time" /> <small t-if="timeDuration"><b t-esc="`(${timeDuration})`" /></small> |
| 45 |
</li> |
| 46 |
</ul> |
| 47 |
<ul class="list-group list-group-flush o_cw_popover_fields_secondary"> |
| 48 |
<Record resModel="props.model.resModel" resId="props.record.id" fields="props.model.fields" activeFields="activeFields" mode="'readonly'" values="props.record.rawRecord" t-slot-scope="slot"> |
| 49 |
<t t-foreach="Object.keys(props.model.popoverFieldNodes)" t-as="fieldId" t-key="fieldId"> |
| 50 |
<t t-set="fieldInfo" t-value="props.model.popoverFieldNodes[fieldId]"/> |
| 51 |
<t t-set="fieldType" t-value="props.model.fields[fieldId].type"/> |
| 52 |
<t t-if="!isInvisible(fieldInfo, slot.record)"> |
| 53 |
<li class="list-group-item d-flex text-nowrap" t-att-class="fieldInfo.attrs.class" t-att-data-tooltip="fieldType === 'html' ? '' : getFormattedValue(fieldId, slot.record)"> |
| 54 |
<span class="fw-bold me-2" t-if="!fieldInfo.options.noLabel and fieldInfo.type !== 'properties'"> |
| 55 |
<t t-if="fieldInfo.options.icon"> |
| 56 |
<i t-attf-class="fa-fw {{fieldInfo.options.icon}} text-400" /> |
| 57 |
</t> |
| 58 |
<t t-else=""> |
| 59 |
<t t-esc="fieldInfo.string" /> |
| 60 |
</t> |
| 61 |
</span> |
| 62 |
<div class="flex-grow-1 o_cw_popover_field overflow-hidden"> |
| 63 |
<Field name="fieldInfo.name" record="slot.record" class="fieldInfo.attrs.class" fieldInfo="fieldInfo" type="fieldInfo.widget" /> |
| 64 |
</div> |
| 65 |
</li> |
| 66 |
</t> |
| 67 |
</t> |
| 68 |
</Record> |
| 69 |
</ul> |
| 70 |
</t> |
| 71 |
|
| 72 |
<t t-name="web.CalendarCommonPopover.footer"> |
| 73 |
<t t-if="isEventEditable or isEventViewable"> |
| 74 |
<a href="#" class="btn btn-primary o_cw_popover_edit" t-on-click="onEditEvent"> |
| 75 |
<t t-if="isEventEditable">Edit</t> |
| 76 |
<t t-else="">View</t> |
| 77 |
</a> |
| 78 |
</t> |
| 79 |
<t t-if="isEventDeletable"> |
| 80 |
<a href="#" class="btn btn-secondary o_cw_popover_delete" t-on-click="onDeleteEvent"><i class="fa fa-trash"/></a> |
| 81 |
</t> |
| 82 |
</t> |
| 83 |
|
| 84 |
</templates> |