<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="external_layout_footer_content" inherit_id="web.external_layout_footer_content">
        <xpath expr="//div[contains(@t-attf-class, 'o_footer_content')]" position="attributes">
            <attribute name="t-if">not custom_footer</attribute>
        </xpath>
        <xpath expr="//div[contains(@t-attf-class, 'o_footer_content')]" position="after">
            <div
                t-attf-class="o_footer_content {{footer_content_classes}}"
                t-if="custom_footer and company.account_fiscal_country_id.code == 'HU'"
            >
                <t t-out="custom_footer"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_standard" inherit_id="web.external_layout_standard" >
        <xpath expr="//img/../.." position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//img/../.." position="after">
            <div t-attf-class="header o_company_#{company.id}_layout"
                t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_bubble" inherit_id="web.external_layout_bubble">
        <xpath expr="//img/../.." position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//img/../.." position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_wave" inherit_id="web.external_layout_wave">
        <!-- support for custom header -->
        <xpath expr="//img/../.." position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//img/../.." position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_folder" inherit_id="web.external_layout_folder">
        <!-- support for custom header -->
        <xpath expr="//img/../.." position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//img/../.." position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_center" inherit_id="web.external_layout_center">
        <!-- support for custom header -->
        <xpath expr="//table" position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//table" position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_dual" inherit_id="web.external_layout_dual">
        <!-- support for custom header -->
        <xpath expr="//table" position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//table" position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>

    <template id="external_layout_lines" inherit_id="web.external_layout_lines">
        <!-- support for custom header -->
        <xpath expr="//table" position="attributes">
            <attribute name="t-if">not custom_header</attribute>
        </xpath>

        <xpath expr="//table" position="after">
            <div t-if="custom_header and company.account_fiscal_country_id.code == 'HU'">
                <t t-call="#{custom_header}"/>
            </div>
        </xpath>
    </template>
</odoo>
