diff --git a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page--results.yaml b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page--results.yaml index 6e0788b94..d53d1863d 100644 --- a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page--results.yaml +++ b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page--results.yaml @@ -24,8 +24,6 @@ context: - step: value: heading: 'Use the ‘Express interest’ button if you hold an offer' - lower_body: - - dummy contact: true contact_model_image: true published_at: !!timestamp '2020-05-13 2:00:00' diff --git a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.html b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.html index 3def92e70..aab4c2bb1 100644 --- a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.html +++ b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.html @@ -7,9 +7,7 @@ {% endblock %} {% block content %} -
-
- -
- - {% if not results %} -
-
-
- {% endif %} - -
-
- {% include "patterns/molecules/streamfield/stream_block.html" with value=page.body guide_page=True %} -
-
- -
- - {% if stats_block %} - {% include "patterns/organisms/stat-block/stat-block.html" with modifier="light-to-dark" %} - {% endif %} - -
- - {% if not stats_block %} -
-
-
- {% endif %} - +

{{ page.scholarship_listing_title }}

@@ -77,86 +47,83 @@

- -
- -
- - + - {% if results %} -
-
- {% if programme %} -

Scholarship results showing for {{ programme }} programme

+
+
+ {% for item in filters.items %} + {% if item.queryset %} +
+ {% include "patterns/molecules/filter-tab-options/filter-tab-options.html" with single_filter_only=True %} +
{% endif %} -

{{ page.characteristics_disclaimer }}

-
+ {% endfor %}
+
+
-
- {% include "patterns/organisms/accordion-block/accordion-block.html" with accordion_id='1' accordions=results title=results_title section_id=page.results_title|slugify scholarship=True %} + {% if results %} +
+
+ {% if programme %} +

Scholarship results showing for {{ programme }} programme

+ {% endif %} +

{{ page.characteristics_disclaimer }}

- {% endif %} - - - +
+
+ {% include "patterns/organisms/accordion-block/accordion-block.html" with accordion_id='1' accordions=results title=results_title section_id=page.results_title|slugify scholarship=True %} +
+ {% endif %} +
+ {% if page.scholarships_has_dark_background %} +
+
+
+ {% endif %} -
+
- {% include "patterns/molecules/streamfield/stream_block.html" with value=page.lower_body guide_page=True %} + {% include "patterns/molecules/streamfield/stream_block.html" with value=page.body guide_page=True %}
-
{% if related_pages.items %} @@ -183,7 +150,6 @@

{% endif %} -
diff --git a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.yaml b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.yaml index d00b631b6..0d6399ce7 100644 --- a/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.yaml +++ b/rca/project_styleguide/templates/patterns/pages/scholarships/scholarships_listing_page.yaml @@ -25,8 +25,6 @@ context: - step: value: heading: 'Use the ‘Express interest’ button if you hold an offer' - lower_body: - - dummy contact: true contact_model_image: true published_at: !!timestamp '2020-05-13 2:00:00' diff --git a/rca/scholarships/migrations/0012_scholarships_listing_background_color.py b/rca/scholarships/migrations/0012_scholarships_listing_background_color.py new file mode 100644 index 000000000..8650fdb77 --- /dev/null +++ b/rca/scholarships/migrations/0012_scholarships_listing_background_color.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.20 on 2025-11-03 01:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("scholarships", "0011_wagtail_3_upgrade"), + ] + + operations = [ + migrations.RemoveField( + model_name="scholarshipslistingpage", + name="lower_body", + ), + migrations.AddField( + model_name="scholarshipslistingpage", + name="scholarships_listing_background_color", + field=models.CharField( + choices=[("light", "Light"), ("dark", "Dark")], + default="light", + help_text="Select the background color for this section", + max_length=10, + verbose_name="Background Color", + ), + ), + ] diff --git a/rca/scholarships/models.py b/rca/scholarships/models.py index 800a30ff4..3a933e8ba 100644 --- a/rca/scholarships/models.py +++ b/rca/scholarships/models.py @@ -94,7 +94,18 @@ class ScholarshipsListingPage(ContactFieldsMixin, BasePage): introduction = models.CharField(max_length=500, blank=True) body = StreamField(ScholarshipsListingPageBlock()) + class BackgroundColor(models.TextChoices): + LIGHT = "light", "Light" + DARK = "dark", "Dark" + # Scholarship listing fields + scholarships_listing_background_color = models.CharField( + max_length=10, + choices=BackgroundColor.choices, + default="light", + help_text="Select the background color for this section", + verbose_name="Background Color", + ) scholarship_listing_title = models.CharField( max_length=50, verbose_name="Listing Title" ) @@ -114,7 +125,6 @@ class ScholarshipsListingPage(ContactFieldsMixin, BasePage): blank=True, help_text="A small disclaimer shown just above the scholarships listing.", ) - lower_body = StreamField(ScholarshipsListingPageBlock()) # Scholarship form fields key_details = RichTextField(features=["h3", "bold", "italic", "link"], blank=True) @@ -127,9 +137,9 @@ class ScholarshipsListingPage(ContactFieldsMixin, BasePage): content_panels = BasePage.content_panels + [ FieldPanel("introduction"), - FieldPanel("body"), MultiFieldPanel( [ + FieldPanel("scholarships_listing_background_color"), FieldPanel("scholarship_listing_title"), FieldPanel("scholarship_listing_sub_title"), FieldPanel("scholarship_application_steps"), @@ -137,7 +147,7 @@ class ScholarshipsListingPage(ContactFieldsMixin, BasePage): ], heading="Scholarship listing", ), - FieldPanel("lower_body"), + FieldPanel("body"), MultiFieldPanel([*ContactFieldsMixin.panels], heading="Contact information"), ] @@ -164,6 +174,10 @@ def show_interest_bar(self): def show_interest_link(self): return True + @property + def scholarships_has_dark_background(self): + return self.scholarships_listing_background_color == self.BackgroundColor.DARK + def anchor_nav(self): """Build list of data to be used as in-page navigation""" items = [] @@ -183,9 +197,6 @@ def process_block(block): } ) - for block in self.lower_body: - process_block(block) - return items def get_context(self, request, *args, **kwargs): @@ -211,7 +222,7 @@ def get_context(self, request, *args, **kwargs): option_value_field="slug", ), TabStyleFilter( - "Location", + "Fee Status", queryset=( ScholarshipLocation.objects.filter( id__in=queryset.values_list("location_id", flat=True) diff --git a/rca/static_src/sass/components/_categories-tablist.scss b/rca/static_src/sass/components/_categories-tablist.scss index 1b05cea00..3ba420691 100644 --- a/rca/static_src/sass/components/_categories-tablist.scss +++ b/rca/static_src/sass/components/_categories-tablist.scss @@ -252,19 +252,39 @@ margin-bottom: ($gutter * 2); // Colours are quite confusing for this component as it has many states, overriding for the scholarship listing - #{$root}__heading { - color: $color--light-grey; + &.bg--dark { + #{$root}__heading { + color: $color--light-grey; + } + + #{$root}__tab { + color: $color--light-grey; + + &--reset, + &--selected, + &[aria-selected='true'], + &:focus, + &:hover { + color: $color--white; + } + } } - #{$root}__tab { - color: $color--light-grey; + &.bg--light { + #{$root}__heading { + color: $color--dark-grey; + } - &--reset, - &--selected, - &[aria-selected='true'], - &:focus, - &:hover { - color: $color--white; + #{$root}__tab { + color: $color--dark-grey; + + &--reset, + &--selected, + &[aria-selected='true'], + &:focus, + &:hover { + color: $color--black; + } } } }