Skip to content

Commit

Permalink
Merge pull request #958 from DFE-Digital/feature/147247-Update-Projec…
Browse files Browse the repository at this point in the history
…t-List-View

Feature/147247 update project list view
  • Loading branch information
elielijah321 authored Dec 14, 2023
2 parents 37c6d58 + e74fc91 commit 9457cdb
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class AcademyConversionProject
public string ConversionSupportGrantEnvironmentalImprovementGrant { get; set; }
public bool? ConversionSupportGrantAmountChanged { get; set; }
public DateTime? DaoPackSentDate { get; set; }
public string Region { get; set; }

// Annex B
public bool? AnnexBFormReceived { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,14 @@

<table class="govuk-table">
<caption class="govuk-table__caption govuk-table__caption--m govuk-visually-hidden">Projects (@Model.ProjectCount)</caption>

<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-!-width-three-fifths">Application information</th>
<th class="govuk-table__header govuk-!-text-align-right app-!-width-two-fifths prepare-text-align-right">Project status and dates</th>
</tr>
</thead>

<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header app-!-width-three-fifths">Application information</th>
</tr>
</thead>
<tbody class="govuk-table__body">
@{
var index = 0;
foreach (ProjectListViewModel project in Model.Projects)
{
<partial if="project.IsSponsored" name="Shared/SponsoredProjectListRow" model="project.Row(index)"/>
<partial if="project.IsVoluntary" name="Shared/VoluntaryProjectListRow" model="project.Row(index)"/>
<partial if="project.IsFormAMat" name="Shared/FormAMatProjectListRow" model="project.Row(index)"/>

index++;
}
<partial name="Shared/_ProjectListRows" model="Model.Projects" />
}
</tbody>
</table>
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@using Dfe.Academisation.ExtensionMethods
@using Dfe.PrepareConversions.TagHelpers
@model List<ProjectListViewModel>

@{
var index = 0;

foreach (var project in Model)
{
var projectRow = project.Row(index);

var isFormAMat = project.IsFormAMat;
var matTypeClass = isFormAMat ? "form-a-mat" : "join-a-mat";
var link = isFormAMat ? @Links.FormAMat.Index.Page : @Links.TaskList.Index.Page;

<tr class="govuk-table__row @matTypeClass" data-cy="select-projectlist-filter-row">
<td class="govuk-table__cell">
<div class="govuk-!-margin-top-1 govuk-!-margin-bottom-2">
<strong>
<a id="@("school-name-" + projectRow.Index)" class="govuk-link" asp-page="@link" asp-route-id="@projectRow.Item.Id">@projectRow.Item.SchoolName</a>
</strong>
</div>
<div class="govuk-!-margin-top-1">
<span id="@("urn-" + projectRow.Index)"><strong>URN:</strong> @projectRow.Item.SchoolURN</span>
</div>
@if (!@projectRow.Item.LocalAuthority.IsEmpty())
{
<div id="@("local-authority-" + projectRow.Index)" class="govuk-!-margin-top-1">
<strong>Local authority:</strong>
@projectRow.Item.LocalAuthority
</div>
}
<div id="@("region-" + projectRow.Index)" class="govuk-!-margin-top-1">
<strong>Region:</strong>
@projectRow.Item.Region
</div>
<div id="@("incoming-trust-" + projectRow.Index)" class="govuk-!-margin-top-1">
<strong>Incoming trust:</strong>
@projectRow.Item.NameOfTrust.ToTitleCase()
</div>
<div id="@("advisory-board-date-" + projectRow.Index)" class="govuk-!-margin-top-1">
<strong>Advisory board date:</strong>
<span if="projectRow.Item.HeadTeacherBoardDate.IsEmpty()" class="empty">Unconfirmed</span>
<span if="projectRow.Item.HeadTeacherBoardDate.IsPresent()">@projectRow.Item.HeadTeacherBoardDate</span>
</div>
@if (!isFormAMat)
{
<div id="@("assigned-to-" + projectRow.Index)" class="do govuk-!-margin-top-1">
<strong>Assigned to:</strong>
<span if="projectRow.Item.AssignedUserFullName.IsEmpty()" class="empty">Unassigned</span>
<strong if="projectRow.Item.AssignedUserFullName.IsPresent()">@projectRow.Item.AssignedUserFullName</strong>
</div>
}
<div class="govuk-!-margin-top-2 govuk-!-margin-bottom-3">
<strong class="govuk-tag [email protected]" id="[email protected]">@projectRow.Item.Status.Value</strong>
</div>
</td>
</tr>

index++;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public static ProjectListViewModel Build(AcademyConversionProject academyConvers
Status = MapProjectStatus(academyConversionProject.ProjectStatus),
AssignedUserFullName = academyConversionProject.AssignedUser?.FullName,
CreatedOn = academyConversionProject.CreatedOn,
TypeAndRoute = academyConversionProject.AcademyTypeAndRoute
TypeAndRoute = academyConversionProject.AcademyTypeAndRoute,
Region = academyConversionProject.Region
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class ProjectListViewModel: ProjectTypeBase
public string AssignedUserFullName { get; init; }
public DateTime? CreatedOn { get; init; }
public string TypeAndRoute { get; init; }
public string Region { get; set; }

public bool ShowHtbDate => string.IsNullOrWhiteSpace(HeadTeacherBoardDate) is false;
public bool ShowProposedOpeningDate => string.IsNullOrWhiteSpace(ProposedAcademyOpeningDate) is false;
Expand Down

0 comments on commit 9457cdb

Please sign in to comment.