<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="0">
        <record id="categ_meet6" model="calendar.event.type">
            <field name="name">Public Holiday</field>
        </record>

        <record id="email_template_company_public_holidays" model="mail.template">
            <field name="name">Public Holiday - Send by Email</field>
            <field name="email_from">${ctx.get('user_email') or ''|safe}</field>
            <field name="subject">${object.name}</field>
            <field name="model_id" ref="company_public_holidays_kanak.model_company_resource_calendar"/>
            <field name="auto_delete" eval="False"/>
            <field name="lang">${object.employee_id.lang}</field>
            <field name="body_html" type="html">
                <div style="margin: 0px; padding: 0px;">
                    <p style="margin: 0px; padding: 0px; font-size: 12px;">
                        Hello All,
                        <br/><br/>
                        Here the List of ${object.name}
                        <br/><br/>
                    </p>
                    <div style="margin: 0px; padding: 0px;">
                        <table  style="font-family: Trebuchet MS, Arial, Helvetica, sans-serif;border-collapse: collapse;width: 100%;">
                            <tr style="border-bottom: 2px solid #dee2e6;">
                                <th style="width:33.3%; padding-top: 12px;padding-bottom: 12px;background-color:#06386e;color: white; text-align:center;"><strong>Name</strong></th>
                                <th style="width:33.3%; padding-top: 12px;padding-bottom: 12px; background-color:#06386e;color: white; text-align:center;"><strong>Start Date</strong></th>
                                <th style="width:33.3%;  padding-top: 12px;padding-bottom: 12px;text-align:center;background-color:#06386e;color: white;"><strong>End Date</strong></th>
                            </tr>
                        </table>
                        <table  style="font-family: Trebuchet MS, Arial, Helvetica, sans-serif;border-collapse: collapse;width: 100%;">
                            % for line in object.company_global_leave_ids:
                                <tr style="${loop.cycle('background-color: #f2f2f2', 'background-color: #ffffff')}">
                                    <td style="width:33.3%; border: 1px solid #ddd;padding: 8px; text-align:center;">
                                        <strong>${line.name}</strong>
                                    </td>
                                    <td style="width:33.3%; border: 1px solid #ddd;padding: 8px; text-align:center;">
                                        <strong>${line.date_from}</strong>
                                    </td>
                                    <td style="width:33.3%; border: 1px solid #ddd;padding: 8px; text-align:center;">
                                        <strong>${line.date_to}</strong>
                                    </td>
                                </tr>
                        </table>
                        % endfor
                    </div>
                </div>
            </field>
        </record>
    </data>
</odoo>
