mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
preliminary support for home menu
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Widget } from "../core/widget";
|
||||
import { Env } from "../env";
|
||||
|
||||
const template = `
|
||||
<div class="o_content">
|
||||
<span>MAIN ACTION</span>
|
||||
<input/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
export class Action extends Widget<Env, {}> {
|
||||
name = "action";
|
||||
template = template;
|
||||
}
|
||||
@@ -3,8 +3,8 @@ import { Env, Menu } from "../env";
|
||||
|
||||
const template = `
|
||||
<div class="o_navbar">
|
||||
<span class="title">Odoo<t t-if="env.isMobile"> MOBILE</t></span>
|
||||
<ul>
|
||||
<a aria-label="Applications" class="o_title fa fa-th" href="#" title="Applications" accesskey="h" t-on-click="toggleHomeMenu"/>
|
||||
<ul t-if="!props.inMenu">
|
||||
<li t-foreach="env.menus" t-as="menu">
|
||||
<a t-att-href="getUrl(menu)">
|
||||
<t t-esc="menu.title"/>
|
||||
@@ -14,7 +14,12 @@ const template = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
export class Navbar extends Widget<Env, {}> {
|
||||
export interface Props {
|
||||
toggleHomeMenu: () => void;
|
||||
inMenu: boolean;
|
||||
}
|
||||
|
||||
export class Navbar extends Widget<Env, Props> {
|
||||
name = "navbar";
|
||||
template = template;
|
||||
|
||||
@@ -22,4 +27,9 @@ export class Navbar extends Widget<Env, {}> {
|
||||
const action_id = String(menu.actionID);
|
||||
return this.env.router.formatURL("", { action_id });
|
||||
}
|
||||
|
||||
toggleHomeMenu(ev: MouseEvent) {
|
||||
ev.preventDefault();
|
||||
this.props.toggleHomeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Widget } from "../core/widget";
|
||||
import { Env } from "../env";
|
||||
|
||||
const template = `
|
||||
<div class="o_home_menu">
|
||||
<span>HOME MENU</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
export class HomeMenu extends Widget<Env, {}> {
|
||||
name = "home";
|
||||
template = template;
|
||||
}
|
||||
Reference in New Issue
Block a user