Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New header component for landing pages #3942

Merged
merged 29 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f2280d0
Initial go at trying header designers. Still wip. Commiting so don't …
jenhadfield-dfe Apr 10, 2024
fbc52dc
Fixed title z index on mobile and image margin.
jenhadfield-dfe Apr 10, 2024
a42b0b7
Changed markup as was wrong
jenhadfield-dfe Apr 11, 2024
d3ed4fd
Fixed linting errors (I think!). Remove unnecessary style rule.
jenhadfield-dfe Apr 11, 2024
ffcc264
Hopeful linting fix
jenhadfield-dfe Apr 11, 2024
9c7486d
More linting fixes
jenhadfield-dfe Apr 11, 2024
81bb669
updating image to larger hero sized image
jenhadfield-dfe Apr 11, 2024
818fc73
reduced height of banner and adjusted line height on the text
jenhadfield-dfe Apr 11, 2024
5997518
removed the join array bit as not needed
jenhadfield-dfe Apr 12, 2024
753befc
removing html safe to try and fix linting error
jenhadfield-dfe Apr 12, 2024
ce2585c
trying to use variables for colours on markdown files
jenhadfield-dfe Apr 19, 2024
9b3902d
update to spec file
jenhadfield-dfe Apr 19, 2024
3d39cc7
Implementing new header component on slanting header pages
mariosh-e Apr 19, 2024
fb2d072
Updated Landing Hero Component so can change colours in the headers f…
jenhadfield-dfe Apr 19, 2024
8c29ff1
Updated colours and higher res images
jenhadfield-dfe Apr 19, 2024
747157d
colour change to subject pages
jenhadfield-dfe Apr 19, 2024
db49740
Sorted image fitting in css. Added inline margin to some pages. Campu…
jenhadfield-dfe Apr 19, 2024
6962a25
tidying up some bits of code
jenhadfield-dfe Apr 22, 2024
b7b42d1
updating so colours can be declared in markdown files. added fallback…
jenhadfield-dfe Apr 30, 2024
12c346e
removing background colour from spec test file
jenhadfield-dfe Apr 30, 2024
ad99e93
Trying to fix landing hero spec file and fixed css linting
jenhadfield-dfe Apr 30, 2024
9b5598d
Linting fixes & updated missed page
jenhadfield-dfe Apr 30, 2024
7c09562
update image to higher res
jenhadfield-dfe May 1, 2024
04d955c
Style updates, removed inline styles from pages and updated landing h…
jenhadfield-dfe May 1, 2024
7dccf0c
Updated font sizes and padding to rem. Smaller heading size on mobile…
jenhadfield-dfe May 1, 2024
5e63e99
putting the image back - it's references elsewhere and not sure how t…
jenhadfield-dfe May 1, 2024
409b420
adjusting line height
jenhadfield-dfe May 3, 2024
1fba1af
update colours for food for thought page
jenhadfield-dfe May 9, 2024
9e48fe0
removing inline styles
jenhadfield-dfe May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions app/components/content/landing_hero_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<%= tag.header(class: classes) do %>

<%= header_image %>

<%= tag.div(class: header_image ? "content" : "content wide") do %>

<%= tag.h1(class: "title") do %>
<% Array.wrap(title).each do |p| %>
<%= tag.span(p) %>
<% end %>
<% end %>

<% if show_title_paragraph? %>
<%= tag.p(title_paragraph, class: "title_paragraph") %>
<% end %>

<% end %>

<% end %>
27 changes: 27 additions & 0 deletions app/components/content/landing_hero_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module Content
class LandingHeroComponent < ViewComponent::Base
attr_accessor :colour, :image, :title, :title_paragraph

def initialize(colour:, image:, title:, title_paragraph: nil)
super
@colour = colour
@image = image
@title = title
@title_paragraph = title_paragraph
end

def header_image
image_pack_tag(@image, **helpers.image_alt_attribs(@image)) if @image
end

def show_title_paragraph?
@title_paragraph.present?
end

def classes
%w[landing-hero].tap do |c|
c << colour if colour
end
end
end
end
2 changes: 1 addition & 1 deletion app/views/content/events/get-the-most-from-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ content:
- content/events/get-the-most-from-events/steps
- content/events/get-the-most-from-events/content
image: "static/images/content/events/teaching-event.jpeg"
colour: "yellow"
layout: "layouts/minimal"
colour: pastel yellow-yellow
talk_to_us: false
noindex: true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Get the most", "from an event"],
<%= render Content::LandingHeroComponent.new(
title: "Get the most from an event",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row">
<div class="inset">
<div class="inset col-space-l-top">
<section class="col col-720 centered">

<p>
Expand Down
4 changes: 2 additions & 2 deletions app/views/content/explore-teaching-advisers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: Explore teaching advisers
description: |-
Find out if teaching is for you with an explore teaching adviser who can help you discover what teaching is really like.
layout: "layouts/minimal"
colour: "yellow"
image: "static/images/content/ttalianne.jpg"
jenhadfield-dfe marked this conversation as resolved.
Show resolved Hide resolved
colour: pastel yellow-yellow
image: "static/images/content/campus-advisers/adviser.jpeg"
keywords:
- explore teaching advisers
- adviser
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row inset">
<section class="col col-720 statement">
<section class="col col-720 statement col-space-l-top">
<div>
<span class="pink xlarge bold">Teaching is&hellip;</span>
</div>
Expand Down
6 changes: 3 additions & 3 deletions app/views/content/explore-teaching-advisers/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Explore", "teaching", "advisers"],
<%= render Content::LandingHeroComponent.new(
title: "Explore teaching advisers",
colour: @front_matter["colour"],
image: @front_matter["image"]
image: @front_matter["image"],
) %>
2 changes: 1 addition & 1 deletion app/views/content/is-teaching-right-for-me/computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ navigation: 5.43
navigation_title: Computing
navigation_description: Discover how computing is vital, helping children learn digital skills they'll need throughout life.
layout: "layouts/minimal"
colour: "yellow"
colour: pastel yellow-yellow
image: "static/images/content/hero-images/0036.jpg"
keywords:
- computing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row inset">
<section class="col col-720">
<section class="col col-720 col-space-l-top">
<p>As a secondary computing teacher you'll help pupils become responsible and confident users of information and technology in an increasingly digital world.</p>
<p>Whether it's teaching your pupils about artificial intelligence (AI) or creating apps, you could inspire them to look at a future role in tech.</p>
<p>Tax-free bursaries of £28,000 or scholarships of £30,000 are available for eligible trainee computing teachers.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Become a", "computing teacher"],
<%= render Content::LandingHeroComponent.new(
title: "Become a computing teacher",
colour: @front_matter["colour"],
image: @front_matter["image"]
) %>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: |-
Find out more about the Engineers teach physics teacher training programme for engineers and material scientists who want to teach physics.
layout: "layouts/minimal"
colour: "yellow"
colour: pastel yellow-yellow
image: "static/images/content/hero-images/0013.jpg"
keywords:
- engineers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="row inset">
<div class="row inset" style="margin-top:60px">
<section class="col col-720 col-space-m statement">
martyn-w marked this conversation as resolved.
Show resolved Hide resolved
<div>
<span class="pink xlarge bold">Physics initial teacher training courses for</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Engineers teach", "physics"],
<%= render Content::LandingHeroComponent.new(
title: "Engineers teach physics",
colour: @front_matter["colour"],
image: @front_matter["image"]
) %>
2 changes: 1 addition & 1 deletion app/views/content/is-teaching-right-for-me/maths.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ navigation: 5.46
navigation_title: Maths
navigation_description: Find out how to become a maths teacher and show children the importance of maths in everything we do.
layout: "layouts/minimal"
colour: "yellow"
colour: pastel yellow-yellow
image: "static/images/content/hero-images/0004.jpg"
keywords:
- maths
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="row inset">
<div class="row inset" style="margin-top:60px">
<section class="col col-720">
martyn-w marked this conversation as resolved.
Show resolved Hide resolved
<p>
If maths is your passion, you'll know that it's not just learning formulas or solving equations. It's a way of thinking and problem solving that’s important in every walk of life.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Become a", "maths teacher"],
<%= render Content::LandingHeroComponent.new(
title: "Become a maths teacher",
colour: @front_matter["colour"],
image: @front_matter["image"]
) %>
2 changes: 1 addition & 1 deletion app/views/content/is-teaching-right-for-me/physics.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ navigation: 5.48
navigation_title: Physics
navigation_description: Find out how to become a physics teacher and inspire the next generation of scientists, engineers and innovators.
layout: "layouts/minimal"
colour: "yellow"
colour: pastel yellow-yellow
image: "static/images/content/hero-images/physics_1383.jpg"
keywords:
- physics
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Become a", "physics teacher"],
<%= render Content::LandingHeroComponent.new(
title: "Become a physics teacher",
colour: @front_matter["colour"],
image: @front_matter["image"]
) %>
2 changes: 1 addition & 1 deletion app/views/content/landing/campus-advisers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ content:
- content/landing/campus-advisers/header
- content/landing/campus-advisers/adviser
image: "static/images/content/campus-advisers/adviser.jpeg"
colour: "pink"
layout: "layouts/minimal"
colour: pink-yellow
talk_to_us: false
noindex: true
---
5 changes: 2 additions & 3 deletions app/views/content/landing/campus-advisers/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Sign up for an", "adviser"],
<%= render Content::LandingHeroComponent.new(
title: "Sign up for an adviser",
colour: @front_matter["colour"],
jenhadfield-dfe marked this conversation as resolved.
Show resolved Hide resolved
image: @front_matter["image"],
background_colour: "grey"
) %>
4 changes: 2 additions & 2 deletions app/views/content/landing/campus-mailing-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: Free advice and support on how to become a teacher. Get the latest
content:
- content/landing/campus-mailing-list/header
- content/landing/campus-mailing-list/mailing-list
image: "static/images/content/landing/how-to-fund-your-teacher-training-1.jpg"
colour: "pink"
image: "static/images/content/hero-images/chemistry.jpg"
colour: pink-yellow
layout: "layouts/minimal"
talk_to_us: false
noindex: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Sign up for", "emails"],
<%= render Content::LandingHeroComponent.new(
title: "Sign up for emails",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row">
<div class="grey col-space-l">
<div class="grey">
<section class="col col-720 col-space-0">
<%= render Content::MailingListComponent.new(
title: "We'll help you do the homework before becoming a teacher",
Expand Down
2 changes: 1 addition & 1 deletion app/views/content/landing/careers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ content:
- content/landing/careers/content
- content/landing/careers/promo
image: "static/images/content/hero-images/0029.jpg"
colour: "yellow"
layout: "layouts/minimal"
colour: pink-blue
talk_to_us: false
noindex: true
---
7 changes: 3 additions & 4 deletions app/views/content/landing/careers/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["You're more of a teacher than", "you think"],
colour: "grow",
<%= render Content::LandingHeroComponent.new(
title: "You're more of a teacher than you think",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
2 changes: 1 addition & 1 deletion app/views/content/landing/food-for-thought.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ content:
- content/landing/food-for-thought/quotes
- content/landing/food-for-thought/promo
image: "static/images/content/hero-images/cake.png"
colour: "yellow"
layout: "layouts/minimal"
colour: pink-blue
jenhadfield-dfe marked this conversation as resolved.
Show resolved Hide resolved
noindex: true
---
6 changes: 3 additions & 3 deletions app/views/content/landing/food-for-thought/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Food for", "thought"],
<%= render Content::LandingHeroComponent.new(
title: "Food for thought",
colour: @front_matter["colour"],
image: @front_matter["image"]
image: @front_matter["image"],
) %>
2 changes: 1 addition & 1 deletion app/views/content/landing/grow.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ content:
- content/landing/grow/content
- content/landing/grow/promo
image: "static/images/content/hero-images/0027.jpg"
colour: "yellow"
layout: "layouts/minimal"
colour: pink-blue
talk_to_us: false
noindex: true
---
7 changes: 3 additions & 4 deletions app/views/content/landing/grow/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Grow as only", "a teacher can"],
colour: "grow",
<%= render Content::LandingHeroComponent.new(
title: "Grow as only a teacher can",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
4 changes: 2 additions & 2 deletions app/views/content/landing/how-much-do-teachers-get-paid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ content:
- content/landing/how-much-do-teachers-get-paid/mailing_list
- content/landing/how-much-do-teachers-get-paid/content
- content/landing/how-much-do-teachers-get-paid/promo
image: "static/images/content/landing/how-much-do-teachers-get-paid-1.jpg"
colour: "yellow"
image: "static/images/content/hero-images/science.jpg"
colour: "pink-blue"
layout: "layouts/minimal"
talk_to_us: false
noindex: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["How much do teachers", "get paid?"],
colour: "grow",
image: @front_matter["image"],
background_colour: "grey"
<%= render Content::LandingHeroComponent.new(
title: "How much do teachers get paid?",
colour: @front_matter["colour"],
image: @front_matter["image"]
) %>
4 changes: 2 additions & 2 deletions app/views/content/landing/how-to-become-a-teacher.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ content:
- content/landing/how-to-become-a-teacher/steps
- content/landing/how-to-become-a-teacher/content
- content/landing/how-to-become-a-teacher/promo
image: "static/images/content/landing/how-to-become-a-teacher-1.jpg"
colour: "yellow"
image: "static/images/content/hero-images/0031.jpg"
layout: "layouts/minimal"
colour: pink-blue
talk_to_us: false
noindex: true
---
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["How to become", "a teacher"],
colour: "grow",
<%= render Content::LandingHeroComponent.new(
title: "How to become a teacher",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ content:
- content/landing/how-to-fund-your-teacher-training/mailing_list
- content/landing/how-to-fund-your-teacher-training/content
- content/landing/how-to-fund-your-teacher-training/promo
image: "static/images/content/landing/how-to-fund-your-teacher-training-1.jpg"
colour: "yellow"
image: "static/images/content/hero-images/chemistry.jpg"
layout: "layouts/minimal"
colour: pink-blue
talk_to_us: false
noindex: true
---
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Fund your", "teacher training"],
colour: "grow",
<%= render Content::LandingHeroComponent.new(
title: "Fund your teacher training",
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
1 change: 0 additions & 1 deletion app/views/content/landing/mailing-list-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ content:
- content/landing/mailing-list-1/header
- content/landing/mailing-list-1/mailing-list
image: "static/images/content/hero-images/0027.jpg"
colour: "grow"
layout: "layouts/minimal"
talk_to_us: false
noindex: true
Expand Down
7 changes: 3 additions & 4 deletions app/views/content/landing/mailing-list-1/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Get personalised", "guidance"],
colour: @front_matter["colour"],
<%= render Content::LandingHeroComponent.new(
title: "Get personalised guidance",
colour: "pink-blue",
image: @front_matter["image"],
background_colour: "grey"
) %>
2 changes: 1 addition & 1 deletion app/views/content/landing/mailing-list-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Free advice and support on how to become a teacher. Get the latest
content:
- content/landing/mailing-list-2/header
- content/landing/mailing-list-2/mailing-list
colour: "grow"
colour: pink-blue
layout: "layouts/minimal"
talk_to_us: false
noindex: true
Expand Down
5 changes: 2 additions & 3 deletions app/views/content/landing/mailing-list-2/_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<%= render Content::CampaignHeroComponent.new(
title: ["Get personalised", "guidance"],
<%= render Content::LandingHeroComponent.new(
title: "Get personalised guidance",
jenhadfield-dfe marked this conversation as resolved.
Show resolved Hide resolved
colour: @front_matter["colour"],
image: @front_matter["image"],
background_colour: "grey"
) %>
Loading
Loading