release: promote beta to main (gyms, brand colours, JPEG XL, SEO per gym) #3

Merged
andre merged 74 commits from beta into main 2026-10-26 19:47:48 +00:00
4 changed files with 45 additions and 4 deletions
Showing only changes of commit 716eec9f6d - Show all commits

No files matched your search

+1 -1
View File
@@ -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 Since 2026-09-25, one install serves several physical gyms: the `gyms` table, one URL
folder per gym (`/3070/`, `/<postal-code>/`), content rows carry `gym_id`, and the folder per gym (`/3070/`, `/<postal-code>/`), content rows carry `gym_id`, and the
backoffice has an "a editar" gym switcher (`admin_gym_id()` / 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. An unpublished gym 404s publicly but previews for staff.
## platform-tools ## platform-tools
+23
View File
@@ -408,6 +408,29 @@ section[id] {
color: #fff !important; 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 ─────────────────────────────────────────────────────────── */ /* ── Sticky Navbar ─────────────────────────────────────────────────────────── */
.navbar-toggler { .navbar-toggler {
min-width: 44px; min-width: 44px;
+16
View File
@@ -47,6 +47,22 @@ $logo_dims = svg_img_dims_attr(dirname(__DIR__, 2) . '/' . $logo_rel);
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<?php
// Other published gyms: the main gym opens first, the rest are
// highlighted buttons at the right end of the bar.
$other_gyms = [];
if (!empty($GLOBALS['pdo'])) {
foreach (db_gyms_published($GLOBALS['pdo']) as $g) {
if ((int) $g['id'] !== (int) current_gym()['id']) $other_gyms[] = $g;
}
}
if ($other_gyms): ?>
<div class="gym-switch d-flex flex-wrap gap-2 ms-lg-auto py-2 py-lg-0 pe-lg-3">
<?php foreach ($other_gyms as $g): ?>
<a class="gym-switch-btn" href="<?= htmlspecialchars(gym_url($g)) ?>"><?= htmlspecialchars($g['name']) ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div> </div>
</nav> </nav>
</header> </header>
+5 -3
View File
@@ -5,13 +5,15 @@ $current_uri_2 = '';
// No gym in the URL (/, /home, old links): send people to a gym page. With a // 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. // 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'] ?? '') === '') { if (($_GET['gym'] ?? '') === '') {
require_once __DIR__ . '/../config/db.php'; require_once __DIR__ . '/../config/db.php';
require_once __DIR__ . '/../config/functions.php'; require_once __DIR__ . '/../config/functions.php';
$published = db_gyms_published($pdo); $published = db_gyms_published($pdo);
if (count($published) > 1) { require __DIR__ . '/gym_chooser.php'; exit; } $main = null;
$to = $published[0] ?? db_gyms_default($pdo) ?? gym_fallback(); 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'] ?? ''; $qs = $_SERVER['QUERY_STRING'] ?? '';
header('Location: ' . gym_url($to) . ($qs !== '' ? '?' . $qs : ''), true, 301); header('Location: ' . gym_url($to) . ($qs !== '' ? '?' . $qs : ''), true, 301);
exit; exit;