Skip to content

Commit

Permalink
Merge branch 'release' into 'master'
Browse files Browse the repository at this point in the history
Release 79.0

See merge request buckinghamshire-council/bc!739
  • Loading branch information
KIRA009 committed Aug 20, 2024
2 parents 2ae7783 + 50ce902 commit 5e2c61e
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 22 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release History

## 79.0 (2024-08-20)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/78.2...79.0>

- EHCCo widget: Update widget heading text
- EHCCo widget: Make emails clickable by converting them to links
- EHCCo widget: Change fallback text from TBC to awaiting allocation
- Add option to display images for first three pages in category page

## 78.2 (2024-08-14)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/78.1...78.2>
Expand Down
3 changes: 3 additions & 0 deletions bc/family_information/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ def get_context(self, value, parent_context=None):

# Get the page's class.
context["page_class"] = parent_context["page"]._meta.object_name
context["display_featured_images"] = getattr(
parent_context["page"], "display_featured_images", False
)

# Check if the block is preceded by a heading.
blocks_under_headings = parent_context.get("blocks_under_headings", [])
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Generated by Django 4.2.14 on 2024-08-13 08:09

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
(
"family_information",
"0016_directory_search_block__add_bucks_online_directory_option",
),
]

operations = [
migrations.AddField(
model_name="categorypage",
name="display_featured_images",
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name="categorytypeonepage",
name="display_featured_images",
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name="categorytypetwopage",
name="display_featured_images",
field=models.BooleanField(default=False),
),
]
7 changes: 7 additions & 0 deletions bc/family_information/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class BaseCategoryPage(FISBannerFields, BasePage):
default="What do you want to do?", max_length=255
)

display_featured_images = models.BooleanField(default=False)

# Content
body = StreamField(
[
Expand Down Expand Up @@ -262,6 +264,7 @@ class BaseCategoryPage(FISBannerFields, BasePage):
content_panels = (
BasePage.content_panels
+ [
FieldPanel("display_featured_images"),
MultiFieldPanel(
[
FieldPanel("top_tasks_heading", heading="Heading"),
Expand Down Expand Up @@ -301,6 +304,10 @@ def allowed_subpage_models(cls):
resolve_model_string("standardpages.IndexPage")
]

@cached_property
def has_featured_pages(self):
return any(row.block_type == "cards" for row in self.body)

@cached_property
def other_child_pages(self):
"""Get child pages for the current category page, excluding children that are
Expand Down
2 changes: 1 addition & 1 deletion bc/family_information/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def get_corresponding_ehc_co(request):
}
else:
context = {
"name": "TBC",
"name": "awaiting allocation",
"email": school.hub_email,
}
return JsonResponse(context)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
data-height-equalizer
>
{% for card in value %}
{% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-index" has_heading=has_heading page=card.value.specific %}
{% if display_featured_images and forloop.counter <= 3 %}
{% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-index" has_heading=has_heading page=card.value.specific show_image=True %}
{% else %}
{% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-index" has_heading=has_heading page=card.value.specific show_image=False %}
{% endif %}
{% endfor %}
</section>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@
<div class="ehcco-search is-hidden" data-ehcco-search data-matching-schools-url="{{ get_matching_schools_url|escapejs }}" data-ehc-co-url="{{ get_corresponding_ehc_co_url|escapejs }}">
<div class="ehcco-search__container">
<div data-autocomplete-search class="ehcco-search__search">
<h2 class="ehcco-search__heading heading heading--s">Find your EHC coordinator by typing the name of your education provider</h2>

<label class="ehcco-search__label" for="school-search">Type the name of a nursery, school or college</label>
<label for="school-search" class="ehcco-search__heading heading heading--s">Find your EHC Coordinator by typing the name of your nursery, school or college</label>
<div data-autocomplete-wrapper></div>
<div data-autocomplete-list id="autocomplete-list" class="autocomplete-items"></div>
</div>

<div data-autocomplete-result class="ehcco-search__result is-hidden">
<p class="ehcco-search__result-heading heading heading--xl">
The EHC coordinator for <span data-autocomplete-school></span> is <span data-autocomplete-name></span>
The EHC Coordinator for <span data-autocomplete-school></span> is <span data-autocomplete-name></span>
</p>
<div class="rich-text">
<p>You can contact your EHC co-ordinator via email, use <span data-autocomplete-email class="heading"></span></p>
<p>You can contact your EHC Coordinator via email, use <span data-autocomplete-email class="heading"></span></p>
</div>
</div>
</div>
</div>

<noscript>
<div class="ehcco-search__fallback rich-text">
<p>To find the EHC coordinator for your education provider or setting please use one of the email addresses below. Select the email address for the area your education provider or setting is in.</p>
<p>To find the EHC Coordinator for your education provider or setting please use one of the email addresses below. Select the email address for the area your education provider or setting is in.</p>

<ul>
<li>Aylesbury: <a href="mailto:senaylesbury@buckinghamshire.gov.uk">senaylesbury@buckinghamshire.gov.uk</a></li>
<li>Chiltern and South Bucks: <a href="mailto:sencsb@buckinghamshire.gov.uk">sencsb@buckinghamshire.gov.uk</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ <h2 class="heading heading--l" id="{{ page.other_pages_heading|slugify }}">{{ pa
data-height-equalizer
>
{% for subpage in page.other_child_pages %}
{% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% if not page.has_featured_pages and page.display_featured_images and forloop.counter <= 3 %}
{% include "patterns/molecules/page-card/page-card.html" with show_image=True classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% else %}
{% include "patterns/molecules/page-card/page-card.html" with show_image=False classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% endif %}
{% endfor %}
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ <h2 class="heading heading--l" id="{{ page.other_pages_heading|slugify }}">{{ pa
data-height-equalizer
>
{% for subpage in page.other_child_pages %}
{% include "patterns/molecules/page-card/page-card.html" with classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% if not page.has_featured_pages and page.display_featured_images and forloop.counter <= 3 %}
{% include "patterns/molecules/page-card/page-card.html" with show_image=True classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% else %}
{% include "patterns/molecules/page-card/page-card.html" with show_image=False classes="card--fis-index" has_heading=show_other_pages_heading page=subpage %}
{% endif %}
{% endfor %}
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion bc/static_src/javascript/components/fis-ehcco-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class EHCCOSearch {
this.result.classList.remove('is-hidden');
this.ehccoSchool.textContent = this.state.school;
this.ehccoName.textContent = this.state.name;
this.ehccoEmail.textContent = this.state.email;
this.ehccoEmail.innerHTML = `<a href="mailto:${this.state.email}">${this.state.email}</a>`;
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions bc/static_src/sass/components/_fis-ehcco-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@
&__heading {
margin-top: 0;
margin-bottom: $grid--min;

@include media-query(tablet-landscape) {
margin-bottom: 0;
}
}

&__label {
@include font-size(s);
display: block;
color: $color--grey-accessible;
margin: $grid--min 0;
}

&__input {
Expand Down

0 comments on commit 5e2c61e

Please sign in to comment.