summaryrefslogtreecommitdiff
path: root/addons/web/static/src/xml/base.xml
diff options
context:
space:
mode:
authorHiral Bhavsar <hbh@odoo.com>2018-06-12 19:00:34 +0530
committerGéry Debongnie <ged@odoo.com>2018-07-25 12:48:38 +0200
commitda7b59045d246c159f93bc75e3f19c6b1221d31c (patch)
tree85a0e7811d5052f119e65bfb8621fc43061a9d12 /addons/web/static/src/xml/base.xml
parent272bcadc92a077bb20e71a6797214379310b109e (diff)
[IMP] base_import, web: add view switcher and h 'Import' button in mobile
As there are a few chance that someone will import something on a mobile view. So, we hide the button 'Import' in a mobile view. For mobile view, we added a view switcher button and it'll display a list of views buttons. Also set active view's icon as its icon. Related to Task: 1857696 Co-authored-by: Mohammed Shekha <msh@openerp.com>
Diffstat (limited to 'addons/web/static/src/xml/base.xml')
-rw-r--r--addons/web/static/src/xml/base.xml23
1 files changed, 19 insertions, 4 deletions
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 75d02c9046f..b92c143dc5f 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -202,12 +202,27 @@
</div>
</t>
+<t t-name="ControlPanel.SwitchButton">
+ <button type="button" t-att-accesskey="view.accessKey"
+ t-attf-class="btn btn-icon fa fa-lg #{view.icon} o_cp_switch_#{view.type}"
+ t-attf-aria-label="View #{view.type}"
+ t-att-data-view-type="view.type" t-attf-title="View #{view.type}" tabindex="-1"/>
+</t>
+
+<t t-name="ControlPanel.SwitchButtons.Mobile">
+ <button class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
+ <span class="o_switch_view_button_icon"/><span class="caret ml8"/>
+ </button>
+ <ul class="dropdown-menu dropdown-menu-right list-inline">
+ <li t-foreach="views" t-as="view">
+ <t t-call="ControlPanel.SwitchButton"/>
+ </li>
+ </ul>
+</t>
+
<t t-name="ControlPanel.SwitchButtons">
<t t-foreach="views" t-as="view">
- <button type="button" t-att-accesskey="view.accessKey"
- t-attf-class="btn btn-icon fa fa-lg #{view.icon} o_cp_switch_#{view.type}"
- t-attf-aria-label="View #{view.type}"
- t-att-data-view-type="view.type" t-attf-title="View #{view.type}" tabindex="-1"/>
+ <t t-call="ControlPanel.SwitchButton"/>
</t>
</t>