-
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.
Merge branch 'release' into 'master'
Release 73.0 See merge request buckinghamshire-council/bc!720
- Loading branch information
Showing
76 changed files
with
17,452 additions
and
12,282 deletions.
There are no files selected for viewing
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
1,070 changes: 1,070 additions & 0 deletions
1,070
bc/blogs/migrations/0018_add_ehcco_search_widget.py
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
from wagtail import blocks | ||
|
||
|
||
class NCardRowBlock(blocks.StreamBlock): | ||
card = blocks.PageChooserBlock() | ||
|
||
def get_context(self, value, parent_context=None): | ||
context = super().get_context(value, parent_context) | ||
|
||
# Get the page's class. | ||
context["page_class"] = parent_context["page"]._meta.object_name | ||
|
||
# Check if the block is preceded by a heading. | ||
blocks_under_headings = parent_context.get("blocks_under_headings", []) | ||
context["has_heading"] = value in blocks_under_headings | ||
|
||
return context | ||
|
||
|
||
class CardsBlock(NCardRowBlock): | ||
"""A block that displays 3 pages per row, but accepts more than 3 pages.""" | ||
|
||
class Meta: | ||
label = "Cards" | ||
min_num = 1 | ||
template = "patterns/molecules/streamfield/blocks/cards_block.html" | ||
|
||
|
||
class TwoCardRowBlock(NCardRowBlock): | ||
"""A block that only accepts 2 pages, to display the 2 pages in one row.""" | ||
|
||
class Meta: | ||
label = "Two-card row" | ||
max_num = 2 | ||
min_num = 2 | ||
template = "patterns/molecules/streamfield/blocks/two_card_row_block.html" | ||
|
||
|
||
class ThreeCardRowBlock(NCardRowBlock): | ||
"""A block that only accepts 3 pages, to display the 3 pages in one row.""" | ||
|
||
class Meta: | ||
label = "Three-card row" | ||
max_num = 3 | ||
min_num = 3 | ||
template = "patterns/molecules/streamfield/blocks/three_card_row_block.html" |
82 changes: 82 additions & 0 deletions
82
bc/family_information/migrations/0011_add_school_and_ehcco_models.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,82 @@ | ||
# Generated by Django 4.2.11 on 2024-06-07 07:54 | ||
|
||
import django.db.models.deletion | ||
import wagtail.search.index | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("family_information", "0010_subsitehomepage_heading"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="EHCCo", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=255)), | ||
("email", models.EmailField(max_length=254)), | ||
], | ||
options={ | ||
"verbose_name": "EHCCo", | ||
"verbose_name_plural": "EHCCos", | ||
}, | ||
bases=(wagtail.search.index.Indexed, models.Model), | ||
), | ||
migrations.CreateModel( | ||
name="School", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.TextField()), | ||
( | ||
"hub_email", | ||
models.CharField( | ||
blank=True, | ||
choices=[ | ||
( | ||
"sencsb@buckinghamshire.gov.uk", | ||
"sencsb@buckinghamshire.gov.uk", | ||
), | ||
( | ||
"senwyc@buckinghamshire.gov.uk", | ||
"senwyc@buckinghamshire.gov.uk", | ||
), | ||
( | ||
"Senaylesbury@buckinghamshire.gov.uk", | ||
"Senaylesbury@buckinghamshire.gov.uk", | ||
), | ||
], | ||
), | ||
), | ||
( | ||
"ehc_co", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="schools", | ||
to="family_information.ehcco", | ||
), | ||
), | ||
], | ||
bases=(wagtail.search.index.Indexed, models.Model), | ||
), | ||
] |
75 changes: 75 additions & 0 deletions
75
bc/family_information/migrations/0011_subsitehomepage_highlighted_cards_and_more.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,75 @@ | ||
# Generated by Django 4.2.11 on 2024-06-14 09:20 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import modelcluster.fields | ||
import wagtail.blocks | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("family_information", "0010_subsitehomepage_heading"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="subsitehomepage", | ||
name="highlighted_cards", | ||
field=wagtail.fields.StreamField( | ||
[ | ||
( | ||
"two_card_row", | ||
wagtail.blocks.StreamBlock( | ||
[("card", wagtail.blocks.PageChooserBlock())] | ||
), | ||
), | ||
( | ||
"three_card_row", | ||
wagtail.blocks.StreamBlock( | ||
[("card", wagtail.blocks.PageChooserBlock())] | ||
), | ||
), | ||
], | ||
blank=True, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="subsitehomepage", | ||
name="top_tasks_heading", | ||
field=models.CharField( | ||
blank=True, default="What do you want to do?", max_length=255 | ||
), | ||
), | ||
migrations.CreateModel( | ||
name="SubsiteHomePageTopTask", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"sort_order", | ||
models.IntegerField(blank=True, editable=False, null=True), | ||
), | ||
( | ||
"source", | ||
modelcluster.fields.ParentalKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="top_tasks", | ||
to="family_information.subsitehomepage", | ||
), | ||
), | ||
], | ||
options={ | ||
"ordering": ["sort_order"], | ||
"abstract": False, | ||
}, | ||
), | ||
] |
24 changes: 24 additions & 0 deletions
24
bc/family_information/migrations/0012_subsitehomepagetoptask_top_task.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,24 @@ | ||
# Generated by Django 4.2.11 on 2024-06-14 09:20 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("utils", "0014_toptask"), | ||
("family_information", "0011_subsitehomepage_highlighted_cards_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="subsitehomepagetoptask", | ||
name="top_task", | ||
field=models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="+", | ||
to="utils.toptask", | ||
), | ||
), | ||
] |
Oops, something went wrong.