feat: vários ginásios (/3070/ e /<código postal>/), CRUD de ginásios, modalidades após a galeria
Estrutura multi-ginásio: as mesmas secções do site, conteúdo próprio por ginásio, e cada um numa pasta da URL com o código postal da zona. - migration_20260926_gyms: tabela gyms (pasta, nome, localidade, publicado, principal, secções visíveis, título/imagem do header, SEO, galeria, Place ID, página CrossFit) com o FitMe 3070 como ginásio 1 em /3070/; gym_id em team, modalidades (o horário segue a modalidade), work_hours, memberships, membership_leads e website_offer (tudo o existente → ginásio 1); events com gym_id NULL = todos; fitme3070_info passa a uma linha por ginásio (id = gym). - Site: /<pasta>/, /<pasta>/crossfit, /<pasta>/agendar|inscricao. Ginásio por publicar → 404 para o público, pré-visualização (com faixa) para a equipa. / e /home → 301 para o ginásio principal (a manter a query); com mais de um ginásio publicado, a raiz passa a uma página para escolher. Secções desligadas não aparecem nem no menu; menu, canonical, JSON-LD, sitemap, formulários, e-mails e reviews (Place ID e cache) são do ginásio. - Backoffice: Gestão → Ginásios (criar/editar/apagar, secções, e «começar com o conteúdo de» outro ginásio — cópias independentes) e o seletor «A editar» no topo; equipa, modalidades, horários, horário de funcionamento, mensalidades, pedidos, contactos e reviews trabalham sobre o ginásio escolhido, e um registo de outro ginásio não abre. - Modalidades passam para logo a seguir à galeria das instalações. - Galeria sem cantos arredondados (raio da marca). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f8f68c61a
commit
5e300fc341
33 files changed
+1146
-197
No files matched your search
@@ -21,7 +21,7 @@
|
||||
<?php endif; ?>
|
||||
<ul class="footer-menu">
|
||||
<?php foreach($navbar as $key => $n): ?>
|
||||
<li><a href="<?= base_url($n) ?>" <?= (isset($n[0]) && $n[0] === '#') ? 'class="smooth-scroll"' : '' ?>><?= $key ?></a></li>
|
||||
<li><a href="<?= htmlspecialchars($n) ?>" <?= str_contains($n, '#') ? 'class="smooth-scroll"' : '' ?>><?= $key ?></a></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<p class="small footer-legal">Este estabelecimento possui livro de reclamações online em <a href="https://www.livroreclamacoes.pt/Pedido/Reclamacao" target="_blank" rel="noopener">www.livroreclamacoes.pt</a></p>
|
||||
|
||||
@@ -10,10 +10,25 @@ $page_meta = [
|
||||
'privacidade' => ['Política de Privacidade | FitMe 3070',
|
||||
'Política de privacidade do FitMe 3070 — como recolhemos, usamos e protegemos os teus dados pessoais.'],
|
||||
];
|
||||
// The gym's homepage uses the gym's own SEO title/description when set
|
||||
// (Gestão → Ginásios); a new gym without them gets a generic one from its name
|
||||
// and locality rather than the 3070 texts above.
|
||||
$gym_meta = current_gym();
|
||||
if ($page === '' && ($gym_meta['seo_title'] ?? '') !== '') {
|
||||
$page_meta[''] = [$gym_meta['seo_title'], ($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : $page_meta[''][1]];
|
||||
} elseif ($page === '' && (int) $gym_meta['id'] !== 1) {
|
||||
$loc = ($gym_meta['locality'] ?? '') !== '' ? ' em ' . $gym_meta['locality'] : '';
|
||||
$page_meta[''] = [$gym_meta['name'] . ' — Ginásio' . $loc,
|
||||
($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : 'Ginásio ' . $gym_meta['name'] . $loc . ': treino, aulas de grupo e acompanhamento.'];
|
||||
}
|
||||
// A dynamic page (e.g. an event landing page) can set its own title/description
|
||||
// and canonical via these globals before requiring _open.php.
|
||||
[$page_title, $page_desc] = $GLOBALS['_page_meta_override'] ?? $page_meta[$page] ?? $page_meta[''];
|
||||
$canonical = $GLOBALS['_canonical_override'] ?? base_url($page !== '' ? 'home/' . $page : '');
|
||||
$canonical = $GLOBALS['_canonical_override'] ?? match ($page) {
|
||||
'' => gym_url($gym_meta),
|
||||
'crossfit' => gym_url($gym_meta, 'crossfit'),
|
||||
default => base_url('home/' . $page),
|
||||
};
|
||||
?><!doctype html>
|
||||
<html lang="pt">
|
||||
<head>
|
||||
@@ -34,7 +49,7 @@ $canonical = $GLOBALS['_canonical_override'] ?? base_url($page !== '' ? 'home/'
|
||||
<link rel="dns-prefetch" href="https://forms.zohopublic.eu">
|
||||
<?php if (($current_uri_2 ?? '') === ''): ?>
|
||||
<!-- Homepage hero is the LCP image — start fetching it before the CSS/JS -->
|
||||
<link rel="preload" as="image" href="<?= base_url('site/assets/img/home.jpg') ?>">
|
||||
<link rel="preload" as="image" href="<?= base_url(($gym_meta['hero_image'] ?? '') !== '' ? $gym_meta['hero_image'] : 'site/assets/img/home.jpg') ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Fonts -->
|
||||
|
||||
@@ -9,18 +9,20 @@ else
|
||||
?>
|
||||
<header class="header-section lazy">
|
||||
<nav class="navbar navbar-expand-lg navbar-light" style="padding-left:1rem; padding-top: 0; padding-bottom: 0;padding-right: 0; ">
|
||||
<a class="navbar-brand" href="<?= base_url('home') ?>">
|
||||
<a class="navbar-brand" href="<?= htmlspecialchars(gym_url(current_gym())) ?>">
|
||||
<img loading="eager" alt="Logo FitMe3070" src="<?= $logo ?>" style="width: 150px;">
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mx-auto ">
|
||||
<?php foreach($navbar as $key => $n):
|
||||
// $n is an absolute URL on the gym's own page (site_navbar()).
|
||||
$is_crossfit = ($key === 'CrossFit');
|
||||
$is_anchor = str_contains($n, '#');
|
||||
$is_active = false;
|
||||
if ($is_crossfit) {
|
||||
$is_active = ($current_uri_2 === 'crossfit');
|
||||
} elseif ($n === '#home') {
|
||||
} elseif (str_ends_with($n, '#home')) {
|
||||
// Only the Home link is active by default on the homepage
|
||||
$is_active = ($current_uri_2 === '');
|
||||
}
|
||||
@@ -28,16 +30,15 @@ else
|
||||
?>
|
||||
<li class="nav-item <?= $is_active ? 'active' : '' ?> main-menu-li" >
|
||||
<?php if ($is_crossfit): ?>
|
||||
<a class="nav-link crossfit-nav-link" href="<?= base_url($n) ?>"<?= $is_active ? ' aria-current="page"' : '' ?>>
|
||||
<a class="nav-link crossfit-nav-link" href="<?= htmlspecialchars($n) ?>"<?= $is_active ? ' aria-current="page"' : '' ?>>
|
||||
<?= $key ?>
|
||||
</a>
|
||||
<?php elseif (isset($n[0]) && $n[0] === '#'): ?>
|
||||
<?php $href = ($current_uri_2 === 'crossfit') ? base_url('home' . $n) : base_url($n); ?>
|
||||
<a class="nav-link smooth-scroll" href="<?= $href ?>"<?= $is_active ? ' aria-current="page"' : '' ?>>
|
||||
<?php elseif ($is_anchor): ?>
|
||||
<a class="nav-link smooth-scroll" href="<?= htmlspecialchars($n) ?>"<?= $is_active ? ' aria-current="page"' : '' ?>>
|
||||
<?= $key ?>
|
||||
</a>
|
||||
<?php else: ?>
|
||||
<a class="nav-link" href="<?= base_url($n) ?>">
|
||||
<a class="nav-link" href="<?= htmlspecialchars($n) ?>">
|
||||
<?= $key ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
// JSON-LD structured data for the gym (rendered inside <head> by include.php).
|
||||
// Built from fitme3070_info + work_hours so admin edits stay in sync.
|
||||
$ld_gym = current_gym();
|
||||
$ld = [
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'ExerciseGym',
|
||||
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070',
|
||||
'url' => base_url(),
|
||||
'image' => base_url('site/assets/img/home.jpg'),
|
||||
'name' => $ld_gym['name'] !== '' ? $ld_gym['name'] : (($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070'),
|
||||
'url' => gym_url($ld_gym),
|
||||
'image' => base_url(($ld_gym['hero_image'] ?? '') !== '' ? $ld_gym['hero_image'] : 'site/assets/img/home.jpg'),
|
||||
'logo' => base_url('site/assets/img/logos/logo_black.svg'),
|
||||
];
|
||||
if (!empty($info['phone'])) $ld['telephone'] = site_tel($info['phone']);
|
||||
@@ -15,7 +16,7 @@ if (!empty($info['adress'])) {
|
||||
$ld['address'] = [
|
||||
'@type' => 'PostalAddress',
|
||||
'streetAddress' => $info['adress'],
|
||||
'addressLocality' => 'Mira',
|
||||
'addressLocality' => ($ld_gym['locality'] ?? '') !== '' ? $ld_gym['locality'] : 'Mira',
|
||||
'addressCountry' => 'PT',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user