feat: replace hardcoded navigation with CMS-managed models #33
Reference in New Issue
Block a user
Delete Branch "feature/navigation-overhaul"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replace the entirely hardcoded nav/footer with CMS-managed Wagtail models. Editors can now control navigation items, social links, and site branding from the Wagtail admin.
Key changes
SiteSettingsextended with branding fields:site_name,tagline,footer_description,copyright_textNavigationMenuItemorderable: links to internal pages (auto-hides when unpublished) or external URLs, withshow_in_header/show_in_footertogglesSocialMediaLinkorderable: platform + URL + icon template includesget_nav_items,get_social_linksnav.htmlandfooter.htmlto render from CMS dataFixes
Closes #32
8138acb7f7to98175e2fc598175e2fc5to1c5ba6cf90Requesting changes for two blockers:
apps/core/migrations/0003_seed_navigation_data.py seeds SocialMediaLink.url as '/feed/' (line ~88) while the model field is URLField (apps/core/models.py line ~147). This creates invalid persisted data that fails validation in admin/forms. Repro (in PR branch): run migrations, then call full_clean() on the seeded rss row => ValidationError: Enter a valid URL. Even a plain ModelForm for that instance is invalid, so editors cannot save Site Settings without fixing that row.
reverse_seed() in the same migration deletes ALL NavigationMenuItem and SocialMediaLink rows globally (lines ~96-100). On rollback, this will wipe user-created navigation/social data, not just seeded data.
Please update the seed URL/validation strategy and make reverse migration safe (or explicitly irreversible) to avoid destructive data loss.
Both blockers addressed in
d368777:URLField → CharField: Changed both
SocialMediaLink.urlandNavigationMenuItem.link_urlfromURLFieldtoCharField(max_length=500). This supports both full URLs and relative paths like/feed/that fail URLField validation. New schema migration (0004) generated.Destructive reverse migration: Replaced
reverse_seed()withmigrations.RunPython.noop. Rollback no longer deletes all rows — it simply leaves the data in place.All tests pass (88 tests, 95.5% coverage), ruff clean.
Re-review complete. Previous blockers are resolved:
Validation run on PR head :
Approving.