| 1 |
<?php |
| 2 |
/** |
| 3 |
* Shared Booking Resource card-field layout template. |
| 4 |
* |
| 5 |
* Flat, parent, and child card wrappers compose this presentation-only partial |
| 6 |
* so changing the cards layout requires editing one identifiable template. |
| 7 |
* |
| 8 |
* @package Booking Calendar |
| 9 |
* @since 11.6.0 |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
?> |
| 16 |
<script type="text/html" id="tmpl-wpbc-booking-resource-card-fields"> |
| 17 |
<div class="wpbc_booking_resources__card_media"> |
| 18 |
<# if ( data.picture_url ) { #><img src="{{ data.picture_url }}" alt="" loading="lazy" decoding="async"><# } else { #><span class="wpbc_booking_resources__card_media_placeholder"><i class="menu_icon icon-1x wpbc-bi-image-fill" aria-hidden="true"></i></span><# } #> |
| 19 |
<div class="wpbc_booking_resources__card_selection"> |
| 20 |
<# if ( data.selection_enabled ) { #> |
| 21 |
<label class="wpbc_ui_listing__selection_control" for="wpbc_catalog_booking_resource_card_select_{{ data.id }}"> |
| 22 |
<span class="screen-reader-text">{{ data.selection_label }}</span> |
| 23 |
<input type="checkbox" id="wpbc_catalog_booking_resource_card_select_{{ data.id }}" value="{{ data.id }}" data-wpbc-ui-catalog-select-item> |
| 24 |
</label> |
| 25 |
<# } #> |
| 26 |
</div> |
| 27 |
</div> |
| 28 |
<header class="wpbc_booking_resources__card_header"> |
| 29 |
<div class="wpbc_booking_resources__resource_identity wpbc_booking_resources__resource_identity--{{ data.row_variant }}" data-wpbc-ui-catalog-field="resource"> |
| 30 |
<span class="wpbc_ui_listing__table_icon tooltip_top" data-original-title="{{ data.thumbnail_label }}" aria-label="{{ data.thumbnail_label }}" role="img" tabindex="0" title="{{ data.thumbnail_label }}"> |
| 31 |
<# if ( data.picture_url ) { #><img src="{{ data.picture_url }}" alt="" loading="lazy" decoding="async"><# } else { #><i class="menu_icon icon-1x wpbc-bi-image-fill" aria-hidden="true"></i><# } #> |
| 32 |
</span> |
| 33 |
<span class="wpbc_ui_listing__item_copy"> |
| 34 |
<strong class="wpbc_ui_listing__item_title" id="wpbc_booking_resource_title_{{ data.id }}" data-wpbc-ui-catalog-overflow-tooltip="{{ data.title }}">{{ data.title }}</strong> |
| 35 |
<span class="wpbc_booking_resources__card_type_badge">{{ data.type_badge_label }}</span> |
| 36 |
<# if ( data.description ) { #><small class="wpbc_ui_listing__item_description" data-wpbc-ui-catalog-overflow-tooltip="{{ data.description }}">{{ data.description }}</small><# } #> |
| 37 |
<# if ( 'child' === data.row_variant && data.parent_context_label ) { #><small class="wpbc_booking_resources__card_parent_context" data-wpbc-ui-catalog-overflow-tooltip="{{ data.parent_context_label }}">{{ data.parent_context_label }}</small><# } #> |
| 38 |
</span> |
| 39 |
</div> |
| 40 |
</header> |
| 41 |
<div class="wpbc_booking_resources__card_fields"> |
| 42 |
<# _.each( data.columns, function ( column ) { |
| 43 |
if ( 'labels' === column.id ) { #> |
| 44 |
<div class="wpbc_booking_resources__card_labels wpbc_booking_resources__card_field--labels" data-wpbc-ui-catalog-field="labels" data-wpbc-booking-resource-labels></div> |
| 45 |
<# return; } |
| 46 |
if ( -1 !== [ 'resource', 'actions', 'id' ].indexOf( column.id ) ) { return; } #> |
| 47 |
<dl class="wpbc_ui_listing__field wpbc_booking_resources__card_field {{ column.class_name }}" data-wpbc-ui-catalog-field="{{ column.id }}"> |
| 48 |
<dt><# if ( 'capacity' === column.id ) { #><span class="wpbc-bi-calendar2-check" aria-hidden="true"></span><# } else if ( 'price' === column.id ) { #><span class="wpbc-bi-cash-coin" aria-hidden="true"></span><# } #>{{ column.label }}</dt> |
| 49 |
<dd> |
| 50 |
<# if ( 'capacity' === column.id ) { #>{{ data.capacity }} |
| 51 |
<# } else if ( 'publishing' === column.id ) { #><code class="wpbc_booking_resources__shortcode" data-wpbc-ui-catalog-overflow-tooltip="{{ data.publishing_shortcode }}">{{ data.publishing_shortcode }}</code> |
| 52 |
<# } else if ( 'default_form' === column.id ) { #><span class="wpbc_booking_resources__clipped_text" data-wpbc-ui-catalog-overflow-tooltip="{{ data.default_form }}">{{ data.default_form }}</span> |
| 53 |
<# } else if ( 'structure' === column.id ) { #><span class="wpbc_booking_resources__clipped_text" data-wpbc-ui-catalog-overflow-tooltip="{{ data.structure_label }}">{{ data.structure_label }}</span> |
| 54 |
<# } else if ( 'priority' === column.id ) { #>{{ data.priority }} |
| 55 |
<# } else if ( 'price' === column.id ) { #><span data-wpbc-booking-resource-price></span> |
| 56 |
<# } else if ( 'owner' === column.id ) { #><span class="wpbc_booking_resources__clipped_text" data-wpbc-ui-catalog-overflow-tooltip="{{ data.owner_display_name }}">{{ data.owner_display_name }}</span> |
| 57 |
<# } #> |
| 58 |
</dd> |
| 59 |
</dl> |
| 60 |
<# } ); #> |
| 61 |
</div> |
| 62 |
<footer class="wpbc_booking_resources__card_footer"> |
| 63 |
<# _.each( data.columns, function ( column ) { if ( 'id' === column.id ) { #><span data-wpbc-ui-catalog-field="id">{{ column.label }} {{ data.id }}</span><# } } ); #> |
| 64 |
<span class="wpbc_booking_resources__card_footer_actions"> |
| 65 |
<# _.each( data.columns, function ( column ) { if ( 'actions' === column.id ) { #><span>{{ column.label }}</span><div data-wpbc-booking-resource-actions></div><# } } ); #> |
| 66 |
<button type="button" class="wpbc_booking_resources__details_toggle" data-wpbc-booking-resource-action="toggle_details" data-wpbc-booking-resource-id="{{ data.id }}" aria-expanded="false" aria-controls="wpbc_catalog_booking_resource_details_{{ data.id }}" data-show-label="{{ data.i18n.show_details }}" data-hide-label="{{ data.i18n.hide_details }}" aria-label="{{ data.i18n.show_details }}" title="{{ data.i18n.show_details }}"><span class="wpbc-bi-chevron-down" aria-hidden="true"></span></button> |
| 67 |
<# if ( data.hierarchy.expandable ) { #> |
| 68 |
<button type="button" class="wpbc_ui_listing__hierarchy_toggle wpbc_booking_resources__hierarchy_toggle" data-wpbc-ui-catalog-hierarchy-toggle="{{ data.hierarchy.node_id }}" data-wpbc-ui-catalog-hierarchy-parent-toggle data-collapse-label="{{ data.collapse_label }}" data-expand-label="{{ data.expand_label }}" aria-controls="wpbc_booking_resource_children_{{ data.id }}" aria-expanded="<# if ( data.is_expanded ) { #>true<# } else { #>false<# } #>" aria-label="<# if ( data.is_expanded ) { #>{{ data.collapse_label }}<# } else { #>{{ data.expand_label }}<# } #>" title="<# if ( data.is_expanded ) { #>{{ data.collapse_label }}<# } else { #>{{ data.expand_label }}<# } #>"><span class="<# if ( data.is_expanded ) { #>wpbc-bi-chevron-down<# } else { #>wpbc-bi-chevron-right<# } #>" data-wpbc-ui-catalog-hierarchy-toggle-icon aria-hidden="true"></span></button> |
| 69 |
<# } #> |
| 70 |
</span> |
| 71 |
</footer> |
| 72 |
</script> |
| 73 |
|