This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #562 from torchbox/course-landing-page
Adds fields and template for course landing page
- Loading branch information
Showing
18 changed files
with
652 additions
and
33 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
tbx/courses/migrations/0002_adds_course_landing_page_fields.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,47 @@ | ||
# Generated by Django 4.2.8 on 2024-01-02 19:08 | ||
|
||
from django.db import migrations, models | ||
import wagtail.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("courses", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="courselandingpage", | ||
name="child_page_listing_heading", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="A heading shown above the child pages listed.", | ||
max_length=255, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="courselandingpage", | ||
name="intro", | ||
field=wagtail.fields.RichTextField(blank=True), | ||
), | ||
migrations.AddField( | ||
model_name="courselandingpage", | ||
name="strapline", | ||
field=models.CharField( | ||
default="", | ||
help_text="Words in <span> tag will display in a contrasting colour.", | ||
max_length=255, | ||
), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="courselandingpage", | ||
name="sub_title", | ||
field=models.CharField( | ||
blank=True, | ||
help_text="Displayed just below the strapline.", | ||
max_length=255, | ||
), | ||
), | ||
] |
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
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
18 changes: 18 additions & 0 deletions
18
tbx/project_styleguide/templates/patterns/molecules/course-grid/course-grid.html
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,18 @@ | ||
{% load wagtailcore_tags %} | ||
|
||
<div class="course-grid {% if not page.child_page_listing_heading %}course-grid--margin-top{% endif %}"> | ||
{% for card in cards %} | ||
<div class="course-grid-item"> | ||
{% if card.sessions or card.cost %} | ||
<p class="course-grid-item__sessions"> | ||
{% if card.sessions %}<span>{{ card.sessions }}</span>{% endif %} | ||
{% if card.sessions and card.cost %} | {% endif %} | ||
{% if card.cost %}{{ card.cost }}{% endif %} | ||
</p> | ||
{% endif %} | ||
<h3 class="course-grid-item__title">{{ card.title }}</h3> | ||
<div class="course-grid-item__intro">{{ card.intro|richtext }}</div> | ||
<a href="{% pageurl card %}" class="course-grid-item__link">View details</a> | ||
</div> | ||
{% endfor %} | ||
</div> |
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
31 changes: 20 additions & 11 deletions
31
...ject_styleguide/templates/patterns/molecules/streamfield/blocks/course_outline_block.html
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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
{% load wagtailcore_tags %} | ||
|
||
{% if value.heading %} | ||
<h3>{{ value.heading }}</h3> | ||
{% endif %} | ||
<div class="course-outline"> | ||
{% if value.heading %} | ||
<h2 class="course-outline__heading">{{ value.heading }}</h2> | ||
{% endif %} | ||
|
||
<ol> | ||
{% for block in value.course_outline %} | ||
<li> | ||
<h2>{{ block.title }}</h2> | ||
{{ block.text|richtext }} | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
<ol class="course-outline__list"> | ||
{% for block in value.course_outline %} | ||
<li class="course-outline__list-item"> | ||
<svg class="course-outline__icon" aria-hidden="true"> | ||
<use xlink:href="#star" /> | ||
</svg> | ||
<div> | ||
<h3 class="course-outline__sub-heading" aria-label="{{ block.title }}"> | ||
{{ forloop.counter }}. {{ block.title }} | ||
</h3> | ||
{{ block.text|richtext }} | ||
</div> | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</div> |
17 changes: 13 additions & 4 deletions
17
...t_styleguide/templates/patterns/molecules/streamfield/blocks/external_link_cta_block.html
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 |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<a href="{{ value.link}}"> | ||
<h3>{{ value.heading }}</h3> | ||
<p>{{ value.text }}</p> | ||
</a> | ||
<div class="external-link-cta-wrapper"> | ||
<a class="external-link-cta" href="{{ value.link }}"> | ||
<div class="external-link-cta__overflow-hider"> | ||
<div class="external-link-cta__swish-background"></div> | ||
</div> | ||
<div class="external-link-cta__title-container"> | ||
<p class="external-link-cta__title">{{ value.heading }}</p> | ||
<div class="external-link-cta__chevron" aria-hidden="true"></div> | ||
</div> | ||
<p class="external-link-cta__text">{{ value.text }}</p> | ||
</a> | ||
</div> | ||
|
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
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
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
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,76 @@ | ||
.course-grid-item { | ||
padding: 25px; | ||
background-color: var(--color--grey-bg); | ||
border: 1px solid var(--color--grey-border-dark); | ||
|
||
@include media-query(medium-large) { | ||
padding: 50px; | ||
} | ||
|
||
&__sessions { | ||
@include font-size(xs); | ||
text-transform: uppercase; | ||
color: var(--color--grey); | ||
font-weight: $weight--bold; | ||
letter-spacing: 2px; | ||
margin-bottom: 10px; | ||
|
||
span { | ||
color: var(--color--coral); | ||
} | ||
} | ||
|
||
&__title { | ||
@include font-size(l); | ||
line-height: 32px; | ||
margin: 15px 0 10px; | ||
|
||
@include media-query(large) { | ||
line-height: 44px; | ||
} | ||
} | ||
|
||
&__intro { | ||
@include font-size(s); | ||
line-height: 27px; | ||
font-weight: $weight--normal; | ||
|
||
p { | ||
color: var(--color--grey-dark); | ||
} | ||
} | ||
|
||
&__link { | ||
@include font-size(s); | ||
line-height: 27px; | ||
color: var(--color--indigo); | ||
font-weight: $weight--bold; | ||
display: inline-block; | ||
position: relative; | ||
text-decoration: underline; | ||
text-decoration-color: var(--color--coral); | ||
text-underline-offset: 5px; | ||
border: 0; | ||
|
||
&:focus, | ||
&:hover { | ||
text-decoration-thickness: 5px; | ||
} | ||
|
||
&::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
right: -21px; | ||
top: 5px; | ||
width: 15px; | ||
height: 14px; | ||
background-color: var(--color--coral); | ||
clip-path: $arrow-path; | ||
|
||
@include hcm() { | ||
filter: invert(1); | ||
} | ||
} | ||
} | ||
} |
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,17 @@ | ||
.course-grid-title { | ||
@include font-size(ml); | ||
margin-bottom: 0; | ||
} | ||
|
||
.course-grid { | ||
display: grid; | ||
gap: 30px; | ||
margin: 25px 0 100px; | ||
|
||
@include media-query(medium-large) { | ||
grid-template-columns: repeat(2, 1fr); | ||
max-width: 1280px; | ||
gap: 50px; | ||
margin: 50px 0 120px; | ||
} | ||
} |
Oops, something went wrong.