feat(backoffice,site): Sistema consistente com a frota; horário como acordeão
- Sidebar do backoffice: Backups/Auditoria/IP bans/Geo/Origem das visitas/ Atualizações deixam de ser um link cada (enumerados à mão) e passam a um só link "Sistema" para o índice partilhado do platform-tools (platform.php?tool=index), como a fotografia/design/dance já fazem — uma ferramenta nova no platform-tools passa a aparecer sozinha, sem link novo a escrever aqui. Definições, Mensagens e Comunicações continuam com link próprio (são páginas do fitme, não do router). - Horário de Aulas (home e CrossFit, mesmo componente partilhado): a grelha fica fechada por omissão atrás de um botão "Ver Horário das aulas" (Bootstrap collapse); clicar em "Horário" na navbar (ou abrir a página já com #horario no URL) abre-a de imediato em vez de só rolar até uma secção fechada. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5bbbd3b5f
commit
4222b8f2e0
4 files changed
+41
-29
No files matched your search
@@ -111,6 +111,7 @@ $logo_dims = svg_img_dims_attr(dirname(__DIR__, 2) . '/' . $logo_rel);
|
||||
sections.push({ link: link, target: target, id: url.hash });
|
||||
link.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
openHorarioIfNeeded(url.hash);
|
||||
smoothScrollTo(target, 600);
|
||||
history.pushState(null, null, url.hash);
|
||||
var navCollapse = document.getElementById('navbarSupportedContent');
|
||||
@@ -120,6 +121,19 @@ $logo_dims = svg_img_dims_attr(dirname(__DIR__, 2) . '/' . $logo_rel);
|
||||
});
|
||||
});
|
||||
|
||||
/* Horário de Aulas is a closed accordion (button "Ver Horário das aulas") —
|
||||
clicking the navbar link (or landing on #horario directly) should open
|
||||
it right away instead of scrolling to a section that still needs an
|
||||
extra click. */
|
||||
function openHorarioIfNeeded(hash) {
|
||||
if (hash !== '#horario') return;
|
||||
var el = document.getElementById('horarioCollapse');
|
||||
if (el && window.bootstrap) {
|
||||
bootstrap.Collapse.getOrCreateInstance(el, { toggle: false }).show();
|
||||
}
|
||||
}
|
||||
openHorarioIfNeeded(window.location.hash);
|
||||
|
||||
/* ── Scroll-spy: highlight current section ──────────────────────────── */
|
||||
// Measure each section against the viewport with getBoundingClientRect:
|
||||
// a link is "current" only while the line just below the navbar sits
|
||||
|
||||
Reference in new issue
Block a user