[IMP] board: single column layout on mobile
Improve the dashboard app on mobile by : - Hide the change layout button - Force one column view layout Task Id: 1904747
This commit is contained in:
@@ -2,6 +2,7 @@ odoo.define('board.BoardView', function (require) {
|
||||
"use strict";
|
||||
|
||||
var Context = require('web.Context');
|
||||
var config = require('web.config');
|
||||
var core = require('web.core');
|
||||
var dataManager = require('web.data_manager');
|
||||
var Dialog = require('web.Dialog');
|
||||
@@ -333,7 +334,7 @@ var BoardRenderer = FormRenderer.extend({
|
||||
});
|
||||
});
|
||||
|
||||
var $html = $('<div>').append($(QWeb.render('DashBoard', {node: node})));
|
||||
var $html = $('<div>').append($(QWeb.render('DashBoard', {node: node, isMobile: config.device.isMobile})));
|
||||
|
||||
// render each view
|
||||
_.each(this.actionsDescr, function (action) {
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<template>
|
||||
<t t-name="DashBoard">
|
||||
<div class="oe_dashboard_links">
|
||||
<button type="button" class="button oe_dashboard_link_change_layout" title="Change Layout..">
|
||||
<img src="/board/static/src/img/layout_1-1-1.png" width="16" height="16" alt=""/>
|
||||
<span> Change Layout </span>
|
||||
</button>
|
||||
</div>
|
||||
<t t-if="isMobile">
|
||||
<t t-set="node.attrs.layout" t-value="1"/>
|
||||
</t>
|
||||
<t t-if="!isMobile">
|
||||
<div class="oe_dashboard_links">
|
||||
<button type="button" class="button oe_dashboard_link_change_layout" title="Change Layout..">
|
||||
<img src="/board/static/src/img/layout_1-1-1.png" width="16" height="16" alt=""/>
|
||||
<span> Change Layout </span>
|
||||
</button>
|
||||
</div>
|
||||
</t>
|
||||
<table t-att-data-layout="node.attrs.layout" t-attf-class="oe_dashboard oe_dashboard_layout_#{node.attrs.layout}" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td t-foreach="node.children" t-as="column" t-if="column.tag == 'column'"
|
||||
|
||||
Reference in New Issue
Block a user