Skip to content

Commit

Permalink
Merge branch 'master' into CON-1492-Organisations-&-Agreements
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Howes committed Apr 22, 2020
2 parents 394b01b + 5ac2950 commit ce26849
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ private bool EvalutateDraftVacancyCallToActionRule(PanelViewModel<AccountDashboa
{
viewModel.ViewName = "VacancyDraft";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -730,6 +731,7 @@ private bool EvalutatePendingReviewVacancyCallToActionRule(PanelViewModel<Accoun
{
viewModel.ViewName = "VacancyPendingReview";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -748,6 +750,7 @@ private bool EvalutateLiveVacancyCallToActionRule(PanelViewModel<AccountDashboar
{
viewModel.ViewName = "VacancyLive";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -765,6 +768,7 @@ private bool EvalutateClosedVacancyCallToActionRule(PanelViewModel<AccountDashbo
{
viewModel.ViewName = "VacancyClosed";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -783,6 +787,7 @@ private bool EvalutateRejectedVacancyCallToActionRule(PanelViewModel<AccountDash
{
viewModel.ViewName = "VacancyRejected";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -807,6 +812,7 @@ private bool EvalutateSingleReservationCallToActionRule(PanelViewModel<AccountDa
{
viewModel.ViewName = "ContinueSetupForSingleReservation";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -819,6 +825,7 @@ private bool EvalutateHasReservationsCallToActionRule(PanelViewModel<AccountDash
{
viewModel.ViewName = "CheckFunding";
viewModel.PanelType = PanelType.Action;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -832,6 +839,7 @@ private bool EvaluateSingleApprenticeshipCallToActionRule(PanelViewModel<Account
{
viewModel.ViewName = "SingleApprenticeshipApproved";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -850,6 +858,7 @@ private bool EvaluateSingleApprenticeshipDraftStatusCallToActionRule(PanelViewMo
{
viewModel.ViewName = "SingleApprenticeshipContinueSetup";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -868,6 +877,7 @@ private bool EvaluateSingleApprenticeshipsWithTrainingProviderStatusCallToAction
{
viewModel.ViewName = "SingleApprenticeshipWithTrainingProvider";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}
return false;
Expand All @@ -885,6 +895,7 @@ private bool EvaluateContinueSetupForSingleApprenticeshipByProviderCallToActionR
{
viewModel.ViewName = "SingleApprenticeshipContinueWithProvider";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand All @@ -903,6 +914,7 @@ private bool EvaluateSingleApprenticeshipsWithReadyToReviewStatusCallToActionRul
{
viewModel.ViewName = "SingleApprenticeshipReadyForReview";
viewModel.PanelType = PanelType.Summary;
viewModel.Data.HideTasksBar = true;
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@
<Content Include="Views\EmployerTeam\SingleApprenticeshipReadyForReview.cshtml" />
<Content Include="Views\EmployerTeam\SingleApprenticeshipContinueWithProvider.cshtml" />
<Content Include="Views\EmployerAgreement\CannotRemoveOrganisation.cshtml" />
<Content Include="Views\Shared\_COVID19GuidanceBanner.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
Expand Up @@ -28,5 +28,6 @@ public class AccountDashboardViewModel : IAccountIdentifier
public AgreementInfoViewModel AgreementInfo { get; set; }
public ApprenticeshipEmployerType ApprenticeshipEmployerType { get; set; }
public CallToActionViewModel CallToActionViewModel { get; set; }
public bool HideTasksBar { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ public class VacancyViewModel
public string ClosingDateText { get; set; }
public string ClosedDateText { get; set; }
public int? NoOfNewApplications { get; set; }
public int? NoOfSuccessfulApplications { get; set; }
public int? NoOfUnsuccessfulApplications { get; set; }
public int? NoOfApplications => NoOfNewApplications + NoOfSuccessfulApplications + NoOfUnsuccessfulApplications;
}
}
159 changes: 80 additions & 79 deletions src/SFA.DAS.EmployerAccounts.Web/Views/EmployerTeam/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -147,93 +147,94 @@ else
<li><a href="@Url.Action("Index", "Transfers")" class="das-panel__link">Transfers</a> </li>
</ul>
</section>
<section>
<nav>
<ul class="js-tabs" role="tablist">
<li role="tab" id="tab-tasks" aria-controls="pane-tasks"><a href="#pane-tasks">Tasks</a></li>
@if (Html.IsAuthorized("EmployerFeature.Activities"))
{
<li role="tab" id="tab-activity" aria-controls="pane-activity"><a href="#pane-activity">Activity</a></li>
}
</ul>
</nav>
<div class="panes">
<div class="js-tab-pane" id="pane-tasks" role="tabpanel">
@if (Model.Data.Tasks.Count > 0)
{
<ul class="task-list">
@{
var priorityOrderTaskList = Model.Data.Tasks.OrderBy(AccountTaskHelper.GetTaskPriority).ToArray();
}
@if (!Model.Data.HideTasksBar)
{
<section>
<nav>
<ul class="js-tabs" role="tablist">
<li role="tab" id="tab-tasks" aria-controls="pane-tasks"><a href="#pane-tasks">Tasks</a></li>
@if (Html.IsAuthorized("EmployerFeature.Activities"))
{
<li role="tab" id="tab-activity" aria-controls="pane-activity"><a href="#pane-activity">Activity</a></li>
}
</ul>
</nav>
<div class="panes">
<div class="js-tab-pane" id="pane-tasks" role="tabpanel">
@if (Model.Data.Tasks.Count > 0)
{
<ul class="task-list">
@{
var priorityOrderTaskList = Model.Data.Tasks.OrderBy(AccountTaskHelper.GetTaskPriority).ToArray();
}

@foreach (var task in priorityOrderTaskList)
{
<li>
@switch (task.Type)
{
case "LevyDeclarationDue":
<p>
Levy declaration due by 19 @DateTime.Now.ToString("MMMM")
</p>
<form action="@Url.Action("DismissTask", "Task")" method="POST">
<input type="hidden" name="taskType" value="@Enum.GetName(typeof(TasksEnum.TaskType), TasksEnum.TaskType.LevyDeclarationDue)" />
<button class="button-link" type="submit">Dismiss this message</button>
</form>
break;
case "AgreementToSign":
<p>
@task.ItemsDueCount agreement@(task.ItemsDueCount > 1 ? "s" : "") to sign <a href="@Url.Action("ViewUnsignedAgreements", "EmployerAgreement")">View agreements</a>
</p>
break;
case "AddApprentices":
<p>
<a href="@Url.EmployerCommitmentsAction("apprentices/inform")">Start adding apprentices now</a>
</p>
break;
case "ApprenticeChangesToReview":
<p>
@task.ItemsDueCount apprentice change@(task.ItemsDueCount > 1 ? "s" : "") to review <a href="@Url.EmployerCommitmentsAction("apprentices/manage/all?RecordStatus=ChangesForReview")">View changes</a>
</p>
break;
case "CohortRequestReadyForApproval":
<p>
@task.ItemsDueCount cohort request@(task.ItemsDueCount > 1 ? "s" : "") ready for approval <a href="@Url.EmployerCommitmentsAction("apprentices/cohorts/review")">View cohorts</a>
</p>
break;
case "ReviewConnectionRequest":
<p>
@task.ItemsDueCount connection request@(task.ItemsDueCount > 1 ? "s" : "") to review <a href="@Url.Action("Index", "Transfers")">View details</a>
</p>
break;
case "TransferRequestReceived":
<p>
Transfer request received<a href="@Url.Action("Index", "Transfers")">View details</a>
</p>
break;
}
</li>
}
</ul>
}
else
@foreach (var task in priorityOrderTaskList)
{
<li>
@switch (task.Type)
{
case "LevyDeclarationDue":
<p>
Levy declaration due by 19 @DateTime.Now.ToString("MMMM")
</p>
<form action="@Url.Action("DismissTask", "Task")" method="POST">
<input type="hidden" name="taskType" value="@Enum.GetName(typeof(TasksEnum.TaskType), TasksEnum.TaskType.LevyDeclarationDue)" />
<button class="button-link" type="submit">Dismiss this message</button>
</form>
break;
case "AgreementToSign":
<p>
@task.ItemsDueCount agreement@(task.ItemsDueCount > 1 ? "s" : "") to sign <a href="@Url.Action("ViewUnsignedAgreements", "EmployerAgreement")">View agreements</a>
</p>
break;
case "AddApprentices":
<p>
<a href="@Url.EmployerCommitmentsAction("apprentices/inform")">Start adding apprentices now</a>
</p>
break;
case "ApprenticeChangesToReview":
<p>
@task.ItemsDueCount apprentice change@(task.ItemsDueCount > 1 ? "s" : "") to review <a href="@Url.EmployerCommitmentsAction("apprentices/manage/all?RecordStatus=ChangesForReview")">View changes</a>
</p>
break;
case "CohortRequestReadyForApproval":
<p>
@task.ItemsDueCount cohort request@(task.ItemsDueCount > 1 ? "s" : "") ready for approval <a href="@Url.EmployerCommitmentsAction("apprentices/cohorts/review")">View cohorts</a>
</p>
break;
case "ReviewConnectionRequest":
<p>
@task.ItemsDueCount connection request@(task.ItemsDueCount > 1 ? "s" : "") to review <a href="@Url.Action("Index", "Transfers")">View details</a>
</p>
break;
case "TransferRequestReceived":
<p>
Transfer request received<a href="@Url.Action("Index", "Transfers")">View details</a>
</p>
break;
}
</li>
}
</ul>
}
else
{
<p>You do not have any tasks</p>
}
</div>
@if (Html.IsAuthorized("EmployerFeature.Activities"))
{
<p>You do not have any tasks</p>
<div class="js-tab-pane" id="pane-activity" role="tabpanel">
@Html.Action("Latest", "Activities")
</div>
}
</div>
@if (Html.IsAuthorized("EmployerFeature.Activities"))
{
<div class="js-tab-pane" id="pane-activity" role="tabpanel">
@Html.Action("Latest", "Activities")
</div>
}
</div>
</section>
</section>
}
</div>
</div>
}



@if (Model.Data.ShowAcademicYearBanner)
{
<section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.VacancyViewModel

@{
var applicationsTextSuffix = Model.NoOfNewApplications.HasValue && Model.NoOfNewApplications.Value.Equals(1) ? "application" : "applications";
var applicationsTextSuffix = !Model.NoOfApplications.GetValueOrDefault().Equals(0) ? (Model.NoOfApplications.Value.Equals(1) ? "application" : "applications") : "";
var applicationsTextPrefix = !Model.NoOfApplications.GetValueOrDefault().Equals(0) ? "View" : "";
}

<section class="dashboard-section">
<h2 class="section-heading heading-large">
Your apprenticeship advert
</h2>
<p>You have created a vacancy for your apprenticeship.</p>
<p>You've created an advert for your apprenticeship.</p>

<table class="responsive">
<tr>
Expand All @@ -19,14 +20,6 @@
@(Model?.Title)
</td>
</tr>
<tr>
<th scope="row">
Status
</th>
<td>
<strong class="govuk-tag govuk-tag--inactive">CLOSED</strong>
</td>
</tr>
<tr>
<th scope="row" class="tw-35">
Closing date
Expand All @@ -35,13 +28,20 @@
@(Model.ClosedDateText)
</td>
</tr>

<tr>
<th scope="row" class="tw-35">
Applications
</th>
<td class="tw-65">
<a href="@Model.ManageVacancyUrl" class="govuk-link">@(Model.NoOfNewApplications.HasValue ? $"{Model.NoOfNewApplications.Value}" : "0") @applicationsTextSuffix</a>
<a href="@Model.ManageVacancyUrl" class="govuk-link">@applicationsTextPrefix @(!Model.NoOfApplications.GetValueOrDefault().Equals(0) ? $"{Model.NoOfApplications.Value}" : "No applications yet") @applicationsTextSuffix</a>
</td>
</tr>
<tr>
<th scope="row">
Status
</th>
<td>
<strong class="govuk-tag govuk-tag--inactive">CLOSED</strong>
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2 class="section-heading heading-large">
Your apprenticeship advert
</h2>
<p>You have started creating a vacancy for your apprenticeship.</p>
<p>You've started creating an advert for your apprenticeship.</p>

<table class="responsive">
<tr>
Expand All @@ -20,13 +20,13 @@
Status
</th>
<td>
<a href="/" class="govuk-link">Saved as draft</a>
<strong class="govuk-tag govuk-tag--inactive">DRAFT</strong>
</td>
</tr>
</table>
<p>
<a href="@Model.ManageVacancyUrl" role="button" draggable="false" class="button">
Continue creating your vacancy
Continue creating your advert
</a>
</p>
</section>
Loading

0 comments on commit ce26849

Please sign in to comment.