summaryrefslogtreecommitdiff
path: root/addons/board
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-02-15 17:36:52 +0100
committerAlexandre Kühn <aku@odoo.com>2018-02-16 10:23:01 +0100
commitaa8745f1a811fffd339277ad5a43d3accf86fe34 (patch)
treeea670c2e8f7af17d5ab2607b048a05428246cfcb /addons/board
parent4c186f30c3a77e661f0dfdd39fe2c1216ef1ac7b (diff)
[FIX] web,*: various nocontent helper fixes
* account, board, hr_holidays, mail, sale, website_sale Small fixes on nocontent onboarding screens. Initial commit: https://github.com/odoo/odoo/commit/a87d761fdbf345ada5dc93e0a686b08a0f5a0417 Details: - list: centered; - pivot/graph: centered + empty folder face; - Dashboard app with nocontent helper; - Discuss inbox/starred: centered without neutral/smiling faces; => no faces because it's too much with animated rainbow man when emptying the any of the boxes. - hr_holidays: fixed onboarding screens; - (technical) dropped obsolete 'o_view_nocontent_container' style; - manual reconciliation 'nothing to reconcile': centered + inside form sheet; => renamed account's o_view_nocontent to o_view_noreconciliation, so that it doesn't use the style of views.less. - kanban: nocontent helper above the columns (if any); - texts "no order to upsell"/"abandonned cart" paragraph split in two.
Diffstat (limited to 'addons/board')
-rw-r--r--addons/board/static/src/js/dashboard.js4
-rw-r--r--addons/board/static/src/less/dashboard.less7
-rw-r--r--addons/board/static/src/xml/board.xml16
-rw-r--r--addons/board/static/tests/dashboard_tests.js8
-rw-r--r--addons/board/views/board_views.xml12
5 files changed, 23 insertions, 24 deletions
diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js
index c47e9b9564f..2e56eb39685 100644
--- a/addons/board/static/src/js/dashboard.js
+++ b/addons/board/static/src/js/dashboard.js
@@ -266,7 +266,9 @@ FormRenderer.include({
return element.tag === "action"? element: false;
});
});
- this.$el.toggleClass('o_dashboard_nocontent', !hasAction);
+ if (!hasAction) {
+ return $(QWeb.render('DashBoard.NoContent'));
+ }
// We should start with three columns available
node = $.extend(true, {}, node);
diff --git a/addons/board/static/src/less/dashboard.less b/addons/board/static/src/less/dashboard.less
index 88e30c8df7e..51f773a49a4 100644
--- a/addons/board/static/src/less/dashboard.less
+++ b/addons/board/static/src/less/dashboard.less
@@ -1,12 +1,5 @@
.o_dashboard {
- // no content help
- &.o_dashboard_nocontent {
- .o-flex-display();
- .o-align-content(center);
- .o-justify-content(center);
- }
-
// Dashboard layout
.oe_dashboard_layout_1 .oe_dashboard_column {
&.index_0 {
diff --git a/addons/board/static/src/xml/board.xml b/addons/board/static/src/xml/board.xml
index 13453a945f6..0e55c5dd77f 100644
--- a/addons/board/static/src/xml/board.xml
+++ b/addons/board/static/src/xml/board.xml
@@ -43,6 +43,22 @@
</ul>
</div>
</t>
+<t t-name="DashBoard.NoContent">
+ <div class="o_view_nocontent">
+ <div class="o_nocontent_help">
+ <p class="o_view_nocontent_neutral_face">
+ Your personal dashboard is empty
+ </p><p>
+ To add your first report into this dashboard, go to any
+ menu, switch to list or graph view, and click <i>"Add to
+ Dashboard"</i> in the extended search options.
+ </p><p>
+ You can filter and group data before inserting into the
+ dashboard using the search options.
+ </p>
+ </div>
+ </div>
+</t>
<t t-name="DashBoard.xml">
<form t-att-string="form_title">
<board t-att-style="style">
diff --git a/addons/board/static/tests/dashboard_tests.js b/addons/board/static/tests/dashboard_tests.js
index 87d1f1a3608..0a1264dc589 100644
--- a/addons/board/static/tests/dashboard_tests.js
+++ b/addons/board/static/tests/dashboard_tests.js
@@ -67,8 +67,8 @@ QUnit.test('dashboard basic rendering', function (assert) {
assert.ok(form.renderer.$el.hasClass('o_dashboard'),
"with a dashboard, the renderer should have the proper css class");
- assert.strictEqual(form.$('.o_dashboard .o_view_nocontent').length, 0,
- "should not have a no content helper");
+ assert.strictEqual(form.$('.o_dashboard .o_view_nocontent').length, 1,
+ "should have a no content helper");
assert.strictEqual(form.get('title'), "My Dashboard",
"should have the correct title");
form.destroy();
@@ -93,8 +93,8 @@ QUnit.test('display the no content helper', function (assert) {
},
});
- assert.strictEqual(form.$('.o_dashboard .o_view_nocontent').length, 0,
- "should not have a no content helper with action help");
+ assert.strictEqual(form.$('.o_dashboard .o_view_nocontent').length, 1,
+ "should have a no content helper with action help");
form.destroy();
});
diff --git a/addons/board/views/board_views.xml b/addons/board/views/board_views.xml
index aad2eb56383..00eedce86ce 100644
--- a/addons/board/views/board_views.xml
+++ b/addons/board/views/board_views.xml
@@ -23,18 +23,6 @@
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_my_dash_view"/>
- <field name="help" type="html">
- <p class="o_view_nocontent_neutral_face">
- Your personal dashboard is empty
- </p><p>
- To add your first report into this dashboard, go to any
- menu, switch to list or graph view, and click <i>'Add to
- Dashboard'</i> in the extended search options.
- </p><p>
- You can filter and group data before inserting into the
- dashboard using the search options.
- </p>
- </field>
</record>
<!--My Dashboard Menu-->