Files
odoo_source/addons/auth_totp/views/templates.xml
T
Olivier Dony 3f3c7b507a [IMP] base, totp: simplify form layout and improve responsiveness
Some of the TOTP-related forms contained an attempt at making a centered
modal pop-up, using a bootstrap `card` that would also serve to
emphasize that the interaction was sensitive and security-related.
Some of the "footer buttons" were moved inside the form to make it
more obvious that they were part of the interaction flow.

However some of this caused breakages of responsiveness and did not yield
a really satisfactory result anyway.

This commit switches back to using regular non-centered forms. It looks
quite ugly because the content is better suited for a narrow modal, but
it means less surprises in terms of layout and less responsiveness
issues.

closes odoo/odoo#58541

closes odoo/odoo#58544

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-09-26 09:45:17 +00:00

46 lines
2.2 KiB
XML

<odoo>
<template id="assets_tests" inherit_id="web.assets_tests">
<xpath expr="." position="inside">
<script type="text/javascript" src="/auth_totp/static/tests/totp_flow.js"></script>
</xpath>
</template>
<template id="auth_totp_form">
<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="">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<input type="hidden" name="redirect" t-att-value="redirect"/>
<div class="form-group">
<label for="totp_token">Authentication Code (6 digits)</label>
<input id="totp_token" name="totp_token" class="form-control mb-2"
autofocus="autofocus" required="required"/>
</div>
<p class="alert alert-danger" t-if="error" role="alert">
<t t-esc="error"/>
</p>
<div t-attf-class="clearfix oe_login_buttons text-center mb-1">
<button type="submit" class="btn btn-primary btn-block">
Verify
</button>
</div>
<div class="small mb-2 mt-2 text-muted">
<i class="fa fa-2x fa-mobile pull-left"/>
Open the two-factor authentication app on your
device to obtain a code and verify your identity
</div>
</form>
</div>
<div class="text-center pb-2 border-top">
<form method="POST" action="/web/session/logout" class="form-inline">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<button type="submit" class="btn btn-link btn-sm mb-2">
Cancel
</button>
</form>
</div>
</t>
</template>
</odoo>