From fc696e985b75b0e7253bb1f55eec60e844cd091d Mon Sep 17 00:00:00 2001 From: Jack S Date: Tue, 8 Oct 2024 15:27:06 +0100 Subject: [PATCH] 394: Add low-fi view ECT record --- app/helpers/appropriate_body_helper.rb | 5 ++ .../appropriate_bodies/teachers/show.html.erb | 49 +++++++++++++++---- db/seeds.rb | 14 ++++++ 3 files changed, 59 insertions(+), 9 deletions(-) diff --git a/app/helpers/appropriate_body_helper.rb b/app/helpers/appropriate_body_helper.rb index e2efa5e0..bb5e358e 100644 --- a/app/helpers/appropriate_body_helper.rb +++ b/app/helpers/appropriate_body_helper.rb @@ -13,6 +13,11 @@ def induction_programme_choices ] end + def induction_programme_choice_name(identifier) + # FIXME: this is a temporary solution until we have real induction programme data + induction_programme_choices.find { |choice| choice.identifier == identifier }&.name + end + def induction_outcome_choices [ InductionProgrammeChoice.new(identifier: 'pass', name: 'Passed'), diff --git a/app/views/appropriate_bodies/teachers/show.html.erb b/app/views/appropriate_bodies/teachers/show.html.erb index fd5178a3..30291f78 100644 --- a/app/views/appropriate_bodies/teachers/show.html.erb +++ b/app/views/appropriate_bodies/teachers/show.html.erb @@ -1,8 +1,7 @@ <% page_data(title: Teachers::Name.new(@teacher).full_name, error: false) %>
- <%= govuk_button_link_to("Release ECT", new_ab_teacher_release_ect_path(@teacher), secondary: true) %> - <%= govuk_button_link_to("Record induction outcome", new_ab_teacher_record_outcome_path(@teacher), secondary: true) %> + <%= govuk_button_link_to("Record induction outcome", new_ab_teacher_record_outcome_path(@teacher)) %>

Early career teacher

@@ -10,22 +9,54 @@ <%= govuk_summary_list do |sl| sl.with_row do |row| - row.with_key(text: "Teacher record number") - row.with_value(text: @teacher.trn) + row.with_key(text: "Name") + row.with_value(text: Teachers::Name.new(@teacher).full_name) end sl.with_row do |row| - row.with_key(text: "First name") - row.with_value(text: @teacher.first_name) + row.with_key(text: "TRN") + row.with_value(text: @teacher.trn) end sl.with_row do |row| - row.with_key(text: "Last name") - row.with_value(text: @teacher.last_name) + row.with_key(text: "Induction status") + + # FIXME: This is a placeholder. The actual status should be displayed here. + row.with_value(text: govuk_tag(text: "placeholder", colour: %w[grey green red purple orange yellow].sample)) end end %>

Induction history

-Add this later. + <%= govuk_summary_list do |sl| + sl.with_row do |row| + row.with_key(text: "Induction start date") + row.with_value(text: Teachers::InductionPeriod.new(@teacher).induction_start_date&.to_fs(:govuk)) + end + end + + govuk_table do |table| + table.with_caption(size: 'm', text: '') + + table.with_head do |head| + head.with_row do |row| + row.with_cell(text: 'Appropriate body') + row.with_cell(text: 'Induction programme') + row.with_cell(text: 'Start date') + row.with_cell(text: 'End date') + row.with_cell(text: 'Number of terms', numeric: true) + end + end + table.with_body do |body| + @teacher.induction_periods_reported_by_appropriate_body.each do |induction_period | + body.with_row do |row| + row.with_cell(text: induction_period.appropriate_body.name) + row.with_cell(text: induction_programme_choice_name(induction_period.induction_programme)) + row.with_cell(text: induction_period.started_on.to_fs(:govuk)) + row.with_cell(text: induction_period.finished_on&.to_fs(:govuk)) + row.with_cell(text: induction_period.number_of_terms, numeric: true) + end + end + end + end %> diff --git a/db/seeds.rb b/db/seeds.rb index 2582e19d..8b4c7844 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -253,6 +253,20 @@ def describe_mentorship_period(mp) finished_on: nil ).tap { |mp| describe_mentorship_period(mp) } +print_seed_info("Harriet Walter (mentor)", indent: 2) + +PeriodBuilders::InductionPeriodBuilder.new( + appropriate_body: umber_teaching_school_hub, + teacher: harriet_walter, + school: abbey_grove_school +).build(started_on: 2.years.ago, finished_on: 1.year.ago) + +PeriodBuilders::InductionPeriodBuilder.new( + appropriate_body: golden_leaf_academy, + teacher: harriet_walter, + school: abbey_grove_school +).build(started_on: 1.year.ago) + print_seed_info("Adding persona users") User.create!(name: "Velma Dinkley (AB)", email: "velma@example.com").tap do |velma_dinkley|