<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <template id="code_custom_layout" inherit_id="web.layout"
              name="Custom Layout">
        <xpath expr="//meta[@content='IE=edge,chrome=1']" position="after">
            <meta name="viewport"
                  content="width=device-width, initial-scale=1, user-scalable=no"/>
        </xpath>
    </template>

    <template id="code_custom_login" inherit_id="web.login"
              name="Custom Layout">
        <xpath expr="//t[@t-call='web.login_layout']" position="replace">

            <t t-call="web.login_layout">
                <form class="oe_login_form" role="form"
                      t-attf-action="/web/login" method="post"
                      onsubmit="this.action = '/web/login' + location.hash">
                    <input type="hidden" name="csrf_token"
                           t-att-value="request.csrf_token()"/>

                    <div class="form-group field-db"
                         t-if="databases and len(databases) &gt; 1">
                        <label for="db" class="col-form-label">Database</label>
                        <div t-attf-class="input-group {{'input-group-sm' if form_small else ''}}">
                            <input type="text" name="db"
                                   t-att-value="request.db" id="db"
                                   t-attf-class="form-control #{'form-control-sm' if form_small else ''}"
                                   required="required" readonly="readonly"/>
                            <span class="input-group-append">
                                <a role="button" href="/web/database/selector"
                                   class="btn btn-secondary">Select
                                    <i class="fa fa-database" role="img"
                                       aria-label="Database"
                                       title="Database"/>
                                </a>
                            </span>
                        </div>
                    </div>

                    <div class="form-group field-login">
                        <label for="login">Email</label>
                        <input type="text" placeholder="Email" name="login"
                               t-att-value="login" id="login"
                               t-attf-class="form-control #{'form-control-sm' if form_small else ''}"
                               required="required" autofocus="autofocus"
                               autocapitalize="off"/>
                    </div>

                    <div class="form-group field-password">
                        <label for="password">Password</label>
                        <input type="password" placeholder="Password"
                               name="password" id="password"
                               t-attf-class="form-control #{'form-control-sm' if form_small else ''}"
                               required="required"
                               autocomplete="current-password"
                               t-att-autofocus="'autofocus' if login else None"
                               maxlength="4096"/>
                    </div>

                    <p class="alert alert-danger" t-if="error" role="alert">
                        <t t-esc="error"/>
                    </p>
                    <p class="alert alert-success" t-if="message" role="status">
                        <t t-esc="message"/>
                    </p>

                    <div t-attf-class="clearfix oe_login_buttons text-center mb-1 {{'pt-2' if form_small else 'pt-3'}}">
                        <button type="submit" class="btn btn-primary btn-block">
                            Log in
                        </button>
                        <t t-if="debug">
                            <button type="submit" name="redirect"
                                    value="/web/become"
                                    class="btn btn-link btn-sm btn-block">Log in
                                as superuser
                            </button>
                        </t>
                        <div class="o_login_auth"/>
                    </div>

                    <input type="hidden" name="redirect"
                           t-att-value="redirect"/>
                </form>
            </t>
        </xpath>
    </template>

    <template id="code_custom_login" inherit_id="web.login_layout"
              name="Custom Layout">
        <xpath expr="//t[@t-call='web.frontend_layout']" position="replace">
            <t t-call="web.frontend_layout">
                <t t-set="html_data" t-value="{'style': 'height: 100%;'}"/>
                <t t-set="body_classname" t-value="'bg-100'"/>
                <t t-set="no_header" t-value="True"/>
                <t t-set="no_footer" t-value="True"/>

                <div class="container py-5">

                    <div t-attf-class="card border-0 mx-auto bg-100 {{login_card_classes}} o_database_list"
                         style="max-width: 40%;">
                        <div class="c_login_container">
                            <div class="card-body">
                                <div t-attf-class="text-center pb-3 border-bottom {{'mb-3' if form_small else 'mb-4'}}">
                                    <img t-attf-src="/web/binary/company_logo{{ '?dbname='+db if db else '' }}"
                                         alt="Logo"
                                         style="max-height:120px; max-width: 100%; width:auto"/>
                                </div>
                                <t t-raw="0"/>
                                <div class="text-center small mt-4 pt-3 border-top"
                                     t-if="not disable_footer">
                                    <t t-if="not disable_database_manager">
                                        <a class="border-right pr-2 mr-1"
                                           href="/web/database/manager">Manage
                                            Databases
                                        </a>
                                    </t>
                                    <a href="https://www.odoo.com?utm_source=db&amp;utm_medium=auth"
                                       target="_blank">Powered by
                                        <span>Odoo</span>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </t>
        </xpath>
    </template>

</odoo>