Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CON-3951 - Revamped legal agreements page #2211

Merged
merged 7 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ public async Task<ActionResult> WhenDoYouWantToView(int? choice, string agreemen
public async Task<ActionResult> ViewAllAgreements(string hashedAccountId, string accountLegalEntityHashedId)
{
var model = await _orchestrator.GetOrganisationAgreements(accountLegalEntityHashedId);
ViewBag.AgreementId = accountLegalEntityHashedId;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be better to have the "AgreementId" on the model rather than using viewbag?


return View(model);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,6 @@
<Content Include="Views\EmployerTeam\SingleApprenticeshipReadyForReview.cshtml" />
<Content Include="Views\EmployerTeam\SingleApprenticeshipContinueWithProvider.cshtml" />
<Content Include="Views\EmployerAgreement\ViewAllAgreements.cshtml" />
<Content Include="Views\Shared\_AcceptedAgreement.cshtml" />
<Content Include="Views\Shared\_NotAcceptedAgreement.cshtml" />
<Content Include="Views\EmployerAgreement\CannotRemoveOrganisation.cshtml" />
<Content Include="Views\EmployerTeam\Empty.cshtml" />
<Content Include="Views\EmployerAgreement\AcceptedEmployerAgreement.cshtml" />
Expand All @@ -875,6 +873,8 @@
<Content Include="Views\Shared\_Agreement_v6.cshtml" />
<Content Include="Views\SearchOrganisation\ConfirmOrganisationDetails.cshtml" />
<Content Include="Views\Home\TermsAndConditions.cshtml" />
<Content Include="Views\EmployerAgreement\_AwaitingAcceptance.cshtml" />
<Content Include="Views\EmployerAgreement\_AcceptedAgreement.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SFA.DAS.Account.Api.Client\SFA.DAS.EAS.Account.Api.Client.csproj">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@using SFA.DAS.EmployerAccounts.Web.Extensions
@using System.Linq
@using SFA.DAS.EmployerAccounts.Web.Extensions
@model OrchestratorResponse<ICollection<OrganisationAgreementViewModel>>

@{
Expand All @@ -8,109 +9,35 @@
ViewBag.Section = "organisations";
ViewBag.ZenDeskLabel = "eas-your-esfa-agreement";
ViewBag.GaData.Vpv = "/accounts/agreements/view-your-agreement/agreement-details";
var tabsCount = 0;
}

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h1 class="govuk-heading-xl">
Your agreements with the Education and Skills Funding Agency (<abbr>ESFA</abbr>)
</h1>

<h1 class="govuk-heading-xl">Your agreements with the Education and Skills Funding Agency (<abbr>ESFA</abbr>)</h1>
<h3 class="govuk-heading-l">Agreement ID: @ViewBag.AgreementId</h3>
</div>
</div>

<div class="govuk-grid-row">

<div class="govuk-grid-column-full">

<div class="govuk-tabs" data-module="govuk-tabs">

<h2 class="govuk-tabs__title">
By published dates
</h2>
<hr class="govuk-!-margin-top-6 govuk-!-margin-bottom-6">

<ul class="govuk-tabs__list">
@Html.Partial("_AwaitingAcceptance", Model.Data.First(), new ViewDataDictionary { { "Inset", Model.Data.First().Template.InsetText(Model.Data) } })

@foreach (var item in Model.Data)
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h3 class="govuk-heading-m">Accepted agreements</h3>
@if (Model.Data.Any(agreement => agreement.SignedDate != null))
{
<div class="govuk-accordion" data-module="govuk-accordion" id="accordion-default">
@foreach (var agreement in Model.Data.Where(agreement => agreement.SignedDate != null))
{
tabsCount++;
<li class="govuk-tabs__list-item@(tabsCount == 1 ? "" : " govuk-tabs__list-item--selected")">
<a class="govuk-tabs__tab" href="@item.GetAgreementTabListId">
@item.Template.PublishedInfo
</a>
</li>
@Html.Partial("_AcceptedAgreement", agreement, new ViewDataDictionary{{"Inset", agreement.Template.InsetText(Model.Data) } })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth using some sort of constant rather than hardcoding "Inset"

}
</ul>
@foreach (var item in Model.Data)
{
<div class="govuk-tabs__panel" id="@item.GetAgreementTabPanelId">

@if (item.SignedDate != null)
{
ViewBag.SelectedTab = @item.Template.VersionNumber;

<strong class="govuk-tag govuk-tag--green govuk-!-margin-bottom-4">
Accepted on @item.SignedDateText
</strong>

ViewBag.BreadCrumbsTrail = @item.AccountLegalEntity.Name;

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h3 class="govuk-heading-l govuk-!-margin-bottom-0">
Agreement between @item.AccountLegalEntity.Name and <abbr>ESFA</abbr>
</h3>

<span class="govuk-caption-m govuk-!-margin-bottom-6">@item.Template.PublishedInfo</span>

@if (@item.Template.InsetText(Model.Data) != string.Empty)
{
<div class="govuk-inset-text">
@item.Template.InsetText(Model.Data)
</div>
}

</div>
</div>

@Html.Partial("_AcceptedAgreement", item)
}
else
{
<strong class="govuk-tag govuk-tag--red govuk-!-margin-bottom-4">
NOT ACCEPTED YET
</strong>

ViewBag.BreadCrumbsTrail = @item.AccountLegalEntity.Name;

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<h3 class="govuk-heading-l">
Agreement between @item.AccountLegalEntity.Name and <abbr>ESFA</abbr>
</h3>

<span class="govuk-caption-m govuk-!-margin-bottom-6">@item.Template.PublishedInfo</span>

@if (@item.Template.InsetText(Model.Data) != string.Empty)
{
<div class="govuk-inset-text">
@item.Template.InsetText(Model.Data)
</div>
}

</div>
</div>

@Html.Partial("_NotAcceptedAgreement", item)
}
</div>
}

</div>
</div>
}
else
{
<h3 class="govuk-heading-s govuk-!-margin-bottom-9">You have no accepted agreements</h3>
}
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.OrganisationAgreementViewModel

<div class="govuk-accordion__section ">
<div class="govuk-accordion__section-header">
<h2 class="govuk-accordion__section-heading">
<span class="govuk-accordion__section-button" id="[email protected]">
@Model.Template.PublishedInfo
</span>
</h2>
<strong class="govuk-tag govuk-tag--green govuk-!-margin-top-3">
Accepted on @Model.SignedDateText
</strong>
</div>
<div id="[email protected]" class="govuk-accordion__section-content" aria-labelledby="[email protected]">
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<span class="govuk-caption-m">
@Model.Template.PublishedInfo
</span>
<h3 class="govuk-heading-m">
Agreement between @Model.AccountLegalEntity.Name and <abbr>ESFA</abbr>
</h3>
<div class="govuk-inset-text">
@ViewData["Inset"]
</div>
<span class="govuk-caption-m">
This agreement allows you to spend funds for <b>@Model.AccountLegalEntity.Name</b>.
</span>
<hr class=" govuk-!-margin-top-9 govuk-!-margin-bottom-9">
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-third">
<p class="govuk-body">
<b>Parties</b>
</p>
</div>
<div class="govuk-grid-column-two-thirds">
<p class="govuk-body">
<i>
<b>The Secretary of State for Education acting through the Education and Skills Funding Agency an executive agency of the Department for Education</b><br>
Cheylesmore House<br>
Quinton Road<br>
Coventry<br>
CV1 2WT
</i>
</p>
@if (Model.OrganisationLookupPossible)
{
<i>
<p class="govuk-body">
<b>BARBERRY COVENTRY LIMITED</b><br>
@Html.CommaSeperatedAddressToHtml(@Model.AccountLegalEntity.Address)

</p>
</i>
<p>
<i>
<a href="@Url.Action("review", "organisation", new
{
Model.HashedAccountId,
Model.HashedAgreementId,
Model.AccountLegalEntityPublicHashedId
})" class="govuk-link govuk-link--no-visited-state govuk-!-font-size-19">Update these details</a>
</i>
</p>
}
</div>
</div>
<div class="govuk-grid-row govuk-!-margin-top-9 govuk-!-margin-bottom-9">
<div class="govuk-grid-column-one-third">
<p class="govuk-body">
<b>Document</b>
</p>
</div>
<div class="govuk-grid-column-two-thirds">
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-third">
<a href="@Url.EmployerAccountsAction($"agreements/{Model.HashedAgreementId}/view")" aria-hidden="true">
<img src="/dist/images/pub-cover-html.png" alt=".">
</a>
</div>
<div class="govuk-grid-column-two-thirds">
<a href="@Url.EmployerAccountsAction($"agreements/{Model.HashedAgreementId}/view")" class="govuk-link">Your <abbr>ESFA</abbr> agreement</a>
<p class="govuk-body">HTML</p>
<p></p>
</div>
</div>
</div>
</div>
<hr class=" govuk-!-margin-top-9 govuk-!-margin-bottom-9">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h3 class="govuk-heading-m">
This agreement has been accepted
</h3>
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th scope="col" class="govuk-table__header">Accepted by:</th>
<td class="govuk-table__cell">@Model.SignedByName</td>
</tr>
</thead>
<tbody class="govuk-table__body">
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">On behalf of:</th>
<td class="govuk-table__cell">@Model.AccountLegalEntity.Name</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">Address: </th>
<td class="govuk-table__cell">@Model.AccountLegalEntity.Address</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">Accepted on:</th>
<td class="govuk-table__cell">@Model.SignedDateText</td>
</tr>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">Agreement ID:</th>
<td class="govuk-table__cell">@Model.AccountLegalEntityPublicHashedId</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.OrganisationAgreementViewModel

@if (Model.SignedDate == null)
{
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-l">Agreement between @Model.AccountLegalEntity.Name and <abbr>ESFA</abbr></h2>
</div>
</div>
<strong class="govuk-tag govuk-tag--red govuk-!-margin-bottom-3">
Awaiting acceptance
</strong>
<p class="govuk-body-l">
@Model.Template.PublishedInfo
</p>
<p></p>
if (ViewData["Inset"] != string.Empty)
{
<div class="govuk-inset-text">
@ViewData["Inset"]
</div>
}
<p class="govuk-body">
This agreement creates a legal contract between @Model.AccountLegalEntity.Name and <abbr>ESFA</abbr>. It allows you to transfer funds to other employers and pay training providers for apprenticeships.
</p>
<p></p>
<p class="govuk-body">
You need to ensure you have authority from your organisation before you accept this agreement on their behalf.
</p>

<form method="get" action="@Url.EmployerAccountsAction($"agreements/{Model.HashedAgreementId}/about-your-agreement")">
@Html.AntiForgeryToken()
<input class="govuk-button" type="submit" value="View agreement" />
</form>

<hr class=" govuk-!-margin-top-6 govuk-!-margin-bottom-9">
}
Loading