feat(storefront): homepage, module gating, widget protocol, i18n fixes
Some checks failed
Some checks failed
Storefront homepage & module gating:
- CMS owns storefront GET / (slug="home" with 3-tier resolution)
- Catalog loses GET / (keeps /products only)
- Store root redirect (GET / → /store/dashboard or /store/login)
- Route gating: non-core modules return 404 when disabled for platform
- Seed store default homepages per platform
Widget protocol for customer dashboard:
- StorefrontDashboardCard contract in widgets.py
- Widget aggregator get_storefront_dashboard_cards()
- Orders and Loyalty module widget providers
- Dashboard template renders contributed cards (no module names)
Landing template module-agnostic:
- CTAs driven by storefront_nav (not hardcoded module names)
- Header actions check nav item IDs (not enabled_modules)
- Remove hardcoded "Add Product" sidebar button
- Remove all enabled_modules checks from storefront templates
i18n fixes:
- Title placeholder resolution ({{store_name}}) for store default pages
- Storefront nav label_keys prefixed with module code
- Add storefront.account.* keys to 6 modules (en/fr/de/lb)
- Header/footer CMS pages use get_translated_title(current_language)
- Footer labels use i18n keys instead of hardcoded English
Icon cleanup:
- Standardize on map-pin (remove location-marker alias)
- Replace all location-marker references across templates and docs
Docs:
- Storefront builder vision proposal (6 phases)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2097,6 +2097,49 @@ SHARED_PLATFORM_PAGES = [
|
||||
# ============================================================================
|
||||
|
||||
|
||||
STORE_DEFAULT_HOME = {
|
||||
"slug": "home",
|
||||
"title": "Welcome to {{store_name}}",
|
||||
"title_translations": tt(
|
||||
"Welcome to {{store_name}}",
|
||||
"Bienvenue chez {{store_name}}",
|
||||
"Willkommen bei {{store_name}}",
|
||||
"Wëllkomm bei {{store_name}}",
|
||||
),
|
||||
"content": """<div class="prose-content">
|
||||
<h2>Welcome</h2>
|
||||
<p>{{store_name}} is here to serve you. Browse our offerings and discover what we have for you.</p>
|
||||
</div>""",
|
||||
"content_translations": tt(
|
||||
# English
|
||||
"""<div class="prose-content">
|
||||
<h2>Welcome</h2>
|
||||
<p>{{store_name}} is here to serve you. Browse our offerings and discover what we have for you.</p>
|
||||
</div>""",
|
||||
# French
|
||||
"""<div class="prose-content">
|
||||
<h2>Bienvenue</h2>
|
||||
<p>{{store_name}} est là pour vous servir. Découvrez nos offres et ce que nous avons pour vous.</p>
|
||||
</div>""",
|
||||
# German
|
||||
"""<div class="prose-content">
|
||||
<h2>Willkommen</h2>
|
||||
<p>{{store_name}} ist für Sie da. Entdecken Sie unser Angebot.</p>
|
||||
</div>""",
|
||||
# Luxembourgish
|
||||
"""<div class="prose-content">
|
||||
<h2>Wëllkomm</h2>
|
||||
<p>{{store_name}} ass fir Iech do. Entdeckt eist Angebot.</p>
|
||||
</div>""",
|
||||
),
|
||||
"template": "default",
|
||||
"meta_description": "Welcome to {{store_name}}",
|
||||
"show_in_header": False,
|
||||
"show_in_footer": False,
|
||||
"display_order": 0,
|
||||
}
|
||||
|
||||
|
||||
STORE_DEFAULTS_COMMON = [
|
||||
{
|
||||
"slug": "about",
|
||||
@@ -2753,6 +2796,12 @@ def create_default_pages(db: Session) -> None:
|
||||
# Only for platforms that host stores (not wizard.lu main)
|
||||
# ------------------------------------------------------------------
|
||||
if platform.code != "main":
|
||||
# Store homepage (slug="home")
|
||||
if _create_page(db, platform.id, STORE_DEFAULT_HOME, is_platform_page=False):
|
||||
created_count += 1
|
||||
else:
|
||||
skipped_count += 1
|
||||
|
||||
for page_data in STORE_DEFAULTS_COMMON:
|
||||
if _create_page(db, platform.id, page_data, is_platform_page=False):
|
||||
created_count += 1
|
||||
|
||||
Reference in New Issue
Block a user