Skip to content

Commit

Permalink
Merge pull request #971 from SkillsFundingAgency/CON-3444-review-adve…
Browse files Browse the repository at this point in the history
…rt-tile-always-shown

CON-3444 Review adverts tile always shown to users
  • Loading branch information
Paul Howes authored Jun 15, 2021
2 parents 79da5ed + 62a6428 commit e922a28
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 251 deletions.
4 changes: 1 addition & 3 deletions src/Employer/Employer.Web/Configuration/ViewNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ public class ViewNames
public const string ManageClosedVacancyWithApplicationsView = "ClosedWithApplications";
public const string ManageReferredVacancyView = "Referred";
public const string FullVacancyView = "FullVacancyView";
public const string ManageReviewVacancyView = "Review";
public const string DashboardWithReview = "DashboardWithReview";
public const string DashboardNoReview = "Dashboard";
public const string ManageReviewVacancyView = "Review";

public const string Training = "Training";
public const string SelectTrainingProvider = "SelectTrainingProvider";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public async Task<IActionResult> Dashboard([FromRoute] string employerAccountId)
{
var vm = await _orchestrator.GetDashboardViewModelAsync(employerAccountId, User.ToVacancyUser());
vm.FromMaHome = ShowReferredFromMaBackLink();
return View(vm.HasEmployerReviewPermission ? ViewNames.DashboardWithReview : ViewNames.DashboardNoReview, vm);
return View(vm);
}
private bool ShowReferredFromMaBackLink()
{
Expand Down
68 changes: 41 additions & 27 deletions src/Employer/Employer.Web/Views/Dashboard/Dashboard.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

@model Esfa.Recruit.Employer.Web.ViewModels.Dashboard.DashboardViewModel

@{
var vacanciesSearchSuggestionsEndpointUrl = Url.RouteUrl(RouteNames.VacanciesSearchSuggestions_Get, null, Context.Request.Scheme);
string GetCardStatus(int count)
@{ var vacanciesSearchSuggestionsEndpointUrl = Url.RouteUrl(RouteNames.VacanciesSearchSuggestions_Get, null, Context.Request.Scheme);
string GetCardStatus(bool hasPermission)
{
return count == 0 ? "das-card--inactive" : string.Empty;
return hasPermission ? String.Empty : "das-card--inactive";
}
ViewBag.ShowReturnToMaLink = Model.FromMaHome;
ViewBag.Vpv = "/recruitment/employer/page-dashboard";
ViewBag.ZenDeskLabel = "recruit-recruitment";
ViewBag.Title = "Your apprenticeship adverts";
}
ViewBag.Title = "Your apprenticeship adverts"; }

<partial asp-hide="@Model.HasAnyVacancies" name="_NoVacanciesContent" />

Expand Down Expand Up @@ -51,60 +49,74 @@
</div>
</form>
</div>
<div class="govuk-grid-row das-card--row">
<div class="govuk-grid-row das-card--row">
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.VacancyCountDraft)">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountDraft</span>
<a asp-show="@Model.HasDraftVacancy" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Draft" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Draft" class="govuk-link">
@FilteringOptions.Draft @Model.VacancyTextDraft
</a>
<span asp-hide="@Model.HasDraftVacancy">@FilteringOptions.Draft @Model.VacancyTextDraft</span>
</h3>
<p class="govuk-body das-card--description">Adverts that you need to complete and send for review.</p>
</div>
</div>
</div>
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.VacancyCountSubmitted)">
<div class="das-card @GetCardStatus(Model.HasEmployerReviewPermission)">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountReview</span>
<a asp-show="@Model.HasEmployerReviewPermission" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Review" class="govuk-link">
@FilteringOptions.Review @Model.VacancyTextReview
</a>
<span asp-hide="@Model.HasEmployerReviewPermission">@FilteringOptions.Review @Model.VacancyTextReview</span>
</h3>
<p asp-show="@Model.HasEmployerReviewPermission" class="govuk-body das-card--description">Adverts created by training providers that you need to review.</p>
<p asp-hide="@Model.HasEmployerReviewPermission" class="govuk-body das-card--description">
If you want to review adverts before they are published you need to
<a class="govuk-link govuk-link--no-visited-state" asp-route="@RouteNames.YourTrainingProviderPermission">manage your permissions</a>.
</p>
</div>
</div>
</div>
<div class="govuk-grid-column-one-third">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountSubmitted</span>
<a asp-show="@Model.HasSubmittedVacancy" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Submitted" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Submitted" class="govuk-link">
@FilteringOptions.Submitted.GetDisplayName(UserType.Employer)
</a>
<span asp-hide="@Model.HasSubmittedVacancy">@FilteringOptions.Submitted.GetDisplayName(UserType.Employer)</span>
</h3>
<p class="govuk-body das-card--description">Adverts that you've sent for review.</p>
</div>
</div>
</div>
</div>
<div class="govuk-grid-row das-card--row">
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.VacancyCountReferred)">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountReferred</span>
<a asp-show="@Model.HasReferredVacancy" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Referred" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Referred" class="govuk-link">
@FilteringOptions.Referred.GetDisplayName() @Model.VacancyTextReferred
</a>
<span asp-hide="@Model.HasReferredVacancy">@FilteringOptions.Referred.GetDisplayName() @Model.VacancyTextReferred</span>
</h3>
<p class="govuk-body das-card--description">Adverts that you need to edit and resubmit.</p>
</div>
</div>
</div>
</div>
<div class="govuk-grid-row das-card--row">
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.VacancyCountLive)">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountLive</span>
<a asp-show="@Model.HasLiveVacancy" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Live" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Live" class="govuk-link">
@FilteringOptions.Live @Model.VacancyTextLive
</a>
<span asp-hide="@Model.HasLiveVacancy">@FilteringOptions.Live @Model.VacancyTextLive</span>
</h3>
<span class="govuk-body das-card--description">Your adverts on the Find an apprenticeship service.</span>
<p class="govuk-body das-card--description"></p>
Expand All @@ -122,14 +134,13 @@
</div>
</div>
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.NoOfNewApplications)">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.NoOfNewApplications</span>
<a asp-show="@Model.HasNewApplications" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.NewApplications" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.NewApplications" class="govuk-link">
New @Model.ApplicationTextLive
</a>
<span asp-hide="@Model.HasNewApplications">New @Model.ApplicationTextLive</span>
</h3>
<span class="govuk-body das-card--description">Applications from Find an apprenticeship service.</span>
<ul class="das-card--tasks govuk-list" asp-show="@Model.ShowAllApplications">
Expand All @@ -142,20 +153,23 @@
</div>
</div>
</div>
</div>
<div class="govuk-grid-row das-card--row">
<div class="govuk-grid-column-one-third">
<div class="das-card @GetCardStatus(Model.VacancyCountClosed)">
<div class="das-card">
<div class="das-card--content">
<h3 class="govuk-heading-m das-card--heading">
<span class="das-card--stat">@Model.VacancyCountClosed</span>
<a asp-show="@Model.HasClosedVacancy" asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Closed" class="govuk-link">
<a asp-route="@RouteNames.Vacancies_Get" asp-route-filter="@FilteringOptions.Closed" class="govuk-link">
@FilteringOptions.Closed @Model.VacancyTextClosed
</a>
<span asp-hide="@Model.HasClosedVacancy">@FilteringOptions.Closed @Model.VacancyTextClosed</span>
</h3>
<span class="govuk-body das-card--description">Adverts that have passed the closing date. You can clone these adverts to republish them.</span>
</div>
</div>
</div>
<div class="govuk-grid-column-one-third"></div>
<div class="govuk-grid-column-one-third"></div>
</div>
<div class="govuk-grid-row">
<div asp-show="@Model.HasOneVacancy" class="govuk-grid-column-full">
Expand Down
Loading

0 comments on commit e922a28

Please sign in to comment.