<?xml version="1.0"?>
<t t-name="event.event_report_template_badge_card">
    <t t-set="badge_image_url" t-value="image_data_uri(event.badge_image) if event.badge_image else ''"/>
    <div class="o_event_badge_ticket_wrapper" t-att-style="'background-image: url(%s);' % badge_image_url if badge_image_url else ''">
        <div class="position-relative h-100">
            <h3 class="fw-bold text-center" t-field="event.name"/>
            <div class="text-center o_event_badge_font_small">
                <t t-if="attendee">
                    <span itemprop="startDate" t-field="attendee.event_begin_date" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;date_only&quot;: True, &quot;tz_name&quot;: event.date_tz}" class="fw-bold"/>
                    <span itemprop="startDateTime" t-field="attendee.event_begin_date" class="fw-bold" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;time_only&quot;: True, &quot;tz_name&quot;: event.date_tz, &quot;hide_seconds&quot;: True}"/>
                    <span class="fa fa-arrow-right o_event_badge_font_faded"/>
                    <span itemprop="endDate" t-field="attendee.event_end_date" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;date_only&quot;: True, &quot;tz_name&quot;: event.date_tz}" class="fw-bold"/>
                    <span itemprop="endDateTime" t-field="attendee.event_end_date" class="fw-bold" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;time_only&quot;: True, &quot;tz_name&quot;: event.date_tz, &quot;hide_seconds&quot;: True}"/>
                </t>
                <t t-else="">
                    <span itemprop="startDate" t-field="event.date_begin" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;date_only&quot;: True, &quot;tz_name&quot;: event.date_tz}" class="fw-bold"/>
                    <span itemprop="startDateTime" t-field="event.date_begin" class="fw-bold" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;time_only&quot;: True, &quot;tz_name&quot;: event.date_tz, &quot;hide_seconds&quot;: True}"/>
                    <span class="fa fa-arrow-right o_event_badge_font_faded"/>
                    <span t-if="not event.is_one_day" itemprop="endDate" t-field="event.date_end" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;date_only&quot;: True, &quot;tz_name&quot;: event.date_tz}" class="fw-bold"/>
                    <span itemprop="endDateTime" t-field="event.date_end" class="fw-bold" t-options="{&quot;widget&quot;: &quot;datetime&quot;, &quot;time_only&quot;: True, &quot;tz_name&quot;: event.date_tz, &quot;hide_seconds&quot;: True}"/>
                </t>
            </div>
            <div t-if="event.address_id" class="o_event_badge_font_faded o_event_badge_font_small text-center">
                <t t-call="event.event_report_template_formatted_event_address">
                    <t t-set="use_map_marker" t-value="True"/>
                </t>
            </div>
            <div t-attf-class="text-center py-2 #{'o_event_badge_ticket_center_vertically position-absolute w-100' if not event.use_barcode or event.badge_format == 'A4_french_fold' else 'mt-2'}">
                <h2 class="mb-0" t-if="attendee" t-field="attendee.name"/>
                <h2 class="mb-0" t-elif="not attendee"><span>John Doe</span> <span t-if="attendee_number" t-out="attendee_number + 1"/></h2>
                <h4 t-if="attendee and attendee.company_name" class="o_event_badge_font_faded" t-field="attendee.company_name"/>
                <h4 t-elif="not attendee"><span class="o_event_badge_font_faded">My Placeholder Company</span></h4>
            </div>
            <div class="position-absolute bottom-0 w-100 text-center">
                <img t-if="event.organizer_id.image_256" class="o_event_badge_logo text-center mb-2" t-att-src="image_data_uri(event.organizer_id.image_256)"/>
                <span t-if="event.badge_format != 'A4_french_fold'" class="o_event_badge_barcode_container mb-2">
                    <img t-att-class="'mb-2' + (' ms-5' if event.organizer_id.image_256 else '')" t-attf-src="/report/barcode/QR/{{attendee.barcode if attendee else '12345678901234567890'}}?&amp;width=116&amp;height=116&amp;quiet=0" alt="QR Code"/>
                    <t t-if="event.use_barcode">
                        <t t-if="attendee">
                            <span t-field="attendee.barcode" class="barcode ms-2" t-options="{'widget': 'barcode', 'width': 200, 'height': 84, 'quiet': 0, 'humanreadable': 1}"/>
                        </t>
                        <t t-elif="not attendee">
                            <span t-out="'12345678901234567890'" class="barcode ms-2" t-options="{'widget': 'barcode', 'width': 200, 'height': 84, 'quiet': 0, 'humanreadable': 1}"/>
                        </t>
                    </t>
                </span>

                <t t-set="first_ticket" t-value="event.event_ticket_ids[0] if event.event_ticket_ids else None"/>
                <t t-set="ticket" t-value="attendee.event_ticket_id if attendee else first_ticket"/>
                <div t-if="ticket" class="text-center w-100" t-attf-style="background-color: {{ticket.color or '#875A7B'}};">
                    <div class="p-2 fs-5" t-out="ticket.name"/>
                </div>
            </div>
        </div>
    </div>
</t>

