Skip to content

Commit

Permalink
394: Add low-fi view ECT record
Browse files Browse the repository at this point in the history
  • Loading branch information
edujackedu committed Oct 8, 2024
1 parent b559786 commit fc696e9
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
5 changes: 5 additions & 0 deletions app/helpers/appropriate_body_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
49 changes: 40 additions & 9 deletions app/views/appropriate_bodies/teachers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,31 +1,62 @@
<% page_data(title: Teachers::Name.new(@teacher).full_name, error: false) %>

<div class="govuk-button-group">
<%= 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)) %>
</div>

<h2 class="govuk-heading-m">Early career teacher<h2>

<%=
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
%>

<h2 class="govuk-heading-m">Induction history<h2>

<mark class="govuk-body">Add this later.</mark>
<%= 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 %>
14 changes: 14 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]").tap do |velma_dinkley|
Expand Down

0 comments on commit fc696e9

Please sign in to comment.