mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
24 lines
604 B
TypeScript
24 lines
604 B
TypeScript
import Widget from "../../../src/core/Widget";
|
|
import { Action } from "../services/actions";
|
|
|
|
const template = `
|
|
<div class="o_navbar">
|
|
<span class="title">Odoo</span>
|
|
<ul>
|
|
<li t-foreach="env.services.actions" t-as="action">
|
|
<a t-att-href="getUrl(action)"><t t-esc="action.title"/></a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
`;
|
|
|
|
export default class Navbar extends Widget {
|
|
name = "navbar";
|
|
template = template;
|
|
|
|
getUrl(action: Action) {
|
|
const action_id = action.id;
|
|
return this.env.services.router.formatURL("web", { action_id });
|
|
}
|
|
}
|