summaryrefslogtreecommitdiff
path: root/addons/web/static/src/scss
diff options
context:
space:
mode:
authorJérémy Hennecart <jeh@odoo.com>2020-06-19 07:06:31 +0000
committerAaron Bohy <aab@odoo.com>2020-06-22 13:04:01 +0000
commitc7964657ecbbad278cec73cf231d7eef55b44347 (patch)
treebe77532a80cbed1283c2062cb2dc1159aa0fbdd4 /addons/web/static/src/scss
parent96fcefb6f1fe3fb5a5f197e2635e6d71d9a1d9dd (diff)
[IMP] web: add support of "sample" attribute in views
With this commit, it is now possible to display sample (fake) data in empty views, in the hope of easing user onboarding. This can be enabled (in list and kanban views) with attribute sample="1" on the arch root element. In this case, if there is no data to display, sample data will be generated based on heuristics (depending on field types and names). This can be used in addition to the no content helper. Task 2232801 X-original-commit: 7c8e627ff5029cb539d702705e5ce53d658c76ed Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Jérémy Hennecart <jeh@odoo.com> Co-authored-by: Julien Mougenot <jum@odoo.com>
Diffstat (limited to 'addons/web/static/src/scss')
-rw-r--r--addons/web/static/src/scss/list_view.scss1
-rw-r--r--addons/web/static/src/scss/views.scss37
2 files changed, 37 insertions, 1 deletions
diff --git a/addons/web/static/src/scss/list_view.scss b/addons/web/static/src/scss/list_view.scss
index 61381d57160..7eea7e98ed2 100644
--- a/addons/web/static/src/scss/list_view.scss
+++ b/addons/web/static/src/scss/list_view.scss
@@ -1,5 +1,6 @@
.o_list_view {
position: relative;
+ height: 100%;
.o_list_table {
position: relative;
diff --git a/addons/web/static/src/scss/views.scss b/addons/web/static/src/scss/views.scss
index d917b3fd1d6..584ec66faed 100644
--- a/addons/web/static/src/scss/views.scss
+++ b/addons/web/static/src/scss/views.scss
@@ -40,7 +40,7 @@
// No content helper
.o_view_nocontent {
- @include o-position-absolute(20%, 0, 0, 0);
+ @include o-position-absolute(30%, 0, 0, 0);
pointer-events: none;
z-index: 1;
@@ -72,3 +72,38 @@
}
}
}
+
+// Sample data
+@mixin web_view_sample_data {
+ opacity: 0.33;
+ pointer-events: none;
+ user-select: none;
+}
+.o_view_sample_data {
+ .o_list_view {
+ .o_data_row, .o_group_header, .o_list_table > tfoot {
+ @include web_view_sample_data;
+ }
+ .o_list_table {
+ cursor: default !important;
+ > thead .o_list_record_selector {
+ pointer-events: none;
+ }
+ }
+ }
+ .o_kanban_view {
+ .o_kanban_counter,
+ .o_kanban_record,
+ .o_kanban_toggle_fold,
+ .o_column_folded,
+ .o_column_archive_records,
+ .o_column_unarchive_records {
+ @include web_view_sample_data;
+ }
+ }
+ .o_nocontent_help {
+ border-radius: 100%;
+ background-color: #f9f9f9;
+ box-shadow: 0 0 120px 100px #f9f9f9;
+ }
+}