diff options
| author | Adrien Dieudonne <adr@odoo.com> | 2019-05-09 12:42:07 +0000 |
|---|---|---|
| committer | Adrien Dieudonne <adr@odoo.com> | 2019-09-16 15:11:28 +0000 |
| commit | 8bef7af307064563afde9efa7c59d46c603ba25f (patch) | |
| tree | 9c997023f8d37133f8bec3bb2aee32986abe860d /addons/web/static/src/xml | |
| parent | fc5934dc4541aeff4e819a9b3404a3cbb793453f (diff) | |
[REF] web: control_panel: breadcrumb and cp_searchview flexible width
1) The size of the left part of the control panel will take free
space left. Normally, the width is always fixed to 50/50 but
now the breadcrumb can take more or less space if needed.
It will be useful on mobile where the search bar is dynamically
sized.
2) Control panel elements are split into two divs;
- breadcrumb and search bar are grouped to be in the top.
- buttons (o_cp_left) and pager (o_cp_right) in the bottom.
Now we can easily add antoher elements in the top or bottom
part of the control panel.
3) Control panel template is likely the same on mobile so
they are now merged.
4) Before this commit, we always had an empty parent even if
the search bar wasn't rendered. Removing it makes the DOM cleaner.
Because of this, we are not able to expose this area used to add
custom elements. Some code need to be adapted.
Task ID : 1924760
Diffstat (limited to 'addons/web/static/src/xml')
| -rw-r--r-- | addons/web/static/src/xml/base.xml | 77 |
1 files changed, 32 insertions, 45 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 733bd37c211..e8d8850115e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -148,18 +148,22 @@ <t t-name="ControlPanel"> <div class="o_control_panel"> - <ol class="breadcrumb" role="navigation"/> - <div class="o_cp_searchview" role="search"> - <t t-call="SearchView"/> - </div> - <div class="o_cp_left"> - <div class="o_cp_buttons" role="toolbar" aria-label="Control panel toolbar"/> - <aside class="o_cp_sidebar"/> + <div> + <ol class="breadcrumb" role="navigation"/> + <div class="o_cp_searchview" role="search"> + <t t-if="widget.withSearchBar" t-call="SearchView"/> + </div> </div> - <div class="o_cp_right"> - <div class="btn-group o_search_options" role="search"/> - <nav class="o_cp_pager" role="search" aria-label="Pager"/> - <nav class="btn-group o_cp_switch_buttons" role="toolbar" aria-label="View switcher"/> + <div> + <div class="o_cp_left"> + <div class="o_cp_buttons" role="toolbar" aria-label="Control panel toolbar"/> + <aside class="o_cp_sidebar"/> + </div> + <div class="o_cp_right"> + <div class="btn-group o_search_options" role="search"/> + <nav class="o_cp_pager" role="search" aria-label="Pager"/> + <nav class="btn-group o_cp_switch_buttons" role="toolbar" aria-label="View switcher"/> + </div> </div> </div> </t> @@ -1164,7 +1168,13 @@ </div> <div t-name="SearchView" class="o_searchview" role="search" aria-autocomplete="list"> - <span class="o_searchview_more fa" title="Advanced Search..." role="img" aria-label="Advanced Search..."/> + <t t-if="widget.isMobile"> + <t t-call="MobileSearchView"/> + <button class="o_enable_searchview btn fa fa-search"/> + </t> + <t t-else=""> + <span class="o_searchview_more fa" title="Advanced Search..." role="img" aria-label="Advanced Search..."/> + </t> </div> <div t-name="SearchView.SearchBar" class="o_searchview_input_container"> @@ -1233,40 +1243,17 @@ </select> </t> -<t t-name="MobileControlPanel"> - <div class="o_control_panel"> - <ol class="breadcrumb" role="navigation"/> - <div class="o_cp_searchview" role="search"> - <t t-call="MobileSearchView"/> - </div> - <div class="o_cp_left"> - <div class="o_cp_buttons" role="toolbar" aria-label="Control panel toolbar"/> - <aside class="o_cp_sidebar"/> - </div> - <div class="o_cp_right"> - <div class="btn-group o_search_options" role="search"/> - <nav class="o_cp_pager" role="search" aria-label="Pager"/> - <nav class="btn-group o_cp_switch_buttons" role="toolbar" aria-label="View switcher"/> - </div> - </div> -</t> - -<t t-name="MobileSearchView"> - <div class="o_searchview" role="search" aria-autocomplete="list"> - <button class="o_enable_searchview btn fa fa-search"/> - <div class="o_mobile_search o_hidden"> - <div class="o_mobile_search_header"> - <span class="o_mobile_search_close float-left mt16 mb16 mr8 ml16"> - <i class="fa fa-arrow-left"/> - <strong class="float-right ml8">FILTER</strong> - </span> - <span class="float-right o_mobile_search_clear_facets mt16 mr16">CLEAR</span> - </div> - <div class="o_mobile_search_filter o_search_options mb8 mt8 ml16 mr16"/> - <div class="btn btn-primary o_mobile_search_show_result">SEE RESULT</div> - </div> +<div t-name="MobileSearchView" class="o_mobile_search o_hidden"> + <div class="o_mobile_search_header"> + <span class="o_mobile_search_close float-left mt16 mb16 mr8 ml16"> + <i class="fa fa-arrow-left"/> + <strong class="float-right ml8">FILTER</strong> + </span> + <span class="float-right o_mobile_search_clear_facets mt16 mr16">CLEAR</span> </div> -</t> + <div class="o_mobile_search_filter o_search_options mb8 mt8 ml16 mr16"/> + <div class="btn btn-primary o_mobile_search_show_result">SEE RESULT</div> +</div> <div t-name="AddNewFavoriteMenu"> <button type="button" class="dropdown-item o_generator_menu o_add_favorite o_menu_header">Save Current Search</button> |
