diff --git a/CLAUDE.md b/CLAUDE.md index 752cbf7..749ae69 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -78,7 +78,7 @@ Sistema → Auditoria (`platform.php?tool=audit`). Since 2026-09-25, one install serves several physical gyms: the `gyms` table, one URL folder per gym (`/3070/`, `//`), content rows carry `gym_id`, and the backoffice has an "a editar" gym switcher (`admin_gym_id()` / -`admin_gym()` in `config/functions_gyms.php`). `/` and `/home` 301 to the default gym. +`admin_gym()` in `config/functions_gyms.php`). `/` and `/home` 301 to the default gym (`is_default`); the other published gyms appear as highlighted buttons (`.gym-switch-btn`) at the right end of the public navbar (`site/includes/navbar.php`). `site/gym_chooser.php` is no longer used. An unpublished gym 404s publicly but previews for staff. ## platform-tools diff --git a/site/assets/css/style.css b/site/assets/css/style.css index 2d06d44..fdc1aa9 100644 --- a/site/assets/css/style.css +++ b/site/assets/css/style.css @@ -408,6 +408,29 @@ section[id] { color: #fff !important; } +/* ── Other-gym button (right end of the navbar) ────────────────────────────── */ +.gym-switch-btn { + display: inline-block; + background: var(--fitme-accent); + color: var(--fitme-dark); + font-weight: 700; + text-transform: uppercase; + letter-spacing: .5px; + text-decoration: none; + white-space: nowrap; + border: 2px solid var(--fitme-accent); + border-radius: var(--fitme-radius); + padding: 6px 16px; + transition: background-color var(--fitme-transition), color var(--fitme-transition); +} + +.gym-switch-btn:hover, +.gym-switch-btn:focus-visible { + background: var(--fitme-dark); + border-color: var(--fitme-dark); + color: var(--fitme-accent); +} + /* ── Sticky Navbar ─────────────────────────────────────────────────────────── */ .navbar-toggler { min-width: 44px; diff --git a/site/includes/navbar.php b/site/includes/navbar.php index 8b2ef63..0d72446 100644 --- a/site/includes/navbar.php +++ b/site/includes/navbar.php @@ -47,6 +47,22 @@ $logo_dims = svg_img_dims_attr(dirname(__DIR__, 2) . '/' . $logo_rel); + +
+ + + +
+ diff --git a/site/index.php b/site/index.php index 0373665..0ef7a03 100644 --- a/site/index.php +++ b/site/index.php @@ -5,13 +5,15 @@ $current_uri_2 = ''; // No gym in the URL (/, /home, old links): send people to a gym page. With a // single published gym that is a 301 to it (query string kept, e.g. -// ?agendar=ok); with more, the gym chooser. +// ?agendar=ok); with more, the main (default) gym — the others are reached +// from the navbar's «Ginásios» menu. if (($_GET['gym'] ?? '') === '') { require_once __DIR__ . '/../config/db.php'; require_once __DIR__ . '/../config/functions.php'; $published = db_gyms_published($pdo); - if (count($published) > 1) { require __DIR__ . '/gym_chooser.php'; exit; } - $to = $published[0] ?? db_gyms_default($pdo) ?? gym_fallback(); + $main = null; + foreach ($published as $g) { if ((int) ($g['is_default'] ?? 0) === 1) { $main = $g; break; } } + $to = $main ?? $published[0] ?? db_gyms_default($pdo) ?? gym_fallback(); $qs = $_SERVER['QUERY_STRING'] ?? ''; header('Location: ' . gym_url($to) . ($qs !== '' ? '?' . $qs : ''), true, 301); exit;