generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1a6615
commit 623630c
Showing
11 changed files
with
331 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{% set hasAdditionalSentences = sentence.conviction.additionalSentences and sentence.conviction.additionalSentences.length > 0 %} | ||
{% set additionalSentences %} | ||
{% for additionalSentence in sentence.conviction.additionalSentences %} | ||
{% set detailsHtml %} | ||
{{ govukSummaryList({ | ||
rows: [ | ||
{ | ||
key: { text: 'Sentence' }, | ||
value: { text: additionalSentence.description } | ||
}, | ||
{ | ||
key: { text: 'Value' }, | ||
value: { text: additionalSentence.value } | ||
} if additionalSentence.value, | ||
{ | ||
key: { text: 'Length' }, | ||
value: { text: additionalSentence.length } | ||
} if additionalSentence.length, | ||
{ | ||
key: { text: 'Notes' }, | ||
value: { html: additionalSentence.notes | nl2br if additionalSentence.notes else 'No notes' } | ||
} | ||
] | ||
}) }} | ||
{% endset %} | ||
{{ govukDetails({ | ||
classes: 'govuk-!-margin-bottom-1', | ||
summaryText: additionalSentence.description, | ||
html: detailsHtml | ||
}) }} | ||
{% endfor %} | ||
{% endset %} | ||
|
||
{% set conviction %} | ||
{{ govukSummaryList({ | ||
rows: [ | ||
{ | ||
key: { text: "Sentencing court" }, | ||
value: { html: sentence.conviction.sentencingCourt | nl2br if sentence.conviction.sentencingCourt else 'No court details' } | ||
}, | ||
{ | ||
key: { text: "Responsible court" }, | ||
value: { html: sentence.conviction.responsibleCourt | nl2br if sentence.conviction.responsibleCourt else 'No court details' } | ||
}, | ||
{ | ||
key: { text: "Conviction date" }, | ||
value: { html: sentence.conviction.convictionDate | dateWithYear | nl2br if sentence.conviction.convictionDate else 'No conviction date' } | ||
}, | ||
{ | ||
key: { text: "Additional sentences" }, | ||
value: { html: additionalSentences if hasAdditionalSentences else 'No additional sentences' } | ||
} | ||
] | ||
}) }} | ||
{% endset %} | ||
|
||
{{ appSummaryCard({ | ||
attributes: {'data-qa': 'convictionCard'}, | ||
titleText: 'Conviction', | ||
classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title', | ||
html: conviction | ||
}) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% set hasAdditionalOffences = sentence.offenceDetails.additionalOffences and sentence.offenceDetails.additionalOffences.length > 0 %} | ||
{% set additionalOffences %} | ||
{% if hasAdditionalOffences %} | ||
<ol class="govuk-list{% if sentence.offenceDetails.additionalOffences > 1 %} govuk-list--number{% endif %}"> | ||
{% for additionalOffence in sentence.offenceDetails.additionalOffences %} | ||
<li>{{ additionalOffence.description }} ({{ additionalOffence.count }} count)</li> | ||
{% endfor %} | ||
</ol> | ||
|
||
<a href="/case/{{ crn }}/sentence/offences/{{ sentence.offenceDetails.eventNumber }}">View additional offence details</a> | ||
{% endif %} | ||
{% endset %} | ||
|
||
{% set offence %} | ||
{{ govukSummaryList({ | ||
rows: [ | ||
{ | ||
key: { text: "Main offence" }, | ||
value: { html: sentence.offenceDetails.offence.description + ' (' + sentence.offenceDetails.offence.count + ' count)' } | ||
}, | ||
{ | ||
key: { text: "Offence date" }, | ||
value: { html: sentence.offenceDetails.dateOfOffence | dateWithYear } | ||
}, | ||
{ | ||
key: { text: "Notes" }, | ||
value: { html: sentence.offenceDetails.notes | nl2br if sentence.offenceDetails.notes else 'No notes' } | ||
}, | ||
{ | ||
key: { text: "Additional offences" }, | ||
value: { html: additionalOffences if hasAdditionalOffences else 'No additional offences' } | ||
} | ||
] | ||
}) }} | ||
{% endset %} | ||
|
||
{{ appSummaryCard({ | ||
attributes: {'data-qa': 'offenceCard'}, | ||
titleText: 'Offence', | ||
classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title', | ||
html: offence | ||
}) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{% set hasCourtDocuments = sentence.courtDocuments and sentence.courtDocuments.length > 0 %} | ||
{% set courtDocuments %} | ||
<ul class="govuk-list govuk-!-margin-top-0"> | ||
{% for doc in sentence.courtDocuments %} | ||
<li> | ||
<a href="personal-details/documents/{{ doc.id }}/download" download="{{ doc.documentName }}">{{ doc.documentName }}</a><br> | ||
<span class="govuk-!-font-size-16"> | ||
{% if doc.lastSaved %} | ||
Last updated {{ doc.lastSaved | dateWithYearShortMonth }} | ||
{% else %} | ||
Unavailable | ||
{% endif %} | ||
</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endset %} | ||
|
||
{% set sentence %} | ||
{{ govukSummaryList({ | ||
rows: [ | ||
{ | ||
key: { text: "Order" }, | ||
value: { html: sentence.order.description | nl2br if sentence.order.description else 'No order details' } | ||
}, | ||
{ | ||
key: { text: "Sentence start date" }, | ||
value: { html: sentence.order.startDate | dateWithYear | nl2br if sentence.order.startDate else 'No start date details' } | ||
}, | ||
{ | ||
key: { text: "Sentence end date" }, | ||
value: { html: sentence.order.releaseDate | dateWithYear | nl2br if sentence.order.releaseDate else 'No release date details' } | ||
}, | ||
{ | ||
key: { text: "Terminated date" }, | ||
value: { html: sentence.order.endDate | dateWithYear | nl2br if sentence.order.endDate else 'No end date details' } | ||
}, | ||
{ | ||
key: { text: "Termination reason" }, | ||
value: { html: sentence.order.startDate | monthsOrDaysElapsed + ' elasped (of ' + sentence.order.length + ' months)' | nl2br if sentence.order.startDate else 'No details' } | ||
}, | ||
{ | ||
key: { text: "Court documents" }, | ||
value: { html: '<span data-qa="courtDocumentsValue">' + courtDocuments if hasCourtDocuments else 'No court documents' + '</span>' } | ||
} | ||
] | ||
}) }} | ||
{% endset %} | ||
|
||
{{ appSummaryCard({ | ||
attributes: {'data-qa': 'sentenceCard'}, | ||
titleText: 'Sentence', | ||
classes: 'govuk-!-margin-bottom-6 app-summary-card--large-title', | ||
html: sentence | ||
}) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
server/views/pages/sentence/previous-orders/previous-order.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{% extends "../../../partials/layout.njk" %} | ||
{% set headerPersonName = previousOrderDetail.name.forename + ' ' + previousOrderDetail.name.surname %} | ||
|
||
{% block beforeContent %} | ||
{{ govukBreadcrumbs({ | ||
items: [ | ||
{ | ||
text: "My cases", | ||
href: "/case" | ||
}, | ||
{ | ||
text: headerPersonName, | ||
href: "/case/" + crn, | ||
attributes: { "data-ai-id": "breadcrumbPersonNameLink" } | ||
}, | ||
{ | ||
text: "Sentence", | ||
href: "/case/" + crn + "/sentence" | ||
}, | ||
{ | ||
text: "Previous Orders", | ||
href: "/case/" + crn + "/sentence/previous-orders" | ||
} | ||
] | ||
}) }} | ||
{% endblock %} | ||
{% block content %} | ||
<div class="govuk-!-margin-bottom-0"> | ||
<h2 class="govuk-caption-l">Previous orders</h2> | ||
</div> | ||
|
||
{% set sentence = previousOrderDetail.sentence %} | ||
{% if sentence %} | ||
<h2 class="govuk-heading-m govuk-!-margin-bottom-4" data-qa="pageHeading"> | ||
{{ previousOrderDetail.title }} | ||
</h2> | ||
{% include '../_sentence-offence.njk' %} | ||
{% include '../_conviction.njk' %} | ||
{% include '../_sentence.njk' %} | ||
{% endif %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.