Skip to content

Commit

Permalink
CON-1653-handle-0-applications-the-same-as-null
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephek committed Apr 20, 2020
1 parent 49966bb commit a63ed1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.VacancyViewModel

@{
var applicationsTextSuffix = Model.NoOfApplications.HasValue ? (Model.NoOfApplications.Value.Equals(1) ? "application" : "applications") : "";
var applicationsTextPrefix = Model.NoOfApplications.HasValue ? "View" : "";
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">
Expand Down Expand Up @@ -33,7 +33,7 @@
Applications
</th>
<td class="tw-65">
<a href="@Model.ManageVacancyUrl" class="govuk-link">@applicationsTextPrefix @(Model.NoOfApplications.HasValue ? $"{Model.NoOfApplications.Value}" : "No applications yet") @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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@model SFA.DAS.EmployerAccounts.Web.ViewModels.VacancyViewModel

@{
var applicationsTextSuffix = Model.NoOfApplications.HasValue ? (Model.NoOfApplications.Value.Equals(1) ? "application" : "applications") : "";
var applicationsTextPrefix = Model.NoOfApplications.HasValue ? "View " : "";
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">
Expand Down Expand Up @@ -33,7 +33,7 @@
Applications
</th>
<td class="tw-65">
<a href="@Model.ManageVacancyUrl" class="govuk-link">@applicationsTextPrefix @(Model.NoOfApplications.HasValue ? $"{Model.NoOfApplications.Value}" : "No applications yet") @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>
Expand Down

0 comments on commit a63ed1b

Please sign in to comment.