diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-05-24 16:56:42 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2018-07-27 12:36:54 +0200 |
| commit | f4fbaf1efae11e8bd3b1a2938ab765d391764a1b (patch) | |
| tree | 6b6582db858884642cf5f5b2c6762d7569879149 /addons/web/static/src/xml/base.xml | |
| parent | 6e223b927368d805e3371431b42166906b1fd06f (diff) | |
[REF] web, *: BS4, use custom BS4 checkbox everywhere
Before this commit, Odoo used checkboxes in three different ways:
- A simple <input type="checkbox"/>, mainly in the frontend. The style
is browser dependant.
- Same as above but with the BS3, checkbox structure. The style is still
the same, but the alignement is supposed to be better (which is not
always the case).
- The Odoo official structure:
```
<div class="o_checkbox">
<input type="checkbox"/>
<span/>
</div>
```
which allows to have a cross-browser checkbox style and correct
alignements.
The goal after this commit is to only use the BS4 *custom* checkbox
structure to achieve the same goal as our official structure (and
remove that one):
```
<div class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input" id="customCheck1">
<label class="custom-control-label" for="customCheck1">...</label>
</div>
```
/!\ Labels are now required (use a zero-width space if necessary)
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 02d976a2fe3..2a07ccaffeb 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -868,10 +868,10 @@ <div role="menuitem" class="o_hide_in_kanban" t-att-data-id="tag_id" t-att-data-color="0"> - <div class="o_checkbox"> - <input type="checkbox"/> - <span/> - </div> Hide in Kanban + <div class="custom-control custom-checkbox"> + <input type="checkbox" id="o_hide_in_kanban_checkbox" class="custom-control-input"/> + <label for="o_hide_in_kanban_checkbox" class="custom-control-label">Hide in Kanban</label> + </div> </div> </li> </ul> @@ -1283,10 +1283,16 @@ <input type="text" class="o_input"></input> </div> <div role="menuitem" class="dropdown-item-text o_save_name"> - <span><div class="o_checkbox"><input type="checkbox"/><span/></div> Use by default</span> + <div class="custom-control custom-checkbox"> + <input type="checkbox" id="o_fav_menu_use_by_default" class="custom-control-input"/> + <label for="o_fav_menu_use_by_default" class="custom-control-label">Use by default</label> + </div> </div> <div role="menuitem" class="dropdown-item-text o_save_name"> - <span><div class="o_checkbox"><input type="checkbox"/><span/></div> Share with all users </span><span class="fa fa-users" role="img" aria-label="Users" title="Users"/> + <div class="custom-control custom-checkbox"> + <input type="checkbox" id="o_fav_menu_share_all_users" class="custom-control-input"/> + <label for="o_fav_menu_share_all_users" class="custom-control-label">Share with all users <span class="fa fa-users" role="img" aria-label="Users" title="Users"/></label> + </div> </div> <div class="dropdown-item-text o_save_name"> <button role="menuitem" type="button" class="btn btn-primary">Save</button> @@ -1392,11 +1398,10 @@ <div aria-atomic="true"> <div t-foreach="widget.m2mValues" t-as="m2m_value"> <t t-set="id_for_label" t-value="'o_many2many_checkbox_' + _.uniqueId()"/> - <div class="o_checkbox"> - <input type="checkbox" t-att-id="id_for_label" t-att-data-record-id="JSON.stringify(m2m_value[0])"/> - <span/> + <div class="custom-control custom-checkbox"> + <input type="checkbox" t-att-id="id_for_label" class="custom-control-input" t-att-data-record-id="JSON.stringify(m2m_value[0])"/> + <label t-att-for="id_for_label" class="custom-control-label o_form_label"><t t-esc="m2m_value[1]"/></label> </div> - <label t-att-for="id_for_label" class="o_form_label"><t t-esc="m2m_value[1]"/></label> </div> </div> </t> |
