| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?xml version="1.0" encoding="utf-8"?>
- <odoo>
- <!--
- Global Layout Customization for M22 Tech Theme
- Goal: Remove standard Header and Footer globally to create a pure "App-like" feel.
- Also enforces Login for all public users.
- IMPORTANT: Only applies when theme_m22tc is the active theme.
- -->
- <template id="layout_custom_m22" inherit_id="website.layout" name="M22 Global Layout" priority="50">
-
- <!-- Head Injections: Only when M22 theme is active -->
- <xpath expr="//head" position="inside">
- <t t-if="request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc'">
- <!-- 1. Google Fonts: Urbanist -->
- <link href="https://fonts.googleapis.com" rel="preconnect"/>
- <link crossorigin="" href="https://fonts.gstatic.com" rel="preconnect"/>
- <link href="https://fonts.googleapis.com/css2?family=Urbanist:wght@400;600;700;800&display=swap" rel="stylesheet"/>
-
- <!-- 2. Material Symbols -->
- <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined" rel="stylesheet"/>
-
- <!-- 3. Tailwind CSS -->
- <script src="https://cdn.tailwindcss.com?plugins=forms,typography"></script>
-
- <!-- Tailwind Config: Disable preflight to prevent conflict with Odoo/Bootstrap -->
- <script>
- tailwind.config = {
- corePlugins: {
- preflight: false
- }
- }
- </script>
- </t>
- </xpath>
- <!-- Login enforcement script: Only when M22 theme is active -->
- <xpath expr="//body" position="inside">
- <t t-if="request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc'">
- <t t-if="request.env.user._is_public() and request.httprequest.path not in ['/web/login', '/web/signup', '/web/reset_password']">
- <script type="text/javascript">
- if (!window.location.pathname.startsWith('/web/login')) {
- window.location.href = '/web/login?redirect=' + encodeURIComponent(window.location.href);
- }
- </script>
- </t>
- </t>
- </xpath>
- <!-- Remove Header: Only when M22 theme is active -->
- <xpath expr="//header[@id='top']" position="attributes">
- <attribute name="t-if">not (request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc')</attribute>
- </xpath>
- <!-- Remove Footer: Only when M22 theme is active -->
- <xpath expr="//footer" position="attributes">
- <attribute name="t-if">not (request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc')</attribute>
- </xpath>
-
- <!-- Wrapwrap classes: Only when M22 theme is active -->
- <xpath expr="//div[@id='wrapwrap']" position="attributes">
- <attribute name="t-attf-class" add="#{request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc' and 'd-flex flex-column h-100' or ''}" separator=" "/>
- </xpath>
-
- <!-- Main classes: Only when M22 theme is active -->
- <xpath expr="//main" position="attributes">
- <attribute name="t-attf-class" add="#{request.website.sudo().theme_id and request.website.sudo().theme_id.name == 'theme_m22tc' and 'flex-grow-1' or ''}" separator=" "/>
- </xpath>
- </template>
- </odoo>
|