feat: nano-style footer bar, missing utility classes, CSS semantic vars
- layout_footer.php: add lt-footer with context-sensitive keyboard hint bar
([ ~ ] HOME | [ / ] SEARCH | [ + ] NEW | [ * ] CFG | [ ? ] HELP)
Context adapts for dashboard, ticket, and admin pages
- layout_footer.php: wire show-keyboard-help and open-settings for all pages
- base.css: body { display:flex; flex-direction:column } + lt-main { flex:1 }
so footer sticks to bottom of viewport on short pages
- base.css: add lt-flex-gap-xs/sm/md/lg and lt-flex-align-start/center/end
(were used across all views but never defined — causing broken layouts)
- base.css: add --lt-danger/amber/cyan/success/text-primary CSS variables
(referenced in ticket.css and dashboard.css fallbacks but never declared)
- base.css: add lt-text-danger/warning/success/info/primary utility classes
(used in TicketView, DashboardView, admin views but not defined in base.css)
- DashboardView.php: remove ascii-banner.js (loaded but never called)
- TemplatesView.php: fix priority badge from lt-p* to lt-chip component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+61
-2
@@ -18,6 +18,43 @@
|
||||
|
||||
</main><!-- /#main-content / .lt-main -->
|
||||
|
||||
<!-- ================================================================
|
||||
FOOTER — keyboard hint bar + version
|
||||
================================================================ -->
|
||||
<?php
|
||||
// Context-sensitive keyboard hints based on active nav
|
||||
$_ltf_nav = $activeNav ?? 'dashboard';
|
||||
$_ltf_isTicket = str_starts_with($pageTitle ?? '', 'Ticket #');
|
||||
?>
|
||||
<footer class="lt-footer" role="contentinfo" aria-label="Keyboard shortcuts and app info">
|
||||
<nav class="lt-footer-hints" aria-label="Keyboard shortcuts">
|
||||
<?php if ($_ltf_isTicket): ?>
|
||||
<a href="/" class="lt-footer-hint" title="Go to dashboard"><span class="lt-footer-key">[ ← ]</span> BACK</a>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<span class="lt-footer-hint" title="Press 1–4 to change status"><span class="lt-footer-key">[ 1-4 ]</span> STATUS</span>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<span class="lt-footer-hint" title="Press C to jump to comment box"><span class="lt-footer-key">[ C ]</span> COMMENT</span>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<button type="button" class="lt-footer-hint" data-action="open-settings" title="Open settings"><span class="lt-footer-key">[ * ]</span> CFG</button>
|
||||
<?php elseif (str_starts_with($_ltf_nav, 'admin')): ?>
|
||||
<a href="/" class="lt-footer-hint" title="Go to dashboard"><span class="lt-footer-key">[ ~ ]</span> HOME</a>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<button type="button" class="lt-footer-hint" data-action="open-settings" title="Open settings"><span class="lt-footer-key">[ * ]</span> CFG</button>
|
||||
<?php else: ?>
|
||||
<a href="/" class="lt-footer-hint" title="Go to dashboard (G then D)"><span class="lt-footer-key">[ ~ ]</span> HOME</a>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<span class="lt-footer-hint" title="Press / or Ctrl+K to search"><span class="lt-footer-key">[ / ]</span> SEARCH</span>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<a href="/ticket/create" class="lt-footer-hint" title="Create new ticket (N)"><span class="lt-footer-key">[ + ]</span> NEW</a>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<button type="button" class="lt-footer-hint" data-action="open-settings" title="Open settings"><span class="lt-footer-key">[ * ]</span> CFG</button>
|
||||
<?php endif ?>
|
||||
<span class="lt-footer-sep">|</span>
|
||||
<button type="button" class="lt-footer-hint" data-action="show-keyboard-help" title="Show keyboard shortcuts (?)"><span class="lt-footer-key">[ ? ]</span> HELP</button>
|
||||
</nav>
|
||||
<span aria-label="Application version">TINKER TICKETS — TDS v1.2</span>
|
||||
</footer>
|
||||
|
||||
<!-- base.js + utils.js + globals already loaded in <head> via layout_header.php -->
|
||||
|
||||
<?php if (!empty($pageScripts)): ?>
|
||||
@@ -34,11 +71,33 @@
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- LT INIT — runs boot animation once per session, then sets up UI handlers -->
|
||||
<!-- LT INIT — boot animation + global UI init (base.js handles keys/nav automatically) -->
|
||||
<script nonce="<?= htmlspecialchars($nonce, ENT_QUOTES, 'UTF-8') ?>">
|
||||
if (window.lt) {
|
||||
lt.init({ bootName: 'TINKER TICKETS', skipBoot: false });
|
||||
lt.init({ bootName: 'TINKER TICKETS' });
|
||||
}
|
||||
|
||||
// Footer hint bar actions (keyboard help + settings — work on all pages)
|
||||
document.addEventListener('click', function(e) {
|
||||
var btn = e.target.closest('[data-action]');
|
||||
if (!btn) return;
|
||||
var action = btn.getAttribute('data-action');
|
||||
if (action === 'show-keyboard-help') {
|
||||
if (typeof showKeyboardHelp === 'function') {
|
||||
showKeyboardHelp();
|
||||
} else if (window.lt) {
|
||||
var h = document.getElementById('lt-keys-help');
|
||||
if (h) lt.modal.open('lt-keys-help');
|
||||
else lt.toast.info('Keyboard shortcuts: ESC=close Ctrl+K=search ?=this help');
|
||||
}
|
||||
} else if (action === 'open-settings' || action === 'open-settings-modal') {
|
||||
if (typeof openSettingsModal === 'function') {
|
||||
openSettingsModal();
|
||||
} else if (window.lt) {
|
||||
lt.toast.info('Settings available on the Dashboard');
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user