Skip to content

Commit

Permalink
Show security section when there are xrays (#184)
Browse files Browse the repository at this point in the history
* Show security section when there are xrays

* Update sidebar security display logic
  • Loading branch information
danielburnley authored Jun 14, 2023
1 parent 386e0db commit 5a4a791
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions server/views/pages/personalPage.njk
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{% from "../macros/conditionallyShow.njk" import conditionallyShow %}
{% extends "./index.njk" %}
{% set breadCrumbs = [
{%
set breadCrumbs = [
{
text: 'Home',
href: "/" | prependBaseUrl
text: 'Home',
href: "/" | prependBaseUrl
}
] %}
]
%}
{% set showSecurity = security.interestToImmigration == "Yes" or security.travelRestrictions or security.xrays.total > 0 %}

{% block body %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters">
Expand All @@ -27,7 +31,7 @@
{%- call conditionallyShow({condition: prisonerBelongsToUsersCaseLoad(prisonId, user.caseLoads), id: 'next-of-kin-nav'}) -%}
<li><a class="govuk-link govuk-link--no-visited-state" href="#next-of-kin">Next of kin</a></li>
{%- endcall -%}
{%- call conditionallyShow({condition: security.interestToImmigration == "Yes" or security.travelRestrictions, id: 'security-nav'}) -%}
{%- call conditionallyShow({condition: showSecurity, id: 'security-nav'}) -%}
<li><a class="govuk-link govuk-link--no-visited-state" href="#security">Security</a></li>
{%- endcall -%}
{%- call conditionallyShow({condition: prisonerBelongsToUsersCaseLoad(prisonId, user.caseLoads), id: 'property-nav'}) -%}
Expand Down Expand Up @@ -76,7 +80,7 @@
</div>
</div>
{%- endcall -%}
{%- call conditionallyShow({condition: security.interestToImmigration == "Yes" or security.travelRestrictions, id: 'security'}) -%}
{%- call conditionallyShow({condition: showSecurity, id: 'security'}) -%}
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
{% include "../partials/personalPage/security.njk" %}
Expand Down

0 comments on commit 5a4a791

Please sign in to comment.