Files
BEYOND/addons/beyond_base/static/src/webclient/beyond_launcher.xml
T

243 lines
15 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<!--
C-005/C-006 · Beyond launcher v4 (ADR-005).
Still an extension of the native apps menu, not a new screen: the grid
button becomes a house and the dropdown is forced full screen from the
stylesheet. Navigation stays native (DropdownItem, onSelected,
getMenuItemHref, data-menu-xmlid), so hotkeys, keyboard navigation and
group filtering are untouched.
v4 is the signed-off "Menú Principal v4": a header of house + rule, two
rows of glass blocks, a master row of two small buttons, and the
signature at the foot. Blocks are written out one by one rather than
looped because each carries its own inline SVG and its own colour.
THE MAP — seven apps, and only seven:
Fila 1 Venta point_of_sale.menu_point_root
Panel General beyond_branch.menu_beyond_root
QR beyond_attendance_qr.menu_kiosco_app
Fila 2 Inventario stock.menu_stock_root
Tableros spreadsheet_dashboard.…_menu_root
Maestro Contactos contacts.menu_contacts
Empleados hr.menu_hr_root
What is not a door here lives inside Panel General (Sucursales,
Clientes, Catálogo, Precios por sucursal, Captura, Personal, Checador).
WHAT v4 REMOVED, and it matters: v3 ended in a catch-all strip that
rendered every installed app the launcher had not mapped, so the
technical account (base.group_system) could still reach Facturación,
Ajustes, Aplicaciones y Asistencias from here. v4 replaces that strip
with the two curated master buttons, so those four now have no door on
this screen and are reachable only by URL (/odoo/settings, /odoo/apps).
Deliberate; see the note in beyond_launcher.scss.
Conversaciones (mail.menu_root_discuss) is not mapped and must not be:
it sits behind base.group_no_one by data/menu_cleanup.xml (C-001) and
only exists in developer mode.
Apps are matched by xmlid string, never imported: a module that is not
installed simply never matches (no hard dependency).
-->
<t t-name="beyond_base.NavBar.AppsMenu"
t-inherit="web.NavBar.AppsMenu"
t-inherit-mode="extension">
<!-- La misma casa del encabezado del lanzador, no un icono de fuente
parecido: son la misma cosa y ahora salen del mismo sitio. -->
<xpath expr="//button[@data-hotkey='h']/i" position="replace">
<t t-call="beyond_base.CasaBeyond"/>
</xpath>
<!-- The launcher is the home screen: WebClient._loadDefaultApp opens
it through this state (beyond_launcher.js). -->
<xpath expr="//Dropdown" position="attributes">
<attribute name="state">beyondLauncher</attribute>
</xpath>
<!-- The ref lets the patch put focus where a click on the house would
leave it, so the arrow keys drive the launcher and not the app
that loads behind it. -->
<xpath expr="//button[@data-hotkey='h']" position="attributes">
<attribute name="t-ref">beyondLauncherToggle</attribute>
</xpath>
<xpath expr="//DropdownItem[@t-foreach='apps']" position="replace">
<div class="beyond_launcher_header">
<t t-set="tamanoCasa" t-value="38"/>
<t t-call="beyond_base.CasaBeyond"/>
<span class="beyond_launcher_rule"/>
</div>
<!-- Row 1. A block whose app is hidden for this role simply does
not render and the remaining ones spread out on their own. -->
<div class="beyond_launcher_band beyond_launcher_row1">
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'point_of_sale.menu_point_root'"
class="{ 'o_app': true, 'beyond_block': true, 'beyond_block_venta': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<path d="M11 16h26l3.2 25.3A3.5 3.5 0 0 1 36.7 45H11.3a3.5 3.5 0 0 1-3.5-3.7L11 16Z" fill="#0E6B57"/>
<path d="M11 16h13v29H11.3a3.5 3.5 0 0 1-3.5-3.7L11 16Z" fill="#0E6B57" fill-opacity="0.55"/>
<path d="M16.5 16a7.5 7.5 0 0 1 15 0" stroke="#FFFFFF" stroke-width="4.5" fill="none" stroke-linecap="round"/>
</svg>
<span class="beyond_block_name">Venta</span>
</DropdownItem>
</t>
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'beyond_branch.menu_beyond_root'"
class="{ 'o_app': true, 'beyond_block': true, 'beyond_block_panel': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<rect x="4" y="8" width="40" height="32" rx="5" fill="#C55A22"/>
<rect x="9" y="20" width="13" height="15" rx="2.5" fill="#FFFFFF"/>
<rect x="26" y="20" width="13" height="7" rx="2.5" fill="#FFFFFF" fill-opacity="0.7"/>
<rect x="26" y="30" width="13" height="5" rx="2.5" fill="#FFFFFF" fill-opacity="0.7"/>
<rect x="9" y="13" width="30" height="3.5" rx="1.75" fill="#FFFFFF" fill-opacity="0.55"/>
</svg>
<!-- El único bloque que NO escribe su etiqueta: esta
app es nuestra y su menú ya se llama "Panel
General" (beyond_branch_views.xml). Los otros
seis sí la escriben, a propósito: ahí el
lanzador SOBRESCRIBE el nombre real de una app
del core ("Venta" por "Punto de venta", "QR" por
el nombre largo del checador). -->
<span class="beyond_block_name" t-esc="app.name"/>
</DropdownItem>
</t>
<t t-foreach="apps" t-as="app" t-key="app.id">
<!-- closingMode none: this app answers in place (a dialog
or a new tab), so the launcher has to stay up behind
it. Every other block navigates and closes as usual. -->
<DropdownItem
t-if="app.xmlid === 'beyond_attendance_qr.menu_kiosco_app'"
class="{ 'o_app': true, 'beyond_block': true, 'beyond_block_qr': true }"
closingMode="'none'"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<rect x="6" y="4" width="36" height="27" rx="4" fill="#8C4A72"/>
<rect x="21" y="31" width="6" height="8" fill="#8C4A72" fill-opacity="0.55"/>
<rect x="13" y="39" width="22" height="5" rx="2.5" fill="#8C4A72" fill-opacity="0.55"/>
<circle cx="24" cy="17.5" r="4.5" fill="#FFFFFF"/>
<path d="M31.5 10a10.5 10.5 0 0 1 0 15" stroke="#FFFFFF" stroke-width="3" fill="none" stroke-linecap="round"/>
<path d="M16.5 10a10.5 10.5 0 0 0 0 15" stroke="#FFFFFF" stroke-width="3" fill="none" stroke-linecap="round"/>
</svg>
<span class="beyond_block_name">QR</span>
</DropdownItem>
</t>
</div>
<!-- Row 2. The two half-width spacers are what centre it and what
make its blocks the same size as the three above: 0.5 + 1 + 1
+ 0.5 is the same three parts row 1 splits. -->
<div class="beyond_launcher_band beyond_launcher_row2">
<span class="beyond_launcher_spacer"/>
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'stock.menu_stock_root'"
class="{ 'o_app': true, 'beyond_block': true, 'beyond_block_inventario': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<path d="M24 5l18 9v20l-18 9-18-9V14l18-9Z" fill="#3D6A8A"/>
<path d="M6 14l18 9v20L6 34V14Z" fill="#3D6A8A" fill-opacity="0.55"/>
<path d="M6 14l18 9 18-9" stroke="#FFFFFF" stroke-width="2.5"/>
</svg>
<span class="beyond_block_name">Inventario</span>
</DropdownItem>
</t>
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'spreadsheet_dashboard.spreadsheet_dashboard_menu_root'"
class="{ 'o_app': true, 'beyond_block': true, 'beyond_block_tableros': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<rect x="6" y="27" width="9" height="15" rx="2" fill="#C69B3A" fill-opacity="0.45"/>
<rect x="19" y="17" width="9" height="25" rx="2" fill="#C69B3A" fill-opacity="0.7"/>
<rect x="32" y="7" width="9" height="35" rx="2" fill="#C69B3A"/>
</svg>
<span class="beyond_block_name">Tableros</span>
</DropdownItem>
</t>
<span class="beyond_launcher_spacer"/>
</div>
<!-- Master row. Two curated buttons, both behind base.group_system,
so for every Beyond role this renders empty and the stylesheet
collapses it. -->
<div class="beyond_launcher_master">
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'contacts.menu_contacts'"
class="{ 'o_app': true, 'beyond_mbtn': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<rect x="7" y="6" width="34" height="36" rx="5" fill="#23201D"/>
<rect x="16" y="6" width="2" height="36" fill="#F6F5F1" fill-opacity="0.35"/>
<circle cx="29" cy="20" r="5.5" fill="#F6F5F1"/>
<path d="M19 35c1.6-4.8 5.2-7.2 10-7.2S37.4 30.2 39 35H19Z" fill="#F6F5F1"/>
</svg>
<span class="beyond_mbtn_name">Contactos</span>
</DropdownItem>
</t>
<t t-foreach="apps" t-as="app" t-key="app.id">
<DropdownItem
t-if="app.xmlid === 'hr.menu_hr_root'"
class="{ 'o_app': true, 'beyond_mbtn': true }"
onSelected="() => this.onNavBarDropdownItemSelection(app)"
attrs="{ href: getMenuItemHref(app), 'data-menu-xmlid': app.xmlid, 'data-section': app.id }"
>
<svg viewBox="0 0 48 48" fill="none" aria-hidden="true">
<circle cx="24" cy="16" r="7.5" fill="#23201D"/>
<path d="M9 41c1.7-8 7.6-12.2 15-12.2S37.3 33 39 41H9Z" fill="#23201D"/>
<circle cx="10" cy="20" r="4.8" fill="#23201D" fill-opacity="0.45"/>
<path d="M1 38c.9-5 4.4-7.7 9.4-7.7V38H1Z" fill="#23201D" fill-opacity="0.45"/>
<circle cx="38" cy="20" r="4.8" fill="#23201D" fill-opacity="0.45"/>
<path d="M47 38c-.9-5-4.4-7.7-9.4-7.7V38H47Z" fill="#23201D" fill-opacity="0.45"/>
</svg>
<span class="beyond_mbtn_name">Empleados</span>
</DropdownItem>
</t>
</div>
<!--
Cerrar sesión, al pie y a la izquierda de la firma.
Aquí y no en el menú de usuario de Odoo porque ese menú no
es una puerta de este lanzador: quien opera desde una tablet
de mostrador ve esta pantalla y nada más, y cerrar sesión es
justo lo que hace al terminar su turno. Es un `<a>` con href
real —no un botón con JavaScript— para que funcione igual si
los assets fallan, que es cuando más falta hace poder salir.
-->
<div class="beyond_launcher_brand">
<a class="beyond_launcher_salir" href="/web/session/logout"
t-on-click="cerrarSesion">
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
<path d="M15 4h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-3"
stroke="currentColor" stroke-width="2"
stroke-linecap="round"/>
<path d="M10 8l-4 4 4 4M6 12h9" stroke="currentColor"
stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"/>
</svg>
<span>Cerrar sesión</span>
</a>
<span>Powered by Collina Systems</span>
</div>
</xpath>
</t>
</templates>