Skip to content

Commit

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

See merge request buckinghamshire-council/bc!795
  • Loading branch information
siimonevans committed Nov 25, 2024
2 parents daa7e96 + 80fce2f commit d8d3a6b
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 142 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 82.0 (2024-11-25)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/81.1...82.0>

- Various FE fixes/updates
- Add description field to the `EventIndexPage`
- Update the `hero--promo-blog.html` molecule to display a description in both the the `BlogHomePage` and `EventIndexPage` hero

## 81.1 (2024-11-21)

Compare: <https://git.torchbox.com/buckinghamshire-council/bc/compare/81.0...81.1>
Expand Down
18 changes: 18 additions & 0 deletions bc/events/migrations/0037_eventindexpage_description.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.14 on 2024-11-22 10:13

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("events", "0036_eventindexpage_fetch_all_events"),
]

operations = [
migrations.AddField(
model_name="eventindexpage",
name="description",
field=models.TextField(blank=True),
),
]
10 changes: 6 additions & 4 deletions bc/events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,20 @@ def clean_fields(self, exclude=None):
class EventIndexPage(BasePage):
template = "patterns/pages/events/event_index_page.html"

fetch_all_events = models.BooleanField(
help_text="Fetch events from all sites, instead of just displaying child pages of this page"
)

subpage_types = ["EventPage"]
parent_page_types = [
"home.HomePage",
"family_information.SubsiteHomePage",
"promotional.PromotionalHomePage",
]

description = models.TextField(blank=True)
fetch_all_events = models.BooleanField(
help_text="Fetch events from all sites, instead of just displaying child pages of this page"
)

content_panels = BasePage.content_panels + [
FieldPanel("description"),
FieldPanel("fetch_all_events"),
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@

{% is_promotional_site as promotional_site %}

<div class="wrapper wrapper--promo-inner promo-hero-blog-wrapper">
<div class="promo-hero-blog">
<div class="wrapper wrapper--promo-inner">
<h1 class="promo-hero-blog__title">{{ page.title }}</h1>
{% comment %}
<div class="promo-hero-blog__description">
<p>Todo: BE field for this introduction text</p>
</div>
{% endcomment %}
<div class="promo-hero-blog">
<div class="wrapper wrapper--promo-inner">
<h1 class="promo-hero-blog__title">{{ page.title }}</h1>
<div class="promo-hero-blog__description">
<p>{% firstof page.description page.about_description %}</p>
</div>
</blockquote>
</div>
</div>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load wagtailimages_tags %}

{% image image fill-1200x980 as rendition %}
{% image image fill-1200x980 format-jpeg as rendition %}

<div class="promo-hero-content-wrapper">
<div class="promo-hero-content">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{% load wagtailimages_tags %}

{% image image fill-1200x980 as rendition %}
{% image image fill-1200x980 format-jpeg as rendition %}

<div class="promo-hero-home-wrapper">

<div class="promo-hero-home__inner-content-mid" aria-hidden="true">
<div class="promo-hero-home__inner-content-mid">
<div class="promo-hero-home__inner-content-mid-container">
<h1 class="promo-hero-home__title">{{ title }}</h1>
<h1 class="promo-hero-home__title" aria-hidden="true">{{ title }}</h1>
{% if text %}
<div class="promo-hero-home__description">
<div class="promo-hero-home__description" aria-hidden="true">
{{ text|linebreaks }}
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,60 @@
{# Promo blog listing #}
{% if promotional_site %}

{% include "patterns/molecules/hero/hero--promo-blog.html" %}

<div class="wrapper wrapper--flex wrapper--z-index-1 blog-page">
<div class="section section--main">

<ul class="promo-blog-cards">
{% if page.featured_blogpost_page %}
<li class="promo-blog-listing-card">
<div>
<a class="promo-blog-listing-card__link" href="{% pageurl page.featured_blogpost_page %}">
<h2 class="promo-blog-listing-card__title">{{ page.featured_blogpost_page.title }}</h2>
</a>

<p class="promo-blog-listing-card__content">
{{ page.featured_blogpost_page.intro_text|truncatewords:50 }}
</p>
</div>

<div>
{% if page.featured_image %}
{% image page.featured_image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>
</li>
{% endif %}

{% for item in blogs.object_list %}
<li class="promo-blog-listing-card">
<div>
<p class="promo-blog-listing-card__meta">
{{ item.date_published|date:"d F Y" }}
</p>

<a class="promo-blog-listing-card__link" href="{% pageurl item %}">
<h2 class="promo-blog-listing-card__title">{{ item.title }}</h2>
</a>

<p class="promo-blog-listing-card__content">
{{ item.intro_text|truncatewords:50 }}
</p>
</div>

<div>
{% if item.image %}
{% image item.image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>
</li>
{% endfor %}
</ul>

{% include "patterns/molecules/pagination/pagination.html" with modifier="pagination--centred" paginator_page=blogs %}
<div class="wrapper wrapper--promo-inner promo-hero-blog-wrapper">

{% include "patterns/molecules/hero/hero--promo-blog.html" %}

<div class="wrapper wrapper--flex wrapper--z-index-1 blog-page">
<div class="section section--main">
<ul class="promo-blog-cards">
{% if page.featured_blogpost_page %}
<li class="promo-blog-listing-card">
<div>
<a class="promo-blog-listing-card__link" href="{% pageurl page.featured_blogpost_page %}">
<h2 class="promo-blog-listing-card__title">{{ page.featured_blogpost_page.title }}</h2>
</a>

<p class="promo-blog-listing-card__content">
{{ page.featured_blogpost_page.intro_text|truncatewords:50 }}
</p>
</div>

<div>
{% if page.featured_image %}
{% image page.featured_image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>
</li>
{% endif %}

{% for item in blogs.object_list %}
<li class="promo-blog-listing-card">
<div>
<p class="promo-blog-listing-card__meta">
{{ item.date_published|date:"d F Y" }}
</p>

<a class="promo-blog-listing-card__link" href="{% pageurl item %}">
<h2 class="promo-blog-listing-card__title">{{ item.title }}</h2>
</a>

<p class="promo-blog-listing-card__content">
{{ item.intro_text|truncatewords:50 }}
</p>
</div>

<div>
{% if item.image %}
{% image item.image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>
</li>
{% endfor %}
</ul>

{% include "patterns/molecules/pagination/pagination.html" with modifier="pagination--centred" paginator_page=blogs %}
</div>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,59 +7,60 @@
{% is_promotional_site as promotional_site %}

{% if promotional_site %}
{% include "patterns/molecules/hero/hero--promo-blog.html" %}

<div class="wrapper wrapper--flex wrapper--z-index-1">
<div class="section section--main">
{% if events %}
{% if events.object_list.exists %}
<ul class="promo-blog-cards">
{% for event in events.object_list.specific %}
<li class="promo-blog-listing-card promo-blog-listing-card--event">

<div>
{% if event.listing_image %}
{% image event.listing_image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>

<div>
<a class="promo-blog-listing-card__link" href="{% pageurl event %}">
<h2 class="promo-blog-listing-card__title">{% firstof event.listing_title event.title %}</h2>
</a>

<p class="promo-blog-listing-card__meta promo-blog-listing-card__meta--margin-top">
{% format_event_date event.start_date event.start_time event.end_date event.end_time %}
</p>
<div class="wrapper wrapper--promo-inner promo-hero-blog-wrapper">

{% include "patterns/molecules/hero/hero--promo-blog.html" %}

<div class="wrapper wrapper--flex wrapper--z-index-1">
<div class="section section--main">
{% if events %}
{% if events.object_list.exists %}
<ul class="promo-blog-cards">
{% for event in events.object_list.specific %}
<li class="promo-blog-listing-card promo-blog-listing-card--event">

<div>
{% if event.listing_image %}
{% image event.listing_image fill-420x220 class="promo-blog-listing-card__image" %}
{% endif %}
</div>
<div>
<a class="promo-blog-listing-card__link" href="{% pageurl event %}">
<h2 class="promo-blog-listing-card__title">{% firstof event.listing_title event.title %}</h2>
</a>

{% if event.listing_summary or event.introduction %}
<p class="promo-blog-listing-card__content">
{% firstof event.listing_summary event.introduction %}
<p class="promo-blog-listing-card__meta promo-blog-listing-card__meta--margin-top">
{% format_event_date event.start_date event.start_time event.end_date event.end_time %}
</p>
{% endif %}
</div>

</li>
{% endfor %}
</ul>
{% if event.listing_summary or event.introduction %}
<p class="promo-blog-listing-card__content">
{% firstof event.listing_summary event.introduction %}
</p>
{% endif %}
</div>
</li>
{% endfor %}
</ul>

{% include "patterns/molecules/pagination/pagination.html" with paginator_page=events %}
{% include "patterns/molecules/pagination/pagination.html" with paginator_page=events %}

{% else %}
{# no items on any page #}
{% endif %}
{% else %}
{# no items on any page #}
{% endif %}

{% if show_past and upcoming_events.exists %}
<a href="{% pageurl page %}">View upcoming events</a>
{% elif past_events.exists %}
<a href="{% pageurl page %}?past=True">View past events</a>
{% if show_past and upcoming_events.exists %}
<a href="{% pageurl page %}">View upcoming events</a>
{% elif past_events.exists %}
<a href="{% pageurl page %}?past=True">View past events</a>
{% endif %}
{% endif %}
{% endif %}

</div>
</div>
</div>
</div>

{% else %}
<div class="wrapper wrapper--flex news">
<section class="section section--main" aria-label="Listing of events">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% block title %}{% if search_query %}Search results for &ldquo;{{ search_query }}&rdquo;{% else %}Search{% endif %}{% endblock %}

{% block breadcrumbs %}
<div class="wrapper wrapper--large">
<div class="wrapper {% if promotional_site %} wrapper--promo-inner {% else %} wrapper--large {% endif %}">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb__item">
Expand All @@ -18,7 +18,7 @@
{% endblock %}

{% block content %}
<div class="wrapper {% if promotional_site %} wrapper--large {% else %} wrapper--page {% endif %} search">
<div class="wrapper {% if promotional_site %} wrapper--promo-inner {% else %} wrapper--page {% endif %} search">
<h1 class="heading heading--xxl">Search</h1>

<form action="{% url 'search' %}" method="get" role="search" class="form form--search">
Expand All @@ -38,7 +38,7 @@ <h1 class="heading heading--xxl">Search</h1>

{% comment %} New curated search suggestions {% endcomment %}
{% if search_cta_title and search_cta_button %}
<div {% if promotional_site %} class="wrapper--large" {% endif %}>
<div {% if promotional_site %} class="wrapper--promo-inner" {% endif %}>
{# When we have a search cta, we want to display the number of results above it. #}
{% if search_results %}
<header class="search__results-header search__results-header--no-border">
Expand All @@ -65,7 +65,7 @@ <h2 class="search-promotions__heading heading heading--s">{{ search_cta_title }}
</div>
{% endif %}

<div class="wrapper {% if promotional_site %} wrapper--large {% else %} wrapper--page {% endif %} search">
<div class="wrapper {% if promotional_site %} wrapper--promo-inner {% else %} wrapper--page {% endif %} search">
{% if search_results %}
<section class="search__results" aria-label="Search results">
{% if not search_cta_title or not search_cta_button %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

.promo-aligned-media-with-text {
// Escape parent
width: calc(100vw - 15px);
width: 100vw;
transform: translateX(-50%);
background-color: $color--earth-light;
position: relative;
Expand All @@ -18,6 +18,7 @@

@include media-query(mob-landscape) {
padding: 75px 0 50px;
width: calc(100vw - 15px);
}

@include media-query(px550) {
Expand Down
Loading

0 comments on commit d8d3a6b

Please sign in to comment.