File tree Expand file tree Collapse file tree 4 files changed +31
-1
lines changed
awesome_dashboard/static/src Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,11 @@ import { Component } from "@odoo/owl";
5
5
import { registry } from "@web/core/registry" ;
6
6
import { Layout } from "@web/search/layout" ;
7
7
import { useService } from "@web/core/utils/hooks" ;
8
+ import { DashboardItem } from "./dashboard_item" ;
8
9
9
10
class AwesomeDashboard extends Component {
10
11
static template = "awesome_dashboard.AwesomeDashboard" ;
11
- static components = { Layout } ;
12
+ static components = { Layout, DashboardItem } ;
12
13
13
14
setup ( ) {
14
15
this . action = useService ( "action" ) ;
Original file line number Diff line number Diff line change 7
7
<button class =" btn btn-primary" t-on-click =" openCustomers" >Customers</button >
8
8
<button class =" btn btn-primary" t-on-click =" openLeads" >Leads</button >
9
9
</t >
10
+ <div class =" d-inline-flex p-4" >
11
+ <DashboardItem >some content</DashboardItem >
12
+ <DashboardItem size =" 2" >I love milk</DashboardItem >
13
+ <DashboardItem >some content</DashboardItem >
14
+ </div >
10
15
</Layout >
11
16
</t >
12
17
Original file line number Diff line number Diff line change
1
+ import { Component } from "@odoo/owl" ;
2
+
3
+ export class DashboardItem extends Component {
4
+ static template = "awesome_dashboard.DashboardItem"
5
+
6
+ static props = { 'size' : { type : Number , optional : true } }
7
+
8
+ setup ( ) {
9
+ if ( ! this . props . size ) {
10
+ this . props . size = 1
11
+ }
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <templates xml : space =" preserve" >
3
+ <t t-name =" awesome_dashboard.DashboardItem" >
4
+ <div class =" card m-2" t-attf-style =" width:{{18 * props.size}}rem;" >
5
+ <div class =" card-body" >
6
+ </div >
7
+ <t t-slot =" default" >
8
+ </t >
9
+ </div >
10
+ </t >
11
+ </templates >
You can’t perform that action at this time.
0 commit comments