-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TWE-21 - BE - Secondary Navigation (#357)
* Create BasePage, also move ContactMixin to prevent circular dependency * Create NavigationSet snippet * Add NavigationSetMixin to DivisionPage * Add DivisionMixin & NavigationSetMixin to BasePage * Update DivisionMixin to also use self if it's a division page * Display temporary logo & secondary nav * Add secondary nav template * Make schema migrations * Add revisions to NavigationSet * Update schema migration * Update division mixin tests to check division page's self is returned * Tweak navigation set to actually get from the ancestor, or an ancestor with a division with a navigation set * Add unit tests * Add generic relation for Revision * Update schema migration
- Loading branch information
1 parent
187bff5
commit ee5b592
Showing
26 changed files
with
973 additions
and
239 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
tbx/blog/migrations/0028_divisionmixin_and_navigationsetmixin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Generated by Django 5.1.4 on 2025-01-28 09:34 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("blog", "0027_update_theme_colour_choices"), | ||
("divisions", "0002_divisionmixin_and_navigationsetmixin"), | ||
("navigation", "0007_divisionmixin_and_navigationsetmixin"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="division", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="divisions.divisionpage", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="blogindexpage", | ||
name="override_navigation_set", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to="navigation.navigationset", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="blogpage", | ||
name="division", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="divisions.divisionpage", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="blogpage", | ||
name="override_navigation_set", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to="navigation.navigationset", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
tbx/core/migrations/0040_divisionmixin_and_navigationsetmixin.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Generated by Django 5.1.4 on 2025-01-28 09:34 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("divisions", "0002_divisionmixin_and_navigationsetmixin"), | ||
("navigation", "0007_divisionmixin_and_navigationsetmixin"), | ||
( | ||
"torchbox", | ||
"0039_remove_homepage_introduction_homepage_hero_heading_and_more", | ||
), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="homepage", | ||
name="override_navigation_set", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to="navigation.navigationset", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="standardpage", | ||
name="division", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="divisions.divisionpage", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="standardpage", | ||
name="override_navigation_set", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="+", | ||
to="navigation.navigationset", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.