The website module injects a fixed "frontend->backend" nav (.o_frontend_to_backend_nav — the floating apps-grid/edit button) on every frontend page for any internal user. Since the kiosk account is an internal user, that button let a kiosk user tap through to the Odoo backend. Hide it with a page-scoped inline style in the kiosk template head, so it's suppressed only on /fusion_clock/kiosk/nfc and the real website keeps its nav. Live as 19.0.3.11.8 (verified the rule is in the rendered template). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
70 lines
4.0 KiB
XML
70 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<template id="nfc_kiosk_page" name="NFC Clock Kiosk">
|
|
<t t-call="web.frontend_layout">
|
|
<t t-set="no_header" t-value="True"/>
|
|
<t t-set="no_footer" t-value="True"/>
|
|
<t t-set="head">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
|
|
<!-- Installable full-screen kiosk app (Chrome "Install" / Safari "Add to Home Screen") -->
|
|
<link rel="manifest" href="/fusion_clock/kiosk/nfc/manifest.webmanifest"/>
|
|
<meta name="mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-capable" content="yes"/>
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
|
|
<meta name="apple-mobile-web-app-title" content="Fusion Clock Kiosk"/>
|
|
<link rel="apple-touch-icon" href="/fusion_clock/static/description/icon.png"/>
|
|
<!-- Kiosk lockdown: hide Odoo's frontend->backend nav (the floating
|
|
"Go to your Odoo Apps" / edit button the website module injects for
|
|
logged-in internal users) so a kiosk user can't reach the backend.
|
|
Page-scoped here so the real website keeps its nav. -->
|
|
<style>.o_frontend_to_backend_nav { display: none !important; }</style>
|
|
</t>
|
|
|
|
<div id="nfc_kiosk_root" class="nfc-kiosk"
|
|
t-att-data-photo-required="'1' if photo_required else '0'"
|
|
t-att-data-debug-enabled="'1' if debug_enabled else '0'"
|
|
t-att-data-location-configured="'1' if location_configured else '0'"
|
|
t-att-data-sounds-enabled="'1' if sounds_enabled else '0'"
|
|
t-att-data-company-logo-url="company_logo_url or ''">
|
|
|
|
<!-- Company logo (also drives the dominant-hue palette via JS) -->
|
|
<img t-if="company_logo_url"
|
|
class="nfc-kiosk__logo"
|
|
id="nfc_company_logo"
|
|
t-att-src="company_logo_url"
|
|
crossorigin="anonymous"
|
|
alt="Company logo"/>
|
|
|
|
<!-- Static chrome (always visible) -->
|
|
<div class="nfc-kiosk__company" t-esc="company_name"/>
|
|
<div class="nfc-kiosk__time" id="nfc_clock_time">--:--</div>
|
|
<div class="nfc-kiosk__date" id="nfc_clock_date">—</div>
|
|
<div class="nfc-kiosk__location">
|
|
<span t-if="location_configured">Clock at: <t t-esc="location_name"/></span>
|
|
<span t-else="" style="color:#d9374e">⚠ No location configured</span>
|
|
</div>
|
|
<button class="nfc-kiosk__lock" id="nfc_lock_btn" title="Lock screen">🔒</button>
|
|
<button class="nfc-kiosk__lock" id="nfc_unlock_btn" title="Unlock (manager PIN)">🔓</button>
|
|
<button class="nfc-kiosk__settings" id="nfc_settings_btn" title="Enroll Mode">⚙</button>
|
|
|
|
<!-- Dynamic state container (JS swaps inner HTML based on state) -->
|
|
<div id="nfc_state_container">
|
|
<!-- Initial: One-time setup wizard -->
|
|
<div class="nfc-kiosk__setup">
|
|
<h2>Welcome to Fusion Clock NFC Kiosk</h2>
|
|
<p>Tap the button below to enable the NFC reader and camera. This is a one-time setup for this device.</p>
|
|
<button id="nfc_setup_start">Tap to enable NFC reader</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Hidden video + canvas for camera capture -->
|
|
<video id="nfc_camera_feed" autoplay="autoplay" playsinline="playsinline" muted="muted"
|
|
style="position:absolute; width:1px; height:1px; opacity:0; pointer-events:none;"/>
|
|
<canvas id="nfc_camera_canvas" style="display:none;"/>
|
|
</div>
|
|
</t>
|
|
</template>
|
|
|
|
</odoo>
|