198 lines
12 KiB
XML
198 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- TNCSC Events Kanban View Upgrade -->
|
|
<record id="view_event_kanban_tncsc" model="ir.ui.view">
|
|
<field name="name">event.event.kanban.tncsc</field>
|
|
<field name="model">event.event</field>
|
|
<field name="inherit_id" ref="event.view_event_kanban"/>
|
|
<field name="priority">60</field>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//kanban" position="attributes">
|
|
<attribute name="class" add="o_tncsc_event_kanban" separator=" "/>
|
|
<attribute name="default_group_by">stage_id</attribute>
|
|
</xpath>
|
|
|
|
<!-- Add subtitle, image, and status fields for card rendering -->
|
|
<xpath expr="//field[@name='date_end']" position="after">
|
|
<field name="subtitle"/>
|
|
<field name="image_512"/>
|
|
<field name="image_128"/>
|
|
<field name="registration_status"/>
|
|
<field name="is_registration_open"/>
|
|
<field name="seats_taken"/>
|
|
<field name="is_done"/>
|
|
</xpath>
|
|
|
|
<!-- Remove default aside date bar -->
|
|
<xpath expr="//aside" position="replace"/>
|
|
|
|
<!-- Replace standard main content with Upgraded Luxury Event Card -->
|
|
<xpath expr="//main" position="replace">
|
|
<main class="p-0 o_tncsc_card w-100 d-flex flex-column h-100">
|
|
<!-- 1. Top Cover Image Banner (Large, edge-to-edge) -->
|
|
<div class="o_tncsc_card_banner position-relative overflow-hidden">
|
|
<!-- Event Image with fallbacks -->
|
|
<t t-if="record.image_512.raw_value or record.image_128.raw_value">
|
|
<img t-att-src="'/web/image/event.event/' + record.id.raw_value + '/image_512'"
|
|
alt="Event Image"
|
|
class="o_tncsc_card_cover_img"/>
|
|
</t>
|
|
<t t-elif="'picnic' in (record.name.value or '').toLowerCase()">
|
|
<img src="/tncsc_deployment/static/src/img/events/summer-picnic.jpg"
|
|
alt="Event Image"
|
|
class="o_tncsc_card_cover_img"/>
|
|
</t>
|
|
<t t-elif="'pongal' in (record.name.value or '').toLowerCase()">
|
|
<img src="/tncsc_deployment/static/src/img/dashboard/pongal_featured_banner.jpg"
|
|
alt="Event Image"
|
|
class="o_tncsc_card_cover_img"/>
|
|
</t>
|
|
<t t-elif="'new year' in (record.name.value or '').toLowerCase()">
|
|
<img src="/tncsc_deployment/static/src/img/hero/slide-1.webp"
|
|
alt="Event Image"
|
|
class="o_tncsc_card_cover_img"/>
|
|
</t>
|
|
<t t-else="">
|
|
<img src="/tncsc_deployment/static/src/img/events/event-banner.webp"
|
|
alt="Event Image"
|
|
class="o_tncsc_card_cover_img"/>
|
|
</t>
|
|
|
|
<!-- Gradient Overlay for badge contrast -->
|
|
<div class="o_tncsc_banner_overlay"/>
|
|
|
|
<!-- Floating Top Row: Stage Pill on left, Status Pill on right -->
|
|
<div class="o_tncsc_banner_top_row d-flex align-items-center justify-content-between">
|
|
<span t-attf-class="o_tncsc_stage_pill pill-{{ (record.stage_id.value or '').toLowerCase() }}">
|
|
<span class="o_dot">●</span>
|
|
<t t-esc="record.stage_id.value"/>
|
|
</span>
|
|
|
|
<!-- Floating Status Badge (Open / Closed) -->
|
|
<t t-if="record.registration_status.raw_value == 'open' or (record.stage_id.value != 'Ended' and !record.is_done.raw_value)">
|
|
<span class="o_tncsc_kanban_status_pill status-open">
|
|
<span class="status-pulse-dot"></span> Open
|
|
</span>
|
|
</t>
|
|
<t t-elif="record.registration_status.raw_value == 'sold_out'">
|
|
<span class="o_tncsc_kanban_status_pill status-soldout">
|
|
<i class="fa fa-ticket"></i> Sold Out
|
|
</span>
|
|
</t>
|
|
<t t-else="">
|
|
<span class="o_tncsc_kanban_status_pill status-closed">
|
|
<i class="fa fa-lock"></i> Closed
|
|
</span>
|
|
</t>
|
|
</div>
|
|
|
|
<!-- Floating Bottom-Left Date Badge -->
|
|
<div t-if="record.date_begin.raw_value" class="o_tncsc_banner_date_badge">
|
|
<span class="date-month"><t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('LLL')"/></span>
|
|
<span class="date-day"><t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('d')"/></span>
|
|
</div>
|
|
|
|
<!-- Floating Bottom-Right Time Pill -->
|
|
<div t-if="record.date_begin.raw_value" class="o_tncsc_banner_time_pill">
|
|
<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-1">
|
|
<circle cx="12" cy="12" r="10"/>
|
|
<polyline points="12 6 12 12 16 14"/>
|
|
</svg>
|
|
<t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('t')"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 2. Card Body Content -->
|
|
<div class="o_tncsc_card_body d-flex flex-column flex-grow-1">
|
|
<!-- Event Title -->
|
|
<div class="o_tncsc_card_title" t-att-title="record.name.value">
|
|
<field name="name"/>
|
|
</div>
|
|
|
|
<!-- Subtitle / Tagline -->
|
|
<div t-if="record.subtitle.value" class="o_tncsc_card_subtitle">
|
|
<field name="subtitle"/>
|
|
</div>
|
|
<div t-else="" class="o_tncsc_card_subtitle text-muted-sub">
|
|
Tamil Nadu Cultural Society of Canada
|
|
</div>
|
|
|
|
<!-- Meta Info List -->
|
|
<div class="o_tncsc_card_meta d-flex flex-column gap-1 mb-2">
|
|
<!-- Location -->
|
|
<div class="o_tncsc_meta_row d-flex align-items-center gap-2">
|
|
<svg class="o_tncsc_meta_svg text-gold" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="#D4A359" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/>
|
|
<circle cx="12" cy="10" r="3"/>
|
|
</svg>
|
|
<span class="text-truncate">
|
|
<field t-if="record.address_id.value" name="address_id"/>
|
|
<span t-else="">Ontario, Canada</span>
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Full Date -->
|
|
<div t-if="record.date_begin.raw_value" class="o_tncsc_meta_row d-flex align-items-center gap-2">
|
|
<svg class="o_tncsc_meta_svg text-gold" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="#D4A359" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
|
|
<line x1="16" y1="2" x2="16" y2="6"/>
|
|
<line x1="8" y1="2" x2="8" y2="6"/>
|
|
<line x1="3" y1="10" x2="21" y2="10"/>
|
|
</svg>
|
|
<span class="text-truncate">
|
|
<t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('cccc, d LLL yyyy')"/>
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Attendees count if available -->
|
|
<div t-if="record.seats_taken.raw_value" class="o_tncsc_meta_row d-flex align-items-center gap-2">
|
|
<svg class="o_tncsc_meta_svg text-gold" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="#D4A359" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
|
|
<circle cx="9" cy="7" r="4"/>
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
|
|
</svg>
|
|
<span><field name="seats_taken"/> Registered Attendees</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 3. Action Footer -->
|
|
<div class="o_tncsc_card_footer mt-auto pt-2 d-flex align-items-center justify-content-between">
|
|
<span class="o_tncsc_stage_label text-muted small">
|
|
<t t-if="record.registration_status.raw_value == 'open' or (record.stage_id.value != 'Ended' and !record.is_done.raw_value)">
|
|
<span class="text-success fw-semibold"><i class="fa fa-check-circle me-1"></i>Active</span>
|
|
</t>
|
|
<t t-else="">
|
|
<span class="text-muted"><i class="fa fa-flag-checkered me-1"></i>Concluded</span>
|
|
</t>
|
|
</span>
|
|
<button class="o_tncsc_btn_details btn-primary-gold">
|
|
View Details →
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Keep Ended stage unfolded -->
|
|
<record id="event.event_stage_done" model="event.stage">
|
|
<field name="fold" eval="False"/>
|
|
</record>
|
|
|
|
<!-- Ensure default group by stage for the main Events action and clear upcoming filter -->
|
|
<record id="event.action_event_view" model="ir.actions.act_window">
|
|
<field name="context">{'default_group_by': 'stage_id', 'search_default_upcoming': 0}</field>
|
|
</record>
|
|
|
|
<!-- Load Google Fonts Playfair Display cleanly in web.layout -->
|
|
<template id="tncsc_assets_fonts" inherit_id="web.layout">
|
|
<xpath expr="//head" position="inside">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com"/>
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="crossorigin"/>
|
|
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;0,800;1,600&display=swap" rel="stylesheet"/>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|