Files
odoo_source/addons/auth_totp/views/templates.xml
T
Romain Estievenart 98a97d0fea [IMP] *: removes .form-group
this commit removes the usage of .form-group class which is deprecated
since BS5.

Here is the css rules that was used:

a) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L1997
As we can see, it simply adds a `margin-bottom` of `1rem` which
corresponds to the `.mb-3` BS class.

b) https://github.com/twbs/bootstrap/blob/8fa0d3010112dca5dd6dd501173415856001ba8b/dist/css/bootstrap.css#L2326
As we already checked all `form-inline` in [1] and [2], we don't have to
do anything about these rules.

'''Breaking change: Dropped form-specific layout classes for our grid
system.
Use our grid and utilities instead of .form-group, .form-row, or
.form-inline.'''

https://getbootstrap.com/docs/5.0/migration/#forms

Notes:
- `position: relative` is already on `#new-password-group`.
- `.field-db`, `#editor-media-image`, `.unsplash_img_container` and
`#url-form-group` seems unused.
- Sometimes margins are unnecessary because of blocks overlapping.
  (e.g. `margin-bottom` is not needed if margin-top is set on the
  following node)
- CSS rules applied on `.s_website_form_rows > .form-group` are now in
the XML by adding `mb-0 py-2` BS classes.

Follow-up of:
[1] https://github.com/odoo/odoo/pull/97967
[2] https://github.com/odoo/enterprise/pull/30343

closes odoo/odoo#100052

Related: odoo/enterprise#31261
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-09-16 20:51:56 +02:00

51 lines
2.5 KiB
XML

<odoo>
<template id="auth_totp_form" name="Two-Factor Authentication">
<t t-call="web.login_layout">
<t t-set="disable_footer">1</t>
<div class="oe_login_form">
<h5 class="card-title">Two-factor Authentication</h5>
<form method="POST" action="" class="">
<div class="mb-2 mt-2 text-muted">
To login, enter below the six-digit authentication code provided by your Authenticator app.
<br/>
<a href="https://www.odoo.com/documentation/master/applications/general/auth/2fa.html"
title="Learn More" target="_blank">Learn More</a>
</div>
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input type="hidden" name="redirect" t-att-value="redirect"/>
<div class="mb-3">
<label class="fw-bold" for="totp_token">Authentication Code</label>
<input id="totp_token" name="totp_token" class="form-control mb-2"
autocomplete="off" inputmode="numeric" autofocus="autofocus" required="required" placeholder="e.g. 123456"/>
</div>
<div class="text-center py-2 border-top">
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<div class="mb-2 mt-2 text-muted">
<input type="checkbox" name="remember" id="switch-remember" value="1"/>
<label for="switch-remember">Don't ask again on this device</label>
</div>
<div t-attf-class="clearfix oe_login_buttons text-center d-grid mb-1">
<button type="submit" class="btn btn-primary">
Log in
</button>
</div>
</div>
</form>
<form method="POST" action="/web/session/logout">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="w-100 text-center">
<button type="submit" class="btn btn-link btn-sm mb-2">
Cancel
</button>
</div>
</form>
</div>
</t>
</template>
</odoo>