From 52547fde8edce576e7e44bd036ddd9bd3a2f8672 Mon Sep 17 00:00:00 2001 From: AshwaSC Date: Fri, 31 Jul 2026 17:53:25 +0530 Subject: [PATCH] feat: roll out Bengaluru-style data previews to the other 11 city hubs Follow-up to the Chennai hub (PR #15). Apply the same hub-grid preview layout to the remaining coming-soon hubs so they surface real data: - ahmedabad, bhubaneswar, gurugram, hyderabad, jaipur, kochi, kolkata, pune, thane, visakhapatnam: replace the Map/Communities/Stories nav-card grid + "Coming Soon" callout with the shared hub-grid (Communities preview, Stories preview, Map preview). Link the shared city-hub.css. - mumbai: same, plus a Climate section (Energy + Waste sector cards linking to its existing live /cities/mumbai/climate/ dashboards), so its built climate access is preserved in the new layout. city-hub.js: drop the now-dead data-feature="stories" card-flip path (no hub uses feature cards anymore) and hide each Stories "Read all" link when the city has no stories, so cities without a /stories/ page can't 404. Verified in headless Chrome vs live Supabase: - Pune: its 1 real community now shows in the Communities preview (stat 1). - Mumbai: Climate section renders; communities/stories empty states. - Kochi: empty states; Stories "Read all" hidden (display:none). All map previews render each city's SVG. No new i18n keys. Co-Authored-By: Claude Opus 4.8 (1M context) --- website/public/assets/js/pages/city-hub.js | 40 +---- website/public/cities/ahmedabad/index.html | 105 +++---------- website/public/cities/bhubaneswar/index.html | 105 +++---------- website/public/cities/gurugram/index.html | 105 +++---------- website/public/cities/hyderabad/index.html | 105 +++---------- website/public/cities/jaipur/index.html | 105 +++---------- website/public/cities/kochi/index.html | 105 +++---------- website/public/cities/kolkata/index.html | 105 +++---------- website/public/cities/mumbai/index.html | 144 ++++++------------ website/public/cities/pune/index.html | 105 +++---------- website/public/cities/thane/index.html | 105 +++---------- .../public/cities/visakhapatnam/index.html | 105 +++---------- 12 files changed, 291 insertions(+), 943 deletions(-) diff --git a/website/public/assets/js/pages/city-hub.js b/website/public/assets/js/pages/city-hub.js index ab714a36..c388a6f8 100644 --- a/website/public/assets/js/pages/city-hub.js +++ b/website/public/assets/js/pages/city-hub.js @@ -65,40 +65,14 @@ '' + esc(s.community || s.location || '') + '' ).join('') : '
No stories here yet.
'; - } - - // Community Stories card -> Live when the city has stories. - const storiesCard = document.querySelector('[data-feature="stories"]'); - if (storiesCard && cityStories.length > 0) { - storiesCard.classList.remove('coming-soon'); - - const badge = storiesCard.querySelector('.feature-status-badge'); - if (badge) { - badge.className = 'feature-status-badge live'; - badge.innerHTML = - ' ' + - 'Live'; - } - - const desc = storiesCard.querySelector('.feature-description'); - if (desc) { - desc.setAttribute('data-i18n', 'cityHub.features.stories.description'); - desc.textContent = - 'Discover real stories of neighbourhood transformation, ' + - 'told by the people who made it happen.'; - } - - const action = storiesCard.querySelector('.feature-action'); - if (action) { - action.innerHTML = - '' + - 'Read Stories ' + - ''; - } - // Translate the newly injected data-i18n nodes. - if (window.translator && typeof window.translator.translatePage === 'function') { - window.translator.translatePage(); + // Hide the "Read all" link for cities without a stories page yet + // (they have no stories) so it can't 404. It reappears once a + // city has stories (and thus a /stories/ page). + if (cityStories.length === 0) { + const seeAll = hubStories.closest('.hub-section'); + const link = seeAll && seeAll.querySelector('.hub-see-all'); + if (link) link.style.display = 'none'; } } diff --git a/website/public/cities/ahmedabad/index.html b/website/public/cities/ahmedabad/index.html index 94e3d1b0..0f1e1987 100644 --- a/website/public/cities/ahmedabad/index.html +++ b/website/public/cities/ahmedabad/index.html @@ -61,6 +61,7 @@ +