Skip to content
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
220c8f5
[IMP] awesome_owl: add counter on page
djoewie Apr 24, 2026
ba0852d
[MOV] awesome_owl: move counter to own class
djoewie Apr 27, 2026
ac3da2c
[IMP] awesome_owl: add card
djoewie Apr 27, 2026
d201888
[IMP] awesome_owl: markup in display
djoewie Apr 27, 2026
bb195b5
[IMP] awesome_owl: add prop validation
djoewie Apr 27, 2026
e5cf19c
[IMP] awesome_owl: add total of counters
djoewie Apr 27, 2026
0233cdf
[IMP] awesome_owl: add visualisation of a todolist
djoewie Apr 27, 2026
43be439
[IMP] awesome_owl: mark completed items
djoewie Apr 27, 2026
4ccb0fc
[IMP] awesome_owl: make adding todo's possible
djoewie Apr 27, 2026
b1703e6
[IMP] awesome_owl: autofocus input field
djoewie Apr 27, 2026
3bfc874
[IMP] awesome_owl: toggeling todos
djoewie Apr 27, 2026
752c640
[CLN] awesome_owl: follow naming convention
djoewie Apr 27, 2026
c517440
[IMP] awesome_owl: make deleting todoitems possible
djoewie Apr 27, 2026
09e67bb
[IMP] awesome_owl: introduction to slots
djoewie Apr 27, 2026
206c82e
[IMP] awesome_owl: add option to hide card content
djoewie Apr 27, 2026
64a8839
[IMP] awesome_dashboard: a new layout
djoewie Apr 27, 2026
a758675
[IMP] awesome_dashboard: Add some buttons for quick navigation
djoewie Apr 27, 2026
73580ef
[IMP] awesome_dashboard: add dashboard items
djoewie Apr 28, 2026
f8efc82
[IMP] awesome_dashboard: add statistics on dashboard
djoewie Apr 28, 2026
949c551
[IMP] awesome_dashboard: caching the results
djoewie Apr 28, 2026
2affcf3
[IMP] awesome_dashboard: add pie-chart
djoewie Apr 28, 2026
cf78101
[CLN] awesome_owl: code convention camelcase for refs
djoewie Apr 28, 2026
286bd29
[CLN] awesome_dashboard: coding convention
djoewie Apr 28, 2026
1f1e971
[FIX] awesome_dashboard: piechart need to be destroyed before creatin…
djoewie Apr 28, 2026
dc7faf0
[IMP] awesome_dashboard: real life update
djoewie Apr 28, 2026
f127f24
[IMP] awesome_dashboard: lazy loading of module
djoewie Apr 28, 2026
416de43
[IMP] awesome_dashboard: make dashboard generic
djoewie Apr 28, 2026
0ede26b
[CLN] awesome_dashboard: improve readability of pie_chart
djoewie Apr 28, 2026
8b8558a
[IMP] awesome_dashboard: use a registry for the dashboard items
djoewie Apr 29, 2026
6dfb3d4
[IMP] awesome_dashboard: make dashboard items hideable
djoewie Apr 29, 2026
61531ba
[IMP] awesome_dashboard: add dutch translations
djoewie Apr 29, 2026
0dc5636
[CLN] estate: add a webcontroller
djoewie May 5, 2026
483de30
[MOV] estate: dashboard in its own file
djoewie May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions awesome_owl/static/src/card/card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Component, useState } from "@odoo/owl";

export class Card extends Component {
static template = "awesome_owl.Card";
static props = {
'title': {type: String},
'slots': {type: Object, shape: {default: true}},
};

setup() {
this.state = useState({isOpen: true});
}

toggleOpen() {
this.state.isOpen = !this.state.isOpen;
}
}
13 changes: 13 additions & 0 deletions awesome_owl/static/src/card/card.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.Card">
<div class="card d-inline-block m-2" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title"><t t-out="props.title"/>
<button class="btn btn-primary" t-on-click="toggleOpen" type="button">Toggle</button></h5>
<p class="card-text" t-if="state.isOpen">
<t t-slot="default"/>
</p>
</div>
</div>
</t>
</templates>
19 changes: 19 additions & 0 deletions awesome_owl/static/src/counter/counter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, useState } from "@odoo/owl";

export class Counter extends Component {
static template = "awesome_owl.Counter";
static props = {
"onChange": {type: Function, optional: true}
};

setup() {
this.state = useState({value: 0});
}

increment() {
this.state.value++;
if (this.props.onChange) {
this.props.onChange();
}
}
}
8 changes: 8 additions & 0 deletions awesome_owl/static/src/counter/counter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.Counter">
<div class="m-1 p-1 border d-inline-block">
<span class="me-1">Counter: <t t-esc="state.value"/></span>
<button class="btn btn-primary active" t-on-click="increment" type="button">Increment</button>
</div>
</t>
</templates>
19 changes: 17 additions & 2 deletions awesome_owl/static/src/playground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
import { Component } from "@odoo/owl";
import { Component, markup, useState } from "@odoo/owl";
import { Counter } from "./counter/counter";
import { Card } from "./card/card";
import { TodoList } from "./todo/todo_list";

export class Playground extends Component {
static template = "awesome_owl.playground";
static template = "awesome_owl.Playground";
static components = {Counter, Card, TodoList};
static props = [];

setup() {
this.content1 = "<div class='text-primary'>some content</div>";
this.content2 = markup("<div class='text-primary'>some content</div>");
this.state = useState({sum: 0});
}

increment_total() {
this.state.sum++;
}
}
20 changes: 15 additions & 5 deletions awesome_owl/static/src/playground.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="awesome_owl.playground">
<t t-name="awesome_owl.Playground">
<div class="p-3">
hello world
<div>hello world</div>
<div>
<Counter onChange.bind="increment_total"/>
<Counter onChange.bind="increment_total"/>
<Counter/>
<span>the sum of the first two counters is: <t t-esc="state.sum"/></span>
</div>
<div>
<Card title="'card 1'"><Counter/></Card>
<Card title="'card 2'"><t t-out="content2"/></Card>
</div>
<div>
<TodoList/>
</div>
</div>
</t>

</templates>
29 changes: 29 additions & 0 deletions awesome_owl/static/src/todo/todo_item.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Component } from "@odoo/owl";

export class TodoItem extends Component {
static template = "awesome_owl.TodoItem";
static props = {
"todo": {
type: Object,
shape: {
id: Number,
description: String,
isCompleted: Boolean
}
},
"toggleState": {
type: Function
},
"removeTodo": {
type: Function
},
}

onChange(event) {
this.props.toggleState(this.props.todo.id);
}

onClickDelete(event) {
this.props.removeTodo(this.props.todo.id);
}
}
10 changes: 10 additions & 0 deletions awesome_owl/static/src/todo/todo_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.TodoItem">
<div t-att-class="{'text-muted': props.todo.isCompleted, 'text-decoration-line-through': props.todo.isCompleted}">
<input t-on-change="onChange" type="checkbox" t-att-checked="props.todo.isCompleted"/>
<t t-esc="props.todo.id"/>.
<t t-esc="props.todo.description"/>
<span class="fa fa-remove" t-on-click="onClickDelete"/>
</div>
</t>
</templates>
36 changes: 36 additions & 0 deletions awesome_owl/static/src/todo/todo_list.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { Component, useState } from "@odoo/owl";
import { TodoItem } from "./todo_item";
import { useAutofocus } from "../utils";

export class TodoList extends Component {
static template = "awesome_owl.TodoList";
static components = {TodoItem};
static props = [];

setup() {
this.todos = useState([]);
this.nextId = this.todos.length;
useAutofocus("add_todo_input");
}

addToDo(event) {
if (event.keyCode === 13 && event.target.value !== "") {
this.todos.push({id: this.nextId++, description: event.target.value, isCompleted: false});
event.target.value = "";
}
}

toggleStateOfTodo(id) {
const todo = this.todos.find((todo) => todo.id === id);
if (todo) {
todo.isCompleted = !todo.isCompleted;
}
}

deleteTodo(id) {
const index = this.todos.findIndex((todo) => todo.id === id);
if (index >= 0) {
this.todos.splice(index, 1);
}
}
}
10 changes: 10 additions & 0 deletions awesome_owl/static/src/todo/todo_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<templates xml:space="preserve">
<t t-name="awesome_owl.TodoList">
<div class="border d-inline-block p-2 m-2" style="width: 18rem;">
<input t-ref="add_todo_input" t-on-keyup="addToDo" placeholder="Add a todo"/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from what i see in Odoo, t-ref values are also camelCase rather than snake_case

<t t-foreach="todos" t-as="todo" t-key="todo.id">
<TodoItem todo="todo" toggleState.bind="toggleStateOfTodo" removeTodo.bind="deleteTodo"/>
</t>
</div>
</t>
</templates>
8 changes: 8 additions & 0 deletions awesome_owl/static/src/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { onMounted, useRef } from "@odoo/owl";

export function useAutofocus(named_ref) {
const ref = useRef(named_ref);
onMounted(() => {
ref.el.focus();
});
}