-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sections to routes wizard completed page (#4490)
* WIP routes wizard logic * Completed matching logic for each route into teaching * Lint and exclude from orphan variables check * Ammend logic to support multiple answers to a question * WIP move logic to routes class * WIP adding tests * WIP adding tests * Add results box component * Add basic layout to completed page and add results boxes * Remove substitute values from most fields in results box * Amend routes mapping * Added not yet answers for routes mapping * WIP adding page layout * Added mailing list form component * Change case-when to hash to satisfy rubocop * Swap order of privacy policy and next step button * Improve error messaging and spacing of results cards * Add start page and extra spacing to bottom of mailer form submit button * Linting * Update app/views/routes_into_teaching/steps/completed.html.erb Co-authored-by: Gemma Dallman <87642394+gemmadallmandfe@users.noreply.github.com> * Stylelint fixes to results box css * Added default heading tag to QuoteWithImageComponent and changed ResultsBoxComponent to render a h3 * Fix renaming of quote with image component attribute --------- Co-authored-by: Gemma Dallman <87642394+gemmadallmandfe@users.noreply.github.com>
- Loading branch information
1 parent
a72a80a
commit ec47b7a
Showing
14 changed files
with
203 additions
and
35 deletions.
There are no files selected for viewing
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
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,31 @@ | ||
module RoutesIntoTeachingHelper | ||
def answers | ||
session[:routes_into_teaching] | ||
end | ||
|
||
def undergraduate_degree_summary | ||
{ | ||
"Yes" => "have a degree", | ||
"No" => "do not have a degree", | ||
"Not yet" => "are studying for a degree", | ||
}[answers["undergraduate_degree"]] | ||
end | ||
|
||
def unqualified_teacher_summary | ||
{ | ||
"Yes" => "have previously worked in a school", | ||
"No" => "haven't previously worked in a school", | ||
}[answers["unqualified_teacher"]] | ||
end | ||
|
||
def location_summary | ||
{ | ||
"Yes" => "live in England", | ||
"No" => "do not live in England", | ||
}[answers["location"]] | ||
end | ||
|
||
def non_uk? | ||
answers["location"] == "No" | ||
end | ||
end |
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
101 changes: 89 additions & 12 deletions
101
app/views/routes_into_teaching/steps/completed.html.erb
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,28 +1,105 @@ | ||
<%= render Content::LandingHeroComponent.new( | ||
title: "Routes into teaching", | ||
title: "Find your route into teaching", | ||
colour: "pastel yellow-yellow", | ||
) %> | ||
|
||
<section class="container"> | ||
<div class="row"> | ||
<h2>You told us that you:</h2> | ||
<div class="row inset"> | ||
<div class="col col-845"> | ||
<h2>You told us that you:</h2> | ||
|
||
<p>You can <%= link_to "change your answers", routes_into_teaching_steps_path %> if you need to.</p> | ||
<ul> | ||
<li><%= undergraduate_degree_summary %></li> | ||
<li><%= unqualified_teacher_summary %></li> | ||
<li><%= location_summary %></li> | ||
</ul> | ||
|
||
<% if non_uk? %> | ||
<%= render Content::ExpanderComponent.new( | ||
title: "visa sponsorship", | ||
text: "<p>If you do not have the right to study or work in the UK, you will need a visa. Your visa will need to be sponsored by a course provider.</p> | ||
<p><a href=\"/non-uk-teachers/visas-for-non-uk-trainees\">Learn more about applying for your visa to train to teach in England</a>.</p>", | ||
) %> | ||
<% end %> | ||
|
||
<p>You can <%= link_to "change your answers", routes_into_teaching_steps_path %> if you need to.</p> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<% @results.each do |result| %> | ||
<div class="col-space-s"> | ||
<%= render Content::ResultsBoxComponent.new( | ||
<div class="row inset"> | ||
<div class="col col-845"> | ||
<h2 class="heading--box-blue">Your options</h2> | ||
<p>Based on your answers, you may be eligible for the following teacher training options:</p> | ||
</div> | ||
</div> | ||
|
||
<div class="row inset"> | ||
<div class="col col-845"> | ||
<% @results.each do |result| %> | ||
<div class="col-space-s"> | ||
<%= render Content::ResultsBoxComponent.new( | ||
heading: result["title"], | ||
fee: result["course_fee"], | ||
course_length: result["course_length"], | ||
funding: result["funding"], | ||
text: result["description"], | ||
link_text: "Find out more", | ||
link_target: "/steps-to-become-a-teacher", | ||
link_text: result["cta_text"], | ||
link_target: result["cta_link"], | ||
) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<div class="row inset"> | ||
<div class="col col-845"> | ||
<h2 class="heading--box-blue">Next steps</h2> | ||
|
||
<%= render CallsToAction::SimpleComponent.new(icon: "icon-arrow-black") do %> | ||
<h3 class="call-to-action__heading">Get personalised guidance</h3> | ||
<p>Everything you need to know to start a career in teaching sent straight into your inbox. Tailored to your own situation, you'll get all the latest information as well as advice and support.</p> | ||
|
||
<div class="row col-space-m"> | ||
<%= form_with builder: GOVUKDesignSystemFormBuilder::FormBuilder, url: mailing_list_step_path(:name), scope: :mailing_list_steps_name, method: :put do |f| %> | ||
<%= f.govuk_text_field :first_name, autocomplete: "given-name" %> | ||
<%= f.govuk_text_field :last_name, autocomplete: "family-name" %> | ||
<%= f.govuk_email_field :email, autocomplete: "email" %> | ||
<%= f.hidden_field :channel_id, value: params[:channel] || f.object&.channel_id.presence %> | ||
<%= f.hidden_field :sub_channel_id, value: params[:sub_channel] || f.object&.sub_channel_id.presence %> | ||
<%= f.hidden_field :accepted_policy_id, value: @privacy_policy.id %> | ||
<div class="row col-space-s col-space-s-top"> | ||
<small> | ||
Your details are protected under the terms of our <%= link_to("privacy notice (opens in new tab)", "/privacy-policy", { class: "link--black", target: :blank }) %>. This explains how we use your personal data. It's important you read it before signing up to receive emails. | ||
</small> | ||
</div> | ||
<%= f.button "Next step", class: "button", data: { "prevent-double-click": true, "disable-with": "Next step" } %> | ||
<% end %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<div class="row"> | ||
<div class="col-space-l-top"> | ||
<% if non_uk? %> | ||
<%= render Content::QuoteWithImageComponent.new( | ||
title: "Teaching as a non-uk...", | ||
text: "<p>Visit the non-uk section...</p><p><a href=\"/non-uk-teachers\">Read about becoming a teacher as a non-uk citizen</a></p>", | ||
quotes: false, | ||
background_color: "pink", | ||
heading_color: "green", | ||
image_path: "static/images/content/hero-images/0034.jpg" | ||
) %> | ||
<% else %> | ||
<%= render Content::QuoteWithImageComponent.new( | ||
title: "Teacher training stories", | ||
text: "<p>\"My influence and decisions are ultimately impacting on our pupils' lives and the experience that they have at school.\"</p><p><a href=\"/life-as-a-teacher/teaching-as-a-career/abigails-career-progression-story\">Read Abigail's career progression story</a>.</p>", | ||
quotes: true, | ||
background_color: "blue", | ||
heading_color: "pink", | ||
image_path: "static/images/content/case-studies/abigail.jpg" | ||
) %> | ||
<% end %> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<%= render Content::LandingHeroComponent.new( | ||
title: "Find your route into teaching", | ||
colour: "pastel yellow-yellow", | ||
) %> | ||
|
||
<section class="container"> | ||
<div class="row"> | ||
<%= link_to "Find your route into teaching", routes_into_teaching_step_path(RoutesIntoTeaching::Wizard.steps.first.key) %> | ||
</div> | ||
</section> |
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
Oops, something went wrong.