From 10fcd8bef7e45eb1473d8c864617365eadd6b458 Mon Sep 17 00:00:00 2001 From: James Griffiths Date: Tue, 8 Oct 2024 18:16:30 +0100 Subject: [PATCH] EHD-1050: View Report for Year page: Remove unused code --- .../BonusPay/BonusDiffTextViewModel.cs | 19 --- .../BonusPay/BonusProportionTextViewModel.cs | 17 --- .../EmployerDetailsViewModel.cs | 13 -- .../Viewing/PayQuartileBarChartModel.cs | 15 -- .../Models/Viewing/VerticalBarChartModel.cs | 37 ----- .../Views/Shared/AboutHourlyRate.cshtml | 25 ---- .../Views/Shared/AboutQuartiles.cshtml | 6 - .../BonusPay/BonusDiffText.cshtml | 22 --- .../BonusPay/BonusPaySection.cshtml | 141 ------------------ .../BonusPay/BonusProportionText.cshtml | 14 -- .../HourlyRate/HourlyRateSection.cshtml | 113 -------------- .../Quartiles/QuartilesBarChart.cshtml | 24 --- .../Quartiles/QuartilesSection.cshtml | 97 ------------ .../Viewing/EmployerDetails/Report.cshtml | 138 ----------------- .../EmployerDetails/VerticalBarChart.cshtml | 31 ---- 15 files changed, 712 deletions(-) delete mode 100644 GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusDiffTextViewModel.cs delete mode 100644 GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusProportionTextViewModel.cs delete mode 100644 GenderPayGap.WebUI/Models/Viewing/EmployerDetails/EmployerDetailsViewModel.cs delete mode 100644 GenderPayGap.WebUI/Models/Viewing/PayQuartileBarChartModel.cs delete mode 100644 GenderPayGap.WebUI/Models/Viewing/VerticalBarChartModel.cs delete mode 100644 GenderPayGap.WebUI/Views/Shared/AboutHourlyRate.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Shared/AboutQuartiles.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusDiffText.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusPaySection.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusProportionText.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/HourlyRate/HourlyRateSection.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesBarChart.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesSection.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Report.cshtml delete mode 100644 GenderPayGap.WebUI/Views/Viewing/EmployerDetails/VerticalBarChart.cshtml diff --git a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusDiffTextViewModel.cs b/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusDiffTextViewModel.cs deleted file mode 100644 index dfb686994..000000000 --- a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusDiffTextViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace GenderPayGap.WebUI.Models.Viewing -{ - public class BonusDiffTextViewModel - { - - public string Id { get; set; } - - public string Statistic { get; set; } - - public decimal Percent { get; set; } - - public string Compare { get; set; } - - public bool WomenReceivedBonuses { get; set; } - - public bool MenReceivedBonuses { get; set; } - - } -} diff --git a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusProportionTextViewModel.cs b/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusProportionTextViewModel.cs deleted file mode 100644 index a17545893..000000000 --- a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/BonusPay/BonusProportionTextViewModel.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace GenderPayGap.WebUI.Models.Viewing -{ - public class BonusProportionTextViewModel - { - - public string Id { get; set; } - - public string Gender { get; set; } - - public decimal Percent { get; set; } - - public bool WomenReceivedBonuses { get; set; } - - public bool MenReceivedBonuses { get; set; } - - } -} diff --git a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/EmployerDetailsViewModel.cs b/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/EmployerDetailsViewModel.cs deleted file mode 100644 index 507c68737..000000000 --- a/GenderPayGap.WebUI/Models/Viewing/EmployerDetails/EmployerDetailsViewModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace GenderPayGap.WebUI.Models -{ - public class EmployerDetailsViewModel - { - - public Database.Organisation Organisation { get; set; } - - public int? CurrentPage { get; set; } - public int? TotalPages { get; set; } - public int? EntriesPerPage { get; set; } - - } -} diff --git a/GenderPayGap.WebUI/Models/Viewing/PayQuartileBarChartModel.cs b/GenderPayGap.WebUI/Models/Viewing/PayQuartileBarChartModel.cs deleted file mode 100644 index 387e65111..000000000 --- a/GenderPayGap.WebUI/Models/Viewing/PayQuartileBarChartModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace GenderPayGap.WebUI.Models.Viewing -{ - public class PayQuartileBarChartModel - { - - public string Id { get; set; } - public string Title { get; set; } - public string SecondaryTitle { get; set; } - public decimal Male { get; set; } - public decimal Female { get; set; } - public string MaleFormatted => string.Format("{0:0.#}", Male); - public string FemaleFormatted => string.Format("{0:0.#}", Female); - - } -} diff --git a/GenderPayGap.WebUI/Models/Viewing/VerticalBarChartModel.cs b/GenderPayGap.WebUI/Models/Viewing/VerticalBarChartModel.cs deleted file mode 100644 index 77a6665cf..000000000 --- a/GenderPayGap.WebUI/Models/Viewing/VerticalBarChartModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -namespace GenderPayGap.WebUI.Models.Viewing -{ - public class VerticalBarChartModel - { - - public string Id { get; set; } - public decimal Male { get; set; } - public decimal Female { get; set; } - public decimal Delta => FemaleIsLower ? 100 - Female : 100 - Male; - - public string DeltaMonetisation - { - get - { - decimal deltaRounded = Math.Round(Delta); - if (Female == Male) - { - return "0p"; - } - - if (deltaRounded < 100) - { - return $"{deltaRounded}p"; - } - - return $"£{string.Format("{0:#.00}", deltaRounded / 100)}"; - } - } - - public bool FemaleIsLower { get; set; } - public string MaleMonetisation { get; set; } - public string FemaleMonetisation { get; set; } - - } -} diff --git a/GenderPayGap.WebUI/Views/Shared/AboutHourlyRate.cshtml b/GenderPayGap.WebUI/Views/Shared/AboutHourlyRate.cshtml deleted file mode 100644 index 376ca5aa8..000000000 --- a/GenderPayGap.WebUI/Views/Shared/AboutHourlyRate.cshtml +++ /dev/null @@ -1,25 +0,0 @@ -

- The median gender pay gap figure -

-

- This is the difference between the hourly pay of the median man and the hourly pay of the median woman. The median for each is the man or woman who is in the middle of a list of hourly pay ordered from highest to lowest paid. -

-

- A median involves listing all of the numbers in numerical order. If there is an odd number of results, the median is the middle number. If there is an even number of results, the median will be the mean of the two central numbers. -

-

- Medians are useful to indicate what the ‘typical’ situation is. They are not distorted by very high or low hourly pay (or bonuses). However, this means that not all gender pay gap issues will be picked up. They could also fail to pick up as effectively where the gender pay gap issues are most pronounced in the lowest paid or highest paid employees. -

- -

- The mean (average) gender pay gap figure -

-

- The mean gender pay gap figure uses hourly pay of all employees to calculate the difference between the mean hourly pay of men, and the mean hourly pay of women. -

-

- A mean involves adding up all of the numbers and dividing the result by how many numbers were in the list. -

-

- Mean averages are useful because they place the same value on every number they use, giving a good overall indication of the gender pay gap. But very high or low hourly pay can ‘dominate’ and distort the figure. -

diff --git a/GenderPayGap.WebUI/Views/Shared/AboutQuartiles.cshtml b/GenderPayGap.WebUI/Views/Shared/AboutQuartiles.cshtml deleted file mode 100644 index fd3bf3934..000000000 --- a/GenderPayGap.WebUI/Views/Shared/AboutQuartiles.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -

- Pay quarters show the percentage of men and women employees in four equal sized groups based on their hourly pay. -

-

- Pay quarters give an indication of women's representation at different levels of the organisation. -

diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusDiffText.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusDiffText.cshtml deleted file mode 100644 index 53581a6eb..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusDiffText.cshtml +++ /dev/null @@ -1,22 +0,0 @@ -@model GenderPayGap.WebUI.Models.Viewing.BonusDiffTextViewModel - -@if (Model.WomenReceivedBonuses || Model.MenReceivedBonuses) -{ -
-
- @if (Model.MenReceivedBonuses) - { - When comparing @(Model.Statistic) (average) bonus pay, women’s @(Model.Statistic) bonus pay is - - @(string.Format("{0:0.#}", Model.Percent))% - @(Model.Compare) - - than men’s. - } - else - { - Only women received bonuses. - } -
-
-} diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusPaySection.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusPaySection.cshtml deleted file mode 100644 index 8c8d43037..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusPaySection.cshtml +++ /dev/null @@ -1,141 +0,0 @@ -@using GenderPayGap.WebUI.Models.Viewing -@using Microsoft.AspNetCore.Mvc.TagHelpers -@model GenderPayGap.Database.Return - -@{ - decimal diffMedianBonus = Model.DiffMedianBonusPercent.HasValue ? Model.DiffMedianBonusPercent.Value : 0; - bool femaleHasLowerMedianBonusPay = Model.DiffMedianBonusPercent == null || Model.DiffMedianBonusPercent >= 0; - bool femaleHasLowerMeanBonusPay = Model.DiffMeanBonusPercent == null || Model.DiffMeanBonusPercent >= 0; - bool menReceivedBonuses = Model.MaleMedianBonusPayPercent != 0; - bool womenReceivedBonuses = Model.FemaleMedianBonusPayPercent != 0; - - decimal FemaleMoneyFromMedianBonusPay() - { - if (Model.DiffMedianBonusPercent == null) - { - return 0; - } - - return femaleHasLowerMedianBonusPay ? 100 - Model.DiffMedianBonusPercent.Value : 100 + Math.Abs(Model.DiffMedianBonusPercent.Value); - } - - string FemaleMedianBonusPayMonitised() - { - decimal roundedRate = Math.Round(FemaleMoneyFromMedianBonusPay()); - if (roundedRate < 100) - { - return $"{roundedRate}p"; - } - - if (roundedRate == 100) - { - return "£1"; - } - - return $"£{string.Format("{0:#.00}", roundedRate / 100)}"; - } - - - var medianBonusChartModel = new VerticalBarChartModel - { - Id = "MedianBonusDiffChart", - FemaleIsLower = femaleHasLowerMedianBonusPay, - Male = femaleHasLowerMedianBonusPay ? 100 : 100 + diffMedianBonus, - Female = femaleHasLowerMedianBonusPay ? 100 - diffMedianBonus : 100, - MaleMonetisation = "£1", - FemaleMonetisation = FemaleMedianBonusPayMonitised() - }; - - // calculates the median bonus pay text to display - - // mean bonus difference - var diffMeanBonusText = new BonusDiffTextViewModel - { - Id = "DiffMeanBonusPercent", - Compare = femaleHasLowerMeanBonusPay ? "lower" : "higher", - Percent = Math.Abs(Model.DiffMeanBonusPercent.HasValue ? Model.DiffMeanBonusPercent.Value : 0), - Statistic = "mean", - MenReceivedBonuses = menReceivedBonuses, - WomenReceivedBonuses = womenReceivedBonuses - }; - - // who received bonuses - var femaleBonusPayText = new BonusProportionTextViewModel - { - Id = "FemaleBonusPayText", - Percent = Model.FemaleMedianBonusPayPercent, - Gender = "women", - MenReceivedBonuses = menReceivedBonuses, - WomenReceivedBonuses = womenReceivedBonuses - }; - - var maleBonusPayText = new BonusProportionTextViewModel - { - Id = "MaleBonusPayText", - Percent = Model.MaleMedianBonusPayPercent, - Gender = "men", - MenReceivedBonuses = menReceivedBonuses, - WomenReceivedBonuses = womenReceivedBonuses - }; -} - -
- -
-
-

Bonus pay gap

-
-
- - @if (menReceivedBonuses) - { -
-
- - In this organisation, women earn @FemaleMedianBonusPayMonitised() - for every £1 - that men earn when comparing median bonus pay. - - Their median bonus pay is @(string.Format("{0:0.#}", Math.Abs(diffMedianBonus)))% - - @(femaleHasLowerMedianBonusPay ? "lower" : "higher") - than men’s. - -
-
- - - } - - - -
-
-

Who received bonus pay

-
-
- -
-
- @if (womenReceivedBonuses || menReceivedBonuses) - { - - - } - else - { - No bonuses were paid. - } -
-
-
diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusProportionText.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusProportionText.cshtml deleted file mode 100644 index ed85f9a0b..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/BonusPay/BonusProportionText.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@model GenderPayGap.WebUI.Models.Viewing.BonusProportionTextViewModel -
- @if (Model.Percent != 0) - { - - @(string.Format("{0:0.#}", Model.Percent))% - - of @(Model.Gender) - } - else - { - No @(Model.Gender) received a bonus. - } -
diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/HourlyRate/HourlyRateSection.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/HourlyRate/HourlyRateSection.cshtml deleted file mode 100644 index d3d020dd6..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/HourlyRate/HourlyRateSection.cshtml +++ /dev/null @@ -1,113 +0,0 @@ -@using GenderPayGap.WebUI.Models.Shared -@using GenderPayGap.WebUI.Models.Viewing -@using Microsoft.AspNetCore.Mvc.TagHelpers -@model GenderPayGap.Database.Return - -@{ - bool femaleHasLowerMeanHourlyPercent = Model.DiffMeanHourlyPayPercent >= 0; - bool femaleHasLowerMedianHourlyPercent = Model.DiffMedianHourlyPercent >= 0; - - decimal FemaleMoneyFromMedianHourlyRate() - { - return femaleHasLowerMedianHourlyPercent - ? 100 - Model.DiffMedianHourlyPercent - : 100 + Math.Abs(Model.DiffMedianHourlyPercent); - } - - string FemaleMedianHourlyRateMonitised() - { - decimal femaleMoneyFromMedianHourlyRate = FemaleMoneyFromMedianHourlyRate(); - - decimal roundedRate = Math.Round(femaleMoneyFromMedianHourlyRate); - if (roundedRate < 100) - { - return $"{roundedRate}p"; - } - - if (roundedRate == 100) - { - return "£1"; - } - - return $"£{string.Format("{0:#.00}", roundedRate / 100)}"; - } -} - -
-
-
-

- Hourly pay gap -

- -
-
- - In this organisation, women earn @FemaleMedianHourlyRateMonitised() - for every £1 that men earn when comparing median hourly pay. - - Their median hourly pay is @(string.Format("{0:0.#}", Math.Abs(Model.DiffMedianHourlyPercent)))% - - @(femaleHasLowerMedianHourlyPercent ? "lower" : "higher") - than men’s. - -
-
- - - -
-
- When comparing mean (average) hourly pay, - women’s mean hourly pay is @(string.Format("{0:0.#}", Math.Abs(Model.DiffMeanHourlyPayPercent)))% - - @(femaleHasLowerMeanHourlyPercent ? "lower" : "higher") - than men’s. - -
-
- -
-
- -
- - - About median and mean - - -
- -
-
- -
-
-
- -
-
-
diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesBarChart.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesBarChart.cshtml deleted file mode 100644 index b09177dcf..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesBarChart.cshtml +++ /dev/null @@ -1,24 +0,0 @@ -@model GenderPayGap.WebUI.Models.Viewing.PayQuartileBarChartModel -
-
- @Model.Title - @if (string.IsNullOrEmpty(Model.SecondaryTitle) == false) - { - @(Model.SecondaryTitle) - } -
- -
-
-
- -
-
- @(Model.FemaleFormatted)%   of the @Model.Title.ToLower() are women -
-
- @(Model.MaleFormatted)%   of the @Model.Title.ToLower() are men -
-
- -
\ No newline at end of file diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesSection.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesSection.cshtml deleted file mode 100644 index fcb7f75b3..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Quartiles/QuartilesSection.cshtml +++ /dev/null @@ -1,97 +0,0 @@ -@using GenderPayGap.WebUI.Models.Shared -@using GenderPayGap.WebUI.Models.Viewing -@using GenderPayGap.Core.Helpers -@model GenderPayGap.Database.Return - -
-
- -
- -

The percentage of women in each pay quarter

- - @if (ReportingYearsHelper.IsReportingYearWithFurloughScheme(Model.AccountingDate) && Model.OptedOutOfReportingPayQuarters) - { -
-
- Due to the number of employees placed on the Coronavirus Job Retention Scheme (furlough) this employer was not required to provide quarter data. -
-
- } - else - { - var UpperQuartilePayBandModel = new PayQuartileBarChartModel - { - Id = "UpperQuartilePayBand", - Title = "Upper hourly pay quarter (highest paid)", - Male = Model.MaleUpperQuartilePayBand.Value, - Female = Model.FemaleUpperQuartilePayBand.Value - }; - - var UpperPayBandModel = new PayQuartileBarChartModel - { - Id = "UpperPayBand", - Title = "Upper middle hourly pay quarter", - Male = Model.MaleUpperPayBand.Value, - Female = Model.FemaleUpperPayBand.Value - }; - - var MiddlePayBandModel = new PayQuartileBarChartModel - { - Id = "MiddlePayBand", - Title = "Lower middle hourly pay quarter", - Male = Model.MaleMiddlePayBand.Value, - Female = Model.FemaleMiddlePayBand.Value - }; - - var LowerPayBandModel = new PayQuartileBarChartModel - { - Id = "LowerPayBand", - Title = "Lower hourly pay quarter (lowest paid)", - Male = Model.MaleLowerPayBand.Value, - Female = Model.FemaleLowerPayBand.Value - }; -
-
- In this organisation, women occupy @(UpperQuartilePayBandModel.FemaleFormatted)% of the highest paid jobs and @(LowerPayBandModel.FemaleFormatted)% of the lowest paid jobs. -
-
- -
-
-
- - - - -
- - - - - -
-
- -
-
- -
- - - About pay quarters - - -
- -
-
- -
-
- } - -
-
-
-
diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Report.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Report.cshtml deleted file mode 100644 index 68567110e..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/Report.cshtml +++ /dev/null @@ -1,138 +0,0 @@ -@using System.ComponentModel.DataAnnotations -@using GenderPayGap.Core -@using GenderPayGap.Core.Helpers -@using GenderPayGap.WebUI.Helpers -@model GenderPayGap.Database.Return - -@{ - var reportingYear = ReportingYearsHelper.FormatYearAsReportingPeriod(Model.AccountingDate.Year); - ViewBag.Title = $"{Model.Organisation.OrganisationName} gender pay gap data for {reportingYear} reporting year - GOV.UK"; - ViewBag.pageDescription = $"View gender pay gap data for {Model.Organisation.OrganisationName} for {reportingYear} reporting year and compare with other organisations"; - ViewBag.ogTitle = ViewBag.Title; - ViewBag.ogType = "business.gender_pay_gap"; - ViewBag.pageClass = "employer-report-page"; - - string employerIdentifier = Model.Organisation.GetEncryptedId(); - var viewModel = new AddRemoveButtonViewModel {OrganisationIdEncrypted = Model.Organisation.GetEncryptedId(), OrganisationName = Model.Organisation.OrganisationName}; - - string address = Model.Organisation.GetLatestAddress()?.GetAddressString(); -} - - -
-
- View all reports for this employer -

-
- @Model.Organisation.OrganisationName -
-
- @ReportingYearsHelper.FormatYearAsReportingPeriod(Model.AccountingDate.Year, "/") Gender pay gap report -
-

- -
-
- -
-
- -
-
- -
-
- -
-
More options
-
-
- @if (UriSanitiser.IsValidHttpOrHttpsLink(Model.CompanyLinkToGPGInfo)) - { - - What this employer says about their gender pay gap (opens in a new window) - - } - else - { - This employer has not provided extra information on their gender pay gap - } -
-
-
-
-
-
- -
-
- - - -
- @await Html.PartialAsync("/Views/Submit/RelatedContent.cshtml") -
- -@section Scripts { - -} diff --git a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/VerticalBarChart.cshtml b/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/VerticalBarChart.cshtml deleted file mode 100644 index 702c21eda..000000000 --- a/GenderPayGap.WebUI/Views/Viewing/EmployerDetails/VerticalBarChart.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model GenderPayGap.WebUI.Models.Viewing.VerticalBarChartModel -@{ - decimal femalePercentage = Math.Max(Math.Round(Math.Min(Model.Female, 100m)), 1m); - decimal malePercentage = Math.Max(Math.Round(Math.Min(Model.Male, 100m)), 1m); -} - -
-
- @if (Model.FemaleIsLower) - { -
- -
- } - else - { -
- -
- } -
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file