Skip to content

Commit

Permalink
Merge pull request #4886 from DFE-Digital/CST-2438_update_admin_summa…
Browse files Browse the repository at this point in the history
…ry_page

[CST-2438] Update admin registration summary for 2024
  • Loading branch information
tonyheadford authored Jun 5, 2024
2 parents cc4a709 + 21b6b34 commit 4ba1f13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions app/controllers/admin/performance/overview_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ class OverviewController < Admin::BaseController
skip_after_action :verify_authorized, only: :show
skip_after_action :verify_policy_scoped, only: :show

# show 2023 pilot stats
# show active registration cohort stats
def show
@pilot_stats = get_pilot_stats
@pilot_stats = get_registration_stats
end

private

def get_pilot_stats
def get_registration_stats
choices = programme_choices

OpenStruct.new({
cohort:,
cip_total: choices.fetch("core_induction_programme", 0),
diy_total: choices.fetch("design_our_own", 0),
fip_total: choices.fetch("full_induction_programme", 0),
Expand Down Expand Up @@ -56,7 +57,7 @@ def valid_choices
end

def cohort
@cohort ||= Cohort.find_by(start_year: 2023)
@cohort ||= Cohort.active_registration_cohort
end
end
end
4 changes: 2 additions & 2 deletions app/views/admin/performance/overview/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<h1 class="govuk-heading-l">Overview</h1>

<table class="govuk-table govuk-!-margin-bottom-9">
<caption class="govuk-table__caption govuk-table__caption--m">Schools registered for 2023 to 2024</caption>
<caption class="govuk-table__caption govuk-table__caption--m">Schools registered for <%= @pilot_stats.cohort.description %></caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Training programme</th>
Expand Down Expand Up @@ -51,7 +51,7 @@


<table class="govuk-table">
<caption class="govuk-table__caption govuk-table__caption--m">Participants registered for 2023 to 2024</caption>
<caption class="govuk-table__caption govuk-table__caption--m">Participants registered for <%= @pilot_stats.cohort.description %></caption>
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Participant type</th>
Expand Down

0 comments on commit 4ba1f13

Please sign in to comment.