Renaming dashboard to home
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 57s
This commit is contained in:
@@ -203,13 +203,13 @@ function renderLoadingSkeleton(count, type = "card") {
|
|||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
const routes = {
|
const routes = {
|
||||||
"/": "dashboard",
|
"/": "home",
|
||||||
"/compare": "compare",
|
"/compare": "compare",
|
||||||
"/rankings": "rankings",
|
"/rankings": "rankings",
|
||||||
};
|
};
|
||||||
|
|
||||||
const pageTitles = {
|
const pageTitles = {
|
||||||
dashboard: "SchoolCompare | Compare Primary School Performance",
|
home: "SchoolCompare | Compare Primary School Performance",
|
||||||
compare: "Compare Schools | SchoolCompare",
|
compare: "Compare Schools | SchoolCompare",
|
||||||
rankings: "School Rankings | SchoolCompare",
|
rankings: "School Rankings | SchoolCompare",
|
||||||
};
|
};
|
||||||
@@ -222,10 +222,10 @@ function navigateTo(path) {
|
|||||||
|
|
||||||
function handleRoute() {
|
function handleRoute() {
|
||||||
const path = window.location.pathname;
|
const path = window.location.pathname;
|
||||||
const view = routes[path] || "dashboard";
|
const view = routes[path] || "home";
|
||||||
|
|
||||||
// Update page title for SEO
|
// Update page title for SEO
|
||||||
document.title = pageTitles[view] || pageTitles.dashboard;
|
document.title = pageTitles[view] || pageTitles.home;
|
||||||
|
|
||||||
// Update navigation
|
// Update navigation
|
||||||
document.querySelectorAll(".nav-link").forEach((link) => {
|
document.querySelectorAll(".nav-link").forEach((link) => {
|
||||||
@@ -280,7 +280,7 @@ async function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function populateFilters(data) {
|
function populateFilters(data) {
|
||||||
// Populate local authority filter (dashboard)
|
// Populate local authority filter (home page)
|
||||||
data.local_authorities.forEach((la) => {
|
data.local_authorities.forEach((la) => {
|
||||||
const option = document.createElement("option");
|
const option = document.createElement("option");
|
||||||
option.value = la;
|
option.value = la;
|
||||||
@@ -1171,7 +1171,7 @@ function setupEventListeners() {
|
|||||||
link.addEventListener("click", (e) => {
|
link.addEventListener("click", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const view = link.dataset.view;
|
const view = link.dataset.view;
|
||||||
const path = view === "dashboard" ? "/" : `/${view}`;
|
const path = view === "home" ? "/" : `/${view}`;
|
||||||
navigateTo(path);
|
navigateTo(path);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -80,7 +80,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<a href="/" class="nav-link active" data-view="dashboard">Dashboard</a>
|
<a href="/" class="nav-link active" data-view="home">Home</a>
|
||||||
<a href="/compare" class="nav-link" data-view="compare">Compare</a>
|
<a href="/compare" class="nav-link" data-view="compare">Compare</a>
|
||||||
<a href="/rankings" class="nav-link" data-view="rankings">Rankings</a>
|
<a href="/rankings" class="nav-link" data-view="rankings">Rankings</a>
|
||||||
</nav>
|
</nav>
|
||||||
@@ -88,8 +88,8 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="main">
|
<main class="main">
|
||||||
<!-- Dashboard View -->
|
<!-- Home View -->
|
||||||
<section id="dashboard-view" class="view active">
|
<section id="home-view" class="view active">
|
||||||
<div class="hero">
|
<div class="hero">
|
||||||
<h1 class="hero-title">Compare Primary School Performance</h1>
|
<h1 class="hero-title">Compare Primary School Performance</h1>
|
||||||
<p class="hero-subtitle">Search and compare KS2 results across England's primary schools</p>
|
<p class="hero-subtitle">Search and compare KS2 results across England's primary schools</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user