diff --git a/app/components/calls_to_action/adviser_component.html.erb b/app/components/calls_to_action/adviser_component.html.erb new file mode 100644 index 0000000000..7c55b6340e --- /dev/null +++ b/app/components/calls_to_action/adviser_component.html.erb @@ -0,0 +1,18 @@ +<%= tag.div(class: "adviser--border-top") if border %> +<%= tag.div class: classes do %> +
Talk to an adviser with years of teaching experience about your different training and funding options. Chat through phone, text or email, as little or as often as you need.
- - <%= link_to("Find out more about advisers", "/teacher-training-advisers", class: "button") %> - <% end %> -<% end %> +<%= render CallsToAction::AdviserComponent.new( + text: "Talk to an adviser with years of teaching experience about your different training and funding options. Chat through phone, text or email, as little or as often as you need.", + border: "adviser--border-top" +) %> diff --git a/app/webpacker/images/adviser-black.png b/app/webpacker/images/adviser-black.png new file mode 100644 index 0000000000..5e9bcb182b Binary files /dev/null and b/app/webpacker/images/adviser-black.png differ diff --git a/app/webpacker/styles/components/adviser.scss b/app/webpacker/styles/components/adviser.scss new file mode 100644 index 0000000000..6a1c654ddc --- /dev/null +++ b/app/webpacker/styles/components/adviser.scss @@ -0,0 +1,81 @@ +.adviser { + max-width: $content-max-width; + display: flex; + flex-direction: column; + gap: $indent-amount * .5; + margin: 0 auto; + background-color: $grey; + + @include mq($from: tablet) { + flex-direction: row; + margin: 0 auto; + gap: 2 * $indent-amount; + } + + @include mq($until: tablet) { + &--border-top { + display: none; + } + } + + @include mq($from: tablet) { + &--border-top { + display: block; + border-top: 1px solid $grey-mid; + padding-top: 3em; + margin: 0 auto; + max-width: $content-max-width; + } + } + + &:last-of-type { + margin-bottom: 3em; + } + + &__image { + height: 10em; + width: auto; + } + + &__left { + flex: 0 1 45%; + padding-block: 2em; + min-height: 8em; + background-color: $yellow; + padding: 1em; + align-content: center; + text-align: center; + } + + &__right { + flex: 0 1 55%; + align-items: flex-start; + display: flex; + flex-direction: column; + padding-right: $indent-amount; + padding-bottom: $indent-amount; + + @include mq($until: tablet) { + padding-left: $indent-amount; + } + + @include mq($from: tablet) { + padding-top: $indent-amount; + } + + p, + h2 { + margin-top: 0; + } + + label { + font-weight: bold; + display: block; + } + + label, + input { + margin-bottom: .4em; + } + } +} diff --git a/app/webpacker/styles/git.scss b/app/webpacker/styles/git.scss index bad8a9d641..9b360d2d88 100644 --- a/app/webpacker/styles/git.scss +++ b/app/webpacker/styles/git.scss @@ -34,6 +34,7 @@ @import "./sections/talk-to-us"; @import "./sections/action-container"; +@import "./components/adviser"; @import "./components/arrow"; @import "./components/aspect-ratio"; @import "./components/badge"; diff --git a/docs/content.md b/docs/content.md index 48c45d4444..e1c743ed68 100644 --- a/docs/content.md +++ b/docs/content.md @@ -7,31 +7,32 @@ This documentation aims to be a reference for content editors that want to make 1. [Setting up Codespaces and Github](#getting-started) 2. [Finding a Page/Content to Edit](#finding-a-pagecontent-to-edit) 3. [Content Editing Tips/Info](#content-editing-tips-info) - * [Headings](#headings) - * [Frontmatter](#frontmatter) - * [Breadcrumbs](#breadcrumbs) - * [Links](#links) - * [SEO](#seo) - * [Prevent Indexing](#prevent-indexing) - * [Adding a Document or Image](#adding-a-document-or-image) - * [Calls to Action](#calls-to-action) - * [Main Content](#main-content) - * [Sidebar](#sidebar) - * [Accessibility](#accessibility) - * [iframe](#iframe) - * [Inset text](#inset-text) - * [Details expander for non-UK content](#details-expander-for-non-uk-content) - * [YouTube Video](#youtube-video) - * [Hero](#hero) - * [Values](#values) + * [Headings](#headings) + * [Frontmatter](#frontmatter) + * [Breadcrumbs](#breadcrumbs) + * [Links](#links) + * [SEO](#seo) + * [Prevent Indexing](#prevent-indexing) + * [Adding a Document or Image](#adding-a-document-or-image) + * [Calls to Action](#calls-to-action) + * [Adviser (CTA) component](#adviser-cta-component) + * [Main Content](#main-content) + * [Sidebar](#sidebar) + * [Accessibility](#accessibility) + * [iframe](#iframe) + * [Inset text](#inset-text) + * [Details expander for non-UK content](#details-expander-for-non-uk-content) + * [YouTube Video](#youtube-video) + * [Hero](#hero) + * [Values](#values) 4. [Creating a subject page](#creating-a-subject-page) 5. [Creating an inspirational page](#creating-an-inspirational-page) 6. [Creating a Blog Post](#creating-a-blog-post) - * [Images](#images) - * [Footers](#footers) + * [Images](#images) + * [Footers](#footers) 7. [Navigation](#navigation) - * [Main Navigation](#main-navigation) - * [Category Pages](#category-pages) + * [Main Navigation](#main-navigation) + * [Category Pages](#category-pages) 8. [Build errors](#build-errors) 9. [Internship providers](#internship-providers) 10. [Creating a new page](#creating-a-new-page) @@ -334,6 +335,51 @@ If you need to insert an expander into an erb file: ) %> ``` + +### Adviser (CTA) component + +You can use the Adviser (Call to Action) component to create a call to action to invite users to sign up for the Get an Adviser service. You can use the component directly in markdown files, or in ERB-HTMl partials. It takes the following parameters and all are optional - if not specified a default value will be used: + +* title +* text +* image +* link_text +* link_target +* classes +* border + +```yaml +--- +cta_adviser: + adviser1: + title: "Optional title" + text: "Optional text" + image: "/optional/path/to/image" + link_text: "Optional link text" + link_target: "/optional/path" + classes: ["class1", "class2", "class3"] + border: true +--- + +# My page + +$adviser1$ +``` +Alternatively, if you need to insert an adviser component in an erb file, you can call it like this: + +```yaml +<%= render CallsToAction::AdviserComponent.new( + title: "Optional title", + text: "Optional text", + image: "/optional/path/to/image", + link_text: "Optional link text", + link_target: "/optional/path", + classes: ["class1", "class2", "class3"], + border: true +)%> +``` + + ### YouTube video To add a YouTube video to your content you need to know the video ID. You can find this out by visiting the video on [youtube.com](https://www.youtube.com/) and looking in the address bar of your browser (it is in the format `watch?v=