TNCSC_Odoo/addons/tncsc_deployment/views/event_kanban_views.xml
Alaguraj0361 56dd9f5596
Some checks failed
CI / Brand-leak check (push) Has been cancelled
CI / flake8 / pylint-odoo / manifest completeness (push) Has been cancelled
CI / Install all modules with --test-enable (push) Has been cancelled
add tncsc_deployment module with custom dark theme event kanban styling and assets
2026-09-26 00:37:11 +05:30

159 lines
9.8 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 field for card rendering -->
<xpath expr="//field[@name='date_end']" position="after">
<field name="subtitle"/>
</xpath>
<!-- Remove default aside date bar -->
<xpath expr="//aside" position="replace"/>
<!-- Replace standard main content with Tamil Luxury Dark Theme Card while keeping <main> tag -->
<xpath expr="//main" position="replace">
<main class="p-0 o_tncsc_dark_card w-100">
<!-- Bottom-right subtle mandala corner artwork -->
<div class="o_tncsc_mandala_corner"/>
<!-- Top Header Row: Stage Pill Badge on left, Three Dots on right -->
<div class="o_tncsc_card_top 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">&#9679;</span>
<t t-esc="record.stage_id.value"/>
</span>
<div class="o_tncsc_card_dots">
<span>&#8226;&#8226;&#8226;</span>
</div>
</div>
<!-- Date Box row (Only for Summer Picnic / New stage) -->
<t t-if="record.stage_id.value === 'New'">
<div class="o_tncsc_card_date_box_row d-flex align-items-center gap-3">
<div class="o_tncsc_card_date_box">
<div class="o_day"><t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('d')"/></div>
<div class="o_month"><t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('MMM yyyy')"/></div>
</div>
<div class="d-flex flex-column gap-1 o_tncsc_card_time_col">
<div class="o_time d-flex align-items-center">
<svg class="o_tncsc_clock_svg me-1" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="#D4A359" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<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 t-if="record.date_begin.raw_value !== record.date_end.raw_value" class="o_end_date d-flex align-items-center">
<svg class="o_tncsc_cal_svg me-1" 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>
<t t-esc="luxon.DateTime.fromISO(record.date_end.raw_value).toFormat('d MMM')"/>
</div>
</div>
</div>
</t>
<!-- Central Circular Gold Icon -->
<div class="o_tncsc_card_circle_icon">
<!-- Calendar icon for New and Booked -->
<svg t-if="record.stage_id.value === 'New' or record.stage_id.value === 'Booked'" viewBox="0 0 24 24" width="24" height="24" stroke="#D4A359" stroke-width="1.8" fill="none" 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>
<!-- Megaphone icon for Announced -->
<svg t-elif="record.stage_id.value === 'Announced'" viewBox="0 0 24 24" width="24" height="24" stroke="#D4A359" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 11l18-5v12L3 13v-2z"/>
<path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"/>
</svg>
<!-- Checkmark circle icon for Ended -->
<svg t-elif="record.stage_id.value === 'Ended'" viewBox="0 0 24 24" width="24" height="24" stroke="#D4A359" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="9"/>
<polyline points="8 12 11 15 16 9"/>
</svg>
<!-- Default fallback -->
<svg t-else="" viewBox="0 0 24 24" width="24" height="24" stroke="#D4A359" stroke-width="1.8" fill="none" 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>
</div>
<!-- Event Title -->
<div class="o_tncsc_card_title text-center">
<field name="name"/>
</div>
<!-- Subtitle / Tagline -->
<div t-if="record.subtitle.value" class="o_tncsc_card_subtitle text-center">
<field name="subtitle"/>
</div>
<!-- Location -->
<div class="o_tncsc_card_location d-flex align-items-center justify-content-center gap-1">
<svg class="o_tncsc_pin_svg me-1" 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>
<field t-if="record.address_id.value" name="address_id"/>
<span t-else="">Online Event</span>
</div>
<!-- Date & Time (for Booked, Announced, Ended) -->
<div t-if="record.stage_id.value !== 'New'" class="o_tncsc_card_datetime d-flex align-items-center justify-content-center gap-1">
<svg class="o_tncsc_cal_svg me-1" 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>
<t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('d MMM yyyy')"/> &#8226; <t t-esc="luxon.DateTime.fromISO(record.date_begin.raw_value).toFormat('t')"/>
</span>
</div>
<!-- Action Button: View Details -->
<div class="o_tncsc_card_action text-center">
<button t-attf-class="o_tncsc_btn_details {{ record.stage_id.value === 'New' ? 'btn-primary-gold' : 'btn-outline-gold' }}">
View Details &#8594;
</button>
</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_stage_id': 1, '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&amp;display=swap" rel="stylesheet"/>
</xpath>
</template>
</odoo>