Files
odoo_source/addons/website/static/src/xml/website.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

34 lines
1.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="website.prompt">
<div role="dialog" class="modal o_technical_modal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<header class="modal-header" t-if="window_title">
<h3 class="modal-title"><t t-esc="window_title"/></h3>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</header>
<main class="modal-body">
<form role="form" t-att-id="id">
<div class="row mb0">
<label for="page-name" class="col-md-3 col-form-label">
<t t-esc="field_name"/>
</label>
<div class="col-md-9">
<input t-if="field_type == 'input'" type="text" class="form-control" required="required"/>
<textarea t-if="field_type == 'textarea'" class="form-control" required="required" rows="5"></textarea>
<select t-if="field_type == 'select'" class="form-select"></select>
</div>
</div>
</form>
</main>
<footer class="modal-footer">
<button type="button" class="btn btn-primary btn-continue"><t t-esc="btn_primary_title"/></button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-label="Cancel"><t t-esc="btn_secondary_title"/></button>
</footer>
</div>
</div>
</div>
</t>
</templates>