From 504f37de7f1a11b4c008a4c0c65529b4bd71d496 Mon Sep 17 00:00:00 2001 From: Patrick Gan Date: Tue, 15 Oct 2024 13:51:17 +0800 Subject: [PATCH] Add additional dates field for key dates in short courses --- .../molecules/key-details/key-details.html | 10 ++++++++++ .../pages/shortcourses/short_course.yaml | 1 + .../migrations/0038_shortcoursepage_dates.py | 19 +++++++++++++++++++ rca/shortcourses/models.py | 2 ++ 4 files changed, 32 insertions(+) create mode 100644 rca/shortcourses/migrations/0038_shortcoursepage_dates.py diff --git a/rca/project_styleguide/templates/patterns/molecules/key-details/key-details.html b/rca/project_styleguide/templates/patterns/molecules/key-details/key-details.html index ae5a0cfc9..0bd439c24 100644 --- a/rca/project_styleguide/templates/patterns/molecules/key-details/key-details.html +++ b/rca/project_styleguide/templates/patterns/molecules/key-details/key-details.html @@ -16,6 +16,16 @@
Fees
{% endif %} + {% if page.dates %} +
+
Dates
+ +
+ {% endif %} {% if page.location %}
Location
diff --git a/rca/project_styleguide/templates/patterns/pages/shortcourses/short_course.yaml b/rca/project_styleguide/templates/patterns/pages/shortcourses/short_course.yaml index 75fac4e97..0074c588a 100644 --- a/rca/project_styleguide/templates/patterns/pages/shortcourses/short_course.yaml +++ b/rca/project_styleguide/templates/patterns/pages/shortcourses/short_course.yaml @@ -32,6 +32,7 @@ context: introduction_image: True introduction: 'Understand the purpose of design thinking in promoting innovation and learn real-world applications and strategies for design thinking.' body: '

At the RCA, we teach design thinking, training designers who go on to lead global brands worldwide as creative directors and CEOs. In contrast to standard, linear approaches that build on tested models, design thinking is creatively structured, analytic and responsive. It draws in diverse disciplines and multiple areas of expertise and exploration, starting with the core premise that everything is a design problem.

Through the application of this informed analysis within business-driven, public-facing and community-centred contexts, design thinking can produce innovation, which in turn enables brands to remain competitive in changing markets.

' + dates: '

March 3, 2024

' location: 'Royal College of Art Kensington Gore' shortcourse_details_register_link: '#' about: diff --git a/rca/shortcourses/migrations/0038_shortcoursepage_dates.py b/rca/shortcourses/migrations/0038_shortcoursepage_dates.py new file mode 100644 index 000000000..549f2f074 --- /dev/null +++ b/rca/shortcourses/migrations/0038_shortcoursepage_dates.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.11 on 2024-10-15 03:20 + +from django.db import migrations +import wagtail.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("shortcourses", "0037_required_title_and_play_button_label_gallery_block"), + ] + + operations = [ + migrations.AddField( + model_name="shortcoursepage", + name="dates", + field=wagtail.fields.RichTextField(blank=True), + ), + ] diff --git a/rca/shortcourses/models.py b/rca/shortcourses/models.py index e82f95333..cd18ea1f5 100644 --- a/rca/shortcourses/models.py +++ b/rca/shortcourses/models.py @@ -179,6 +179,7 @@ class ShortCoursePage(ContactFieldsMixin, BasePage): null=True, related_name="+", ) + dates = RichTextField(blank=True, features=["link"]) location = RichTextField(blank=True, features=["link"]) introduction = models.CharField(max_length=500, blank=True) @@ -271,6 +272,7 @@ class ShortCoursePage(ContactFieldsMixin, BasePage): ] key_details_panels = [ InlinePanel("fee_items", label="Fees"), + FieldPanel("dates"), FieldPanel("location"), FieldPanel("show_register_link"), InlinePanel("subjects", label=_("Subjects")),