Files
owl/demo/src/widgets/Navbar.ts
T
2019-01-22 14:46:02 +01:00

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 });
}
}