Debian Codegraph @

addons/website_event_sale/views/website_event_templates.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3
4 <template id="modal_ticket_registration" inherit_id="website_event.modal_ticket_registration">
5 <!-- Change pricelist -->
6 <xpath expr="//div[hasclass('o_wevent_price_range')]" position="after">
7 <div id="o_wevent_tickets_pricelist" class="collapse show">
8 <t t-call="website_sale.pricelist_list">
9 <t t-set="_classes" t-valuef="d-inline p-0 ms-2 my-1"/>
10 </t>
11 </div>
12 </xpath>
13 <!-- Add style display for price if the ticket is available -->
14 <xpath expr="//div[contains(@t-attf-class, 'o_wevent_registration_multi_select')]" position="attributes">
15 <attribute name="t-attf-class" separator=" " add="{{'' if not ticket.sale_available and not ticket.is_expired and ticket.is_launched else ('mt-1' if ticket.price_reduce == 0 else 'mt-2')}}"/>
16 </xpath>
17 <!-- Add price information on tickets (multi tickets, aka in collapse) -->
18 <xpath expr="//div[contains(@t-attf-class, 'o_wevent_registration_multi_select')]" position="inside">
19 <t t-if="ticket.price">
20 <t t-if="(ticket.price - ticket.price_reduce) &gt; 0">
21 <del t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
22 class="text-danger me-1"
23 t-field="ticket.price"
24 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
25 <del t-else=""
26 class="text-danger me-1"
27 t-field="ticket.price_incl"
28 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
29 </t>
30 <span t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
31 class="fs-6"
32 t-field="ticket.price_reduce"
33 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
34 <span t-else=""
35 t-field="ticket.price_reduce_taxinc"
36 class="fs-6"
37 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
38 <span itemprop="price" class="d-none" t-out="ticket.price"/>
39 <span itemprop="priceCurrency" class="d-none" t-out="website.currency_id.name"/>
40 </t>
41 <span t-else="" class="badge text-bg-success p-2 px-3">Free</span>
42 </xpath>
43 <xpath expr="//div[hasclass('o_wevent_price_range')]" position="inside">
44 <t t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'" t-set="all_prices" t-value="event.event_ticket_ids.mapped('price_reduce')"/>
45 <t t-else="" t-set="all_prices" t-value="event.event_ticket_ids.mapped('price_reduce_taxinc')"/>
46 <t t-set="lowest_price" t-value="min(all_prices)"/>
47 <t t-set="highest_price" t-value="max(all_prices)"/>
48 <t t-if="highest_price > 0">
49 <small class="text-muted">
50 From
51 <span t-out="lowest_price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
52 <t t-if="lowest_price != highest_price">
53 to
54 <span t-out="highest_price" t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
55 </t>
56 </small>
57 </t>
58 </xpath>
59 <!-- Add price information on tickets (mono ticket, aka not in collapse) -->
60 <xpath expr="//div[hasclass('o_wevent_registration_single_select')]" position="before">
61 <div class="flex-md-grow-1 mt-1 me-2 text-end">
62 <t t-if="tickets.price">
63 <t t-if="(tickets.price - tickets.price_reduce) &gt;0">
64 <del t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
65 class="text-danger me-1"
66 t-field="tickets.price"
67 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
68 <del t-else=""
69 class="text-danger me-1"
70 t-field="tickets.price_incl"
71 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
72 </t>
73 <span t-if="website.show_line_subtotals_tax_selection == 'tax_excluded'"
74 class="badge text-bg-secondary fs-6"
75 t-field="tickets.price_reduce"
76 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
77 <span t-else=""
78 class="badge text-bg-secondary fs-6"
79 t-field="tickets.price_reduce_taxinc"
80 t-options="{'widget': 'monetary', 'from_currency': event.company_id.sudo().currency_id, 'display_currency': website.currency_id}"/>
81 <span itemprop="price" class="d-none" t-out="tickets.price"/>
82 <span itemprop="priceCurrency" class="d-none" t-out="website.currency_id.name"/>
83 </t>
84 <span t-else="" class="badge text-bg-secondary fs-6 text-uppercase">Free</span>
85 </div>
86 </xpath>
87 </template>
88
89 <template id="registration_attendee_details" inherit_id="website_event.registration_attendee_details">
90 <!-- Change 'continue' button to use the website login settings -->
91 <xpath expr="//div[hasclass('modal-footer')]//button[hasclass('btn-primary')]" position="replace">
92 <t t-if="availability_check and limit_check">
93 <t t-set="has_paying_ticket" t-value="any(ticket.get('price', 0) > 0 for ticket in tickets)"/>
94 <button t-if="website.account_on_checkout == 'mandatory' and website.is_public_user() and has_paying_ticket" class="btn btn-primary" type="submit">
95 <span>Sign In</span>
96 <span class="fa fa-sign-in"/>
97 </button>
98 <button t-else="" type="submit" class="btn btn-primary">
99 <span t-if="has_paying_ticket">Go to Payment</span>
100 <span t-else="">Confirm Registration</span>
101 </button>
102 </t>
103 </xpath>
104 </template>
105
106 </odoo>