diff --git a/app/filters.js b/app/filters.js index 117322d2..c15f3417 100644 --- a/app/filters.js +++ b/app/filters.js @@ -120,4 +120,25 @@ addFilter('sortPcdDecisions', decisions => { if (dateA !== dateB) return dateB.localeCompare(dateA) return (b.loggedAt || 0) - (a.loggedAt || 0) }) +}) + +// Map a meetingPurpose code to its display label. Pass meetingPurposeDetails as +// the second argument so "other" resolves to the free-text description. +addFilter('meetingPurposeLabel', (purpose, details) => { + const labels = { + 'pre-trial': 'CPS pre-trial meeting', + 'pre-charge': 'Pre-charge meeting', + 'charging-decision': 'Inform victim about charging decision', + 'charging-decision-family': 'Inform bereaved family about charging decision', + 'conviction': 'Conviction meeting', + 'sentencing': 'Sentencing meeting', + 'acquittal': 'Acquittal meeting', + 'stopped-altered': 'Stopped or substantially altered charge (VCL Scheme)', + 'vrr': "Victims' Right to Review (VRR)", + 'joint': 'Joint CPS and Police meeting', + 'lesser-offence': 'Lesser offence meeting', + 'complaint': 'Bereaved family complaint', + 'other': details || 'Other' + } + return labels[purpose] || 'CPS pre-trial meeting' }) \ No newline at end of file diff --git a/app/routes/meetings.js b/app/routes/meetings.js index eed7b7ef..5add084d 100644 --- a/app/routes/meetings.js +++ b/app/routes/meetings.js @@ -2,6 +2,18 @@ module.exports = router => { + // Pre-population across /bfs/meetings-2 flows is only wanted when the user + // arrives via a "Change" link (which carries ?changeMode=true). On every + // other GET into the flow we clear the flag so forms render blank. + // The kit copies session.data into res.locals.data BEFORE this handler runs, + // so both must be updated for templates on this request to see the value. + router.get('/bfs/meetings-2/*', function(request, response, next) { + var val = request.query.changeMode === 'true' ? 'true' : '' + request.session.data['changeMode'] = val + response.locals.data.changeMode = val + next() + }) + // meetings router.post('/v60/wft-meetings/new-task/next-task-answer', function(request, response) { @@ -33,7 +45,7 @@ module.exports = router => { }) - router.post('/bfs/meetings-2//meetings-2/logging-answer', function(request, response) { + router.post('/bfs/meetings-2/logging-answer', function(request, response) { var logging = request.session.data['logging'] if (logging == "yes"){ @@ -743,6 +755,18 @@ module.exports = router => { } // --- Confirm meeting arrangements flow (shared: bfs, v50, v51) --- + + // When a "Change" link on check-answers is used, ?changeMode=true is stored + // in the session; each answer route returns to check-answers instead of + // advancing the flow. + function caChangeReturn(request, response, caBase, nextUrl) { + if (request.session.data['changeMode'] === 'true') { + request.session.data['changeMode'] = '' + return response.redirect(caBase + 'check-answers') + } + response.redirect(nextUrl) + } + function registerConfirmArrangements(caBase) { router.post(caBase + 'who-requested-meeting-answer', function(request, response) { @@ -751,7 +775,7 @@ module.exports = router => { return response.redirect(caBase + 'who-requested-meeting?meetingRequestedByError=yes') } data['meetingRequestedByError'] = '' - response.redirect(caBase + 'meeting-date') + caChangeReturn(request, response, caBase, caBase + 'meeting-date') }) router.post(caBase + 'meeting-date-answer', function(request, response) { @@ -764,7 +788,7 @@ module.exports = router => { } data['meetingDateError'] = '' data['meetingTimeError'] = '' - response.redirect(caBase + 'meeting-format') + caChangeReturn(request, response, caBase, caBase + 'meeting-format') }) router.post(caBase + 'meeting-format-answer', function(request, response) { @@ -773,10 +797,19 @@ module.exports = router => { return response.redirect(caBase + 'meeting-format?meetingFormatError=yes') } data['meetingFormatError'] = '' - if (data['meetingFormat'] == 'virtual'){ - response.redirect(caBase + 'attendees') - } else { + var needsLocation = data['meetingFormat'] != 'virtual' + if (data['changeMode'] === 'true'){ + // Changing the format may require a (new) location before returning. + if (needsLocation && !data['meetingLocationType']){ + return response.redirect(caBase + 'meeting-location?changeMode=true') + } + data['changeMode'] = '' + return response.redirect(caBase + 'check-answers') + } + if (needsLocation){ response.redirect(caBase + 'meeting-location') + } else { + response.redirect(caBase + 'attendees') } }) @@ -793,7 +826,7 @@ module.exports = router => { } data['meetingLocationTypeError'] = '' data['meetingLocationDetailError'] = '' - response.redirect(caBase + 'attendees') + caChangeReturn(request, response, caBase, caBase + 'attendees') }) router.post(caBase + 'attendees-answer', function(request, response) { @@ -803,7 +836,7 @@ module.exports = router => { return response.redirect(caBase + 'attendees?attendeesError=yes') } data['attendeesError'] = '' - response.redirect(caBase + 'meeting-lead') + caChangeReturn(request, response, caBase, caBase + 'meeting-lead') }) router.post(caBase + 'meeting-lead-answer', function(request, response) { @@ -812,7 +845,7 @@ module.exports = router => { return response.redirect(caBase + 'meeting-lead?meetingLeadError=yes') } data['meetingLeadError'] = '' - response.redirect(caBase + 'support-needs') + caChangeReturn(request, response, caBase, caBase + 'support-needs') }) // Custom attendee added on the attendees page -> becomes a selected attendee @@ -837,6 +870,7 @@ module.exports = router => { } data['interpreterNeededError'] = '' data['supportPersonNeededError'] = '' + data['changeMode'] = '' response.redirect(caBase + 'check-answers') }) diff --git a/app/views/bfs/meetings-2/age.html b/app/views/bfs/meetings-2/age.html index fb5958ba..a24f6b55 100644 --- a/app/views/bfs/meetings-2/age.html +++ b/app/views/bfs/meetings-2/age.html @@ -28,21 +28,21 @@

- +
- +
- + diff --git a/app/views/bfs/meetings-2/cancelled/meeting-date.html b/app/views/bfs/meetings-2/cancelled/meeting-date.html index d7ea457e..a94121f0 100644 --- a/app/views/bfs/meetings-2/cancelled/meeting-date.html +++ b/app/views/bfs/meetings-2/cancelled/meeting-date.html @@ -29,7 +29,7 @@

When was the meeting cancelled?

- +
diff --git a/app/views/bfs/meetings-2/choose-meeting.html b/app/views/bfs/meetings-2/choose-meeting.html index 0ee48e39..a518dc8c 100644 --- a/app/views/bfs/meetings-2/choose-meeting.html +++ b/app/views/bfs/meetings-2/choose-meeting.html @@ -18,7 +18,7 @@ {{ govukRadios({ name: "meeting2", - value: data['meeting2'], + value: data['meeting2'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Arrange details for an offered meeting", diff --git a/app/views/bfs/meetings-2/confirm-arrangements/attendees-updated.html b/app/views/bfs/meetings-2/confirm-arrangements/attendees-updated.html index c652b676..634fbdd9 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/attendees-updated.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/attendees-updated.html @@ -47,49 +47,49 @@

- +
- +
- +
- +
- +
- +
- +
- + diff --git a/app/views/bfs/meetings-2/confirm-arrangements/attendees.html b/app/views/bfs/meetings-2/confirm-arrangements/attendees.html index d302b74e..5803ad26 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/attendees.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/attendees.html @@ -46,74 +46,74 @@

- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
{% for added in data['addedAttendees'] %}
- + diff --git a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-email.html b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-email.html index e606b69a..4c6592a5 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-email.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-email.html @@ -29,7 +29,7 @@

Check your answers before confirming details

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth diff --git a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-isva.html b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-isva.html index e606b69a..4c6592a5 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-isva.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-isva.html @@ -29,7 +29,7 @@

Check your answers before confirming details

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth diff --git a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-police.html b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-police.html index e606b69a..4c6592a5 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-police.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-police.html @@ -29,7 +29,7 @@

Check your answers before confirming details

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth diff --git a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-telephone.html b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-telephone.html index e606b69a..4c6592a5 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/check-answers-telephone.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/check-answers-telephone.html @@ -29,7 +29,7 @@

Check your answers before confirming details

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth diff --git a/app/views/bfs/meetings-2/confirm-arrangements/check-answers.html b/app/views/bfs/meetings-2/confirm-arrangements/check-answers.html index 092de06d..d7338dcf 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/check-answers.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/check-answers.html @@ -57,7 +57,7 @@

Check your answers before confirming meeting arrange Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}

@@ -68,7 +68,7 @@

Check your answers before confirming meeting arrange {{ arrangedText }}
- Change how the meeting was arranged + Change how the meeting was arranged

@@ -79,7 +79,7 @@

Check your answers before confirming meeting arrange {{ data['meetingDate'] | formatDate }}{% if data['meetingHour'] %} at {{ data['meetingHour'] }}:{{ data['meetingMinutes'] }}{% endif %}
- Change date and time + Change date and time

@@ -90,7 +90,7 @@

Check your answers before confirming meeting arrange {{ formatText }}
- Change how the meeting will take place + Change how the meeting will take place

@@ -103,7 +103,7 @@

Check your answers before confirming meeting arrange {{ locationText }}
- Change where the meeting will be held + Change where the meeting will be held

{% endif %} @@ -116,7 +116,7 @@

Check your answers before confirming meeting arrange {% for attendee in attendeesList %}{% if attendee != "_unchecked" %}

{{ attendee }}

{% endif %}{% endfor %}
- Change attendees + Change attendees

@@ -128,7 +128,7 @@

Check your answers before confirming meeting arrange {{ data['meetingLead'] }}
- Change meeting lead + Change meeting lead

@@ -141,7 +141,7 @@

Check your answers before confirming meeting arrange {% if data['interpreterNeeded'] == "yes" and data['interpreterDetails'] %}
{{ data['interpreterDetails'] }}{% endif %}
- Change interpreter needed + Change interpreter needed

@@ -154,7 +154,7 @@

Check your answers before confirming meeting arrange {% if data['supportPersonNeeded'] == "yes" and data['supportPersonDetails'] %}
{{ data['supportPersonDetails'] }}{% endif %}
- Change person for support + Change person for support
@@ -166,7 +166,7 @@

Check your answers before confirming meeting arrange {{ data['otherSupportNeeds'] if data['otherSupportNeeds'] else "None" }}
- Change other support + Change other support
diff --git a/app/views/bfs/meetings-2/confirm-arrangements/meeting-date.html b/app/views/bfs/meetings-2/confirm-arrangements/meeting-date.html index 5528c320..7114f3ce 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/meeting-date.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/meeting-date.html @@ -49,7 +49,7 @@

When will the meeting take place?

- +
@@ -76,7 +76,7 @@

When will the meeting take place?

- +
@@ -88,7 +88,7 @@

When will the meeting take place?

- +
diff --git a/app/views/bfs/meetings-2/confirm-arrangements/meeting-format.html b/app/views/bfs/meetings-2/confirm-arrangements/meeting-format.html index 54cd5de0..f7513c45 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/meeting-format.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/meeting-format.html @@ -42,17 +42,17 @@ { value: "in-person", text: "In person", - checked: checked("meetingFormat", "in-person") + checked: checked("meetingFormat", "in-person") if data['changeMode'] == 'true' else false }, { value: "virtual", text: "Virtual call", - checked: checked("meetingFormat", "virtual") + checked: checked("meetingFormat", "virtual") if data['changeMode'] == 'true' else false }, { value: "hybrid", text: "Hybrid", - checked: checked("meetingFormat", "hybrid"), + checked: checked("meetingFormat", "hybrid") if data['changeMode'] == 'true' else false, hint: { text: "Some people will attend in person and others will join virtually" } diff --git a/app/views/bfs/meetings-2/confirm-arrangements/meeting-lead.html b/app/views/bfs/meetings-2/confirm-arrangements/meeting-lead.html index d71dcfd8..4744853e 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/meeting-lead.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/meeting-lead.html @@ -46,7 +46,7 @@

{% if attendee != '_unchecked' %} {% set radioIndex = radioIndex + 1 %}
- + diff --git a/app/views/bfs/meetings-2/confirm-arrangements/meeting-location.html b/app/views/bfs/meetings-2/confirm-arrangements/meeting-location.html index 451f82b7..6729ff9d 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/meeting-location.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/meeting-location.html @@ -41,7 +41,7 @@ name: "cpsLocation", type: "text", classes: "govuk-input--width-20", - value: data['cpsLocation'], + value: data['cpsLocation'] if data['changeMode'] == 'true', errorMessage: { text: "Enter which CPS location the meeting will be held" } if (detailError and selectedType == "cps") else undefined, label: { text: "Which CPS location will the meeting be held?" @@ -55,7 +55,7 @@ name: "magistratesLocation", type: "text", classes: "govuk-input--width-20", - value: data['magistratesLocation'], + value: data['magistratesLocation'] if data['changeMode'] == 'true', errorMessage: { text: "Enter which magistrates' court the meeting will be held" } if (detailError and selectedType == "magistrates") else undefined, label: { text: "Which magistrates' court will the meeting be held?" @@ -69,7 +69,7 @@ name: "crownLocation", type: "text", classes: "govuk-input--width-20", - value: data['crownLocation'], + value: data['crownLocation'] if data['changeMode'] == 'true', errorMessage: { text: "Enter which crown court the meeting will be held" } if (detailError and selectedType == "crown") else undefined, label: { text: "Which crown court will the meeting be held?" @@ -83,7 +83,7 @@ name: "policeStationLocation", type: "text", classes: "govuk-input--width-20", - value: data['policeStationLocation'], + value: data['policeStationLocation'] if data['changeMode'] == 'true', errorMessage: { text: "Enter which police station the meeting will be held" } if (detailError and selectedType == "police") else undefined, label: { text: "Which police station will the meeting be held?" @@ -96,7 +96,7 @@ id: "other-location", name: "otherLocation", classes: "govuk-input--width-20", - value: data['otherLocation'], + value: data['otherLocation'] if data['changeMode'] == 'true', errorMessage: { text: "Enter where the meeting will be held" } if (detailError and selectedType == "other") else undefined, label: { text: "Where will the meeting be held?" @@ -118,31 +118,31 @@ { value: "cps", text: "CPS location", - checked: checked("meetingLocationType", "cps"), + checked: checked("meetingLocationType", "cps") if data['changeMode'] == 'true' else false, conditional: { html: cpsHtml } }, { value: "magistrates", text: "Magistrates' court", - checked: checked("meetingLocationType", "magistrates"), + checked: checked("meetingLocationType", "magistrates") if data['changeMode'] == 'true' else false, conditional: { html: magistratesHtml } }, { value: "crown", text: "Crown court", - checked: checked("meetingLocationType", "crown"), + checked: checked("meetingLocationType", "crown") if data['changeMode'] == 'true' else false, conditional: { html: crownHtml } }, { value: "police", text: "Police station", - checked: checked("meetingLocationType", "police"), + checked: checked("meetingLocationType", "police") if data['changeMode'] == 'true' else false, conditional: { html: policeHtml } }, { value: "other", text: "Other", - checked: checked("meetingLocationType", "other"), + checked: checked("meetingLocationType", "other") if data['changeMode'] == 'true' else false, conditional: { html: otherHtml } } ] diff --git a/app/views/bfs/meetings-2/confirm-arrangements/support-needs.html b/app/views/bfs/meetings-2/confirm-arrangements/support-needs.html index cf2006d8..c7cd99bc 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/support-needs.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/support-needs.html @@ -46,7 +46,7 @@

{% endif %}
- + @@ -60,7 +60,7 @@

- + @@ -81,7 +81,7 @@

{% endif %}
- + @@ -95,7 +95,7 @@

- + diff --git a/app/views/bfs/meetings-2/confirm-arrangements/who-requested-meeting.html b/app/views/bfs/meetings-2/confirm-arrangements/who-requested-meeting.html index 23056b9a..7db4d2e0 100644 --- a/app/views/bfs/meetings-2/confirm-arrangements/who-requested-meeting.html +++ b/app/views/bfs/meetings-2/confirm-arrangements/who-requested-meeting.html @@ -42,17 +42,17 @@ { value: "family", text: "A bereaved family member requested it", - checked: checked("meetingRequestedBy", "family") + checked: checked("meetingRequestedBy", "family") if data['changeMode'] == 'true' else false }, { value: "cps", text: "CPS offered and the bereaved family accepted", - checked: checked("meetingRequestedBy", "cps") + checked: checked("meetingRequestedBy", "cps") if data['changeMode'] == 'true' else false }, { value: "third-party", text: "Requested by a third party", - checked: checked("meetingRequestedBy", "third-party"), + checked: checked("meetingRequestedBy", "third-party") if data['changeMode'] == 'true' else false, hint: { "text": "For example, a family liaison officer or another representative" } diff --git a/app/views/bfs/meetings-2/cps-offer/has-victim-accepted.html b/app/views/bfs/meetings-2/cps-offer/has-victim-accepted.html index a6ca3107..c60bd514 100644 --- a/app/views/bfs/meetings-2/cps-offer/has-victim-accepted.html +++ b/app/views/bfs/meetings-2/cps-offer/has-victim-accepted.html @@ -15,7 +15,7 @@

You have sent one meeting offer to Sarah Phillips's {{ govukRadios({ name: "meeting4", - value: data['meeting4'], + value: data['meeting4'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Do you want to log an acceptance?", diff --git a/app/views/bfs/meetings-2/cps-offer/how-when-accepted.html b/app/views/bfs/meetings-2/cps-offer/how-when-accepted.html index 26b43e76..ad7211b3 100644 --- a/app/views/bfs/meetings-2/cps-offer/how-when-accepted.html +++ b/app/views/bfs/meetings-2/cps-offer/how-when-accepted.html @@ -46,7 +46,7 @@

Meeting accepted by {{ recipient | formatName }}

Meeting accepted by {{ recipient | formatName }}

- +

diff --git a/app/views/bfs/meetings-2/cps-offer/how-when-declined.html b/app/views/bfs/meetings-2/cps-offer/how-when-declined.html index 6fbc9c31..80cbc3a0 100644 --- a/app/views/bfs/meetings-2/cps-offer/how-when-declined.html +++ b/app/views/bfs/meetings-2/cps-offer/how-when-declined.html @@ -46,7 +46,7 @@

Meeting declined by {{ recipient | formatName }}

Meeting declined by {{ recipient | formatName }} - + diff --git a/app/views/bfs/meetings-2/cps-offer/how-when-offered-2.html b/app/views/bfs/meetings-2/cps-offer/how-when-offered-2.html index e7adaf04..36c4a623 100644 --- a/app/views/bfs/meetings-2/cps-offer/how-when-offered-2.html +++ b/app/views/bfs/meetings-2/cps-offer/how-when-offered-2.html @@ -20,7 +20,7 @@

Details of the meeting offered

{{ govukRadios({ name: "howoffered2", - value: data['howoffered2'], + value: data['howoffered2'] if data['changeMode'] == 'true', fieldset: { legend: { text: "How was it offered?", @@ -67,7 +67,7 @@

Details of the meeting offered

- +
diff --git a/app/views/bfs/meetings-2/cps-offer/how-when-offered.html b/app/views/bfs/meetings-2/cps-offer/how-when-offered.html index 11fb34a6..3399ec8b 100644 --- a/app/views/bfs/meetings-2/cps-offer/how-when-offered.html +++ b/app/views/bfs/meetings-2/cps-offer/how-when-offered.html @@ -52,37 +52,37 @@

Meeting offered to {{ recipient | formatName }}

{% endif %}
- +
- +
- +
- +
- +
- + @@ -108,7 +108,7 @@

Meeting offered to {{ recipient | formatName }}

- +
diff --git a/app/views/bfs/meetings-2/cps-offer/log-offer-response.html b/app/views/bfs/meetings-2/cps-offer/log-offer-response.html index c7003f5f..a743e79c 100644 --- a/app/views/bfs/meetings-2/cps-offer/log-offer-response.html +++ b/app/views/bfs/meetings-2/cps-offer/log-offer-response.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "offerResponse", - value: data['offerResponse'], + value: data['offerResponse'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What is the response to the meeting offer?", diff --git a/app/views/bfs/meetings-2/cps-offer/purpose-notaccepted.html b/app/views/bfs/meetings-2/cps-offer/purpose-notaccepted.html index 1a715a34..980455a5 100644 --- a/app/views/bfs/meetings-2/cps-offer/purpose-notaccepted.html +++ b/app/views/bfs/meetings-2/cps-offer/purpose-notaccepted.html @@ -22,7 +22,7 @@ {{ govukTextarea({ id: "meeting-purpose-details", name: "meetingPurposeDetails", - value: data['meetingPurposeDetails'], + value: data['meetingPurposeDetails'] if data['changeMode'] == 'true', type: "text", spellcheck: false, classes: "govuk-input--width-20", @@ -34,7 +34,7 @@ {{ govukRadios({ name: "meetingPurpose", - value: data['meetingPurpose'], + value: data['meetingPurpose'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What is the purpose of the meeting?", diff --git a/app/views/bfs/meetings-2/cps-offer/what-do-you-want-to-log.html b/app/views/bfs/meetings-2/cps-offer/what-do-you-want-to-log.html index 3edfa67b..f0eaac20 100644 --- a/app/views/bfs/meetings-2/cps-offer/what-do-you-want-to-log.html +++ b/app/views/bfs/meetings-2/cps-offer/what-do-you-want-to-log.html @@ -18,7 +18,7 @@ {{ govukRadios({ name: "logging2", - value: data['logging2'], + value: data['logging2'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What do you want to log?", diff --git a/app/views/bfs/meetings-2/cps-offer/when-no-response.html b/app/views/bfs/meetings-2/cps-offer/when-no-response.html index dc1bd189..82f1f202 100644 --- a/app/views/bfs/meetings-2/cps-offer/when-no-response.html +++ b/app/views/bfs/meetings-2/cps-offer/when-no-response.html @@ -61,7 +61,7 @@

No response from {{ recipient | formatName }}

- +
diff --git a/app/views/bfs/meetings-2/cps-offer/who-accepted.html b/app/views/bfs/meetings-2/cps-offer/who-accepted.html index 9cd4976e..3943f45e 100644 --- a/app/views/bfs/meetings-2/cps-offer/who-accepted.html +++ b/app/views/bfs/meetings-2/cps-offer/who-accepted.html @@ -52,7 +52,7 @@

Who has accepted?

{% for recipient in recipients %} {% if not data['recordaccepted' + loop.index] and not data['recorddeclined' + loop.index] and not data['recordnoresponse' + loop.index] %}
- + diff --git a/app/views/bfs/meetings-2/cps-offer/who-declined.html b/app/views/bfs/meetings-2/cps-offer/who-declined.html index 981707d4..29ce7518 100644 --- a/app/views/bfs/meetings-2/cps-offer/who-declined.html +++ b/app/views/bfs/meetings-2/cps-offer/who-declined.html @@ -52,7 +52,7 @@

Who has declined?

{% for recipient in recipients %} {% if not data['recordaccepted' + loop.index] and not data['recorddeclined' + loop.index] and not data['recordnoresponse' + loop.index] %}
- + diff --git a/app/views/bfs/meetings-2/cps-offer/who-no-response.html b/app/views/bfs/meetings-2/cps-offer/who-no-response.html index bd43c810..d4521689 100644 --- a/app/views/bfs/meetings-2/cps-offer/who-no-response.html +++ b/app/views/bfs/meetings-2/cps-offer/who-no-response.html @@ -52,7 +52,7 @@

Who did not respond?

{% for recipient in recipients %} {% if not data['recordaccepted' + loop.index] and not data['recorddeclined' + loop.index] and not data['recordnoresponse' + loop.index] %}
- + diff --git a/app/views/bfs/meetings-2/cps-offer/who-offered.html b/app/views/bfs/meetings-2/cps-offer/who-offered.html index e40ff372..29d9b3c2 100644 --- a/app/views/bfs/meetings-2/cps-offer/who-offered.html +++ b/app/views/bfs/meetings-2/cps-offer/who-offered.html @@ -47,19 +47,19 @@

Who was the offer made to?

- +
- +
- + diff --git a/app/views/bfs/meetings-2/has-meeting-been-offered.html b/app/views/bfs/meetings-2/has-meeting-been-offered.html index 4d111863..69f03309 100644 --- a/app/views/bfs/meetings-2/has-meeting-been-offered.html +++ b/app/views/bfs/meetings-2/has-meeting-been-offered.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "offered", - value: data['offered'], + value: data['offered'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Has Sarah Phillips's bereaved family been offered a meeting?", diff --git a/app/views/bfs/meetings-2/log-outcome/agree-to-research.html b/app/views/bfs/meetings-2/log-outcome/agree-to-research.html index 35f3def1..887dc2d1 100644 --- a/app/views/bfs/meetings-2/log-outcome/agree-to-research.html +++ b/app/views/bfs/meetings-2/log-outcome/agree-to-research.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "agreedToResearch", - value: data['agreedToResearch'], + value: data['agreedToResearch'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Did Sarah Phillips's bereaved family agree to be contacted for research?", diff --git a/app/views/bfs/meetings-2/log-outcome/any-actions-agreed.html b/app/views/bfs/meetings-2/log-outcome/any-actions-agreed.html index 44f1946d..08e217c5 100644 --- a/app/views/bfs/meetings-2/log-outcome/any-actions-agreed.html +++ b/app/views/bfs/meetings-2/log-outcome/any-actions-agreed.html @@ -24,7 +24,7 @@ {{ govukTextarea({ id: "contact-by-email", name: "actionsAgreedDetail", - value: data['actionsAgreedDetail'], + value: data['actionsAgreedDetail'] if data['changeMode'] == 'true', type: "text", autocomplete: "email", spellcheck: false, @@ -63,7 +63,7 @@ {{ govukRadios({ name: "actionsAgreed2", - value: data['actionsAgreed2'], + value: data['actionsAgreed2'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Were any actions agreed?", diff --git a/app/views/bfs/meetings-2/log-outcome/chair-person.html b/app/views/bfs/meetings-2/log-outcome/chair-person.html index 5b3812f8..08d55522 100644 --- a/app/views/bfs/meetings-2/log-outcome/chair-person.html +++ b/app/views/bfs/meetings-2/log-outcome/chair-person.html @@ -28,7 +28,7 @@

{% if attendee != '_unchecked' %} {% set chairIndex = chairIndex + 1 %}
- + diff --git a/app/views/bfs/meetings-2/log-outcome/did-counsel-attend.html b/app/views/bfs/meetings-2/log-outcome/did-counsel-attend.html index 3943403c..f6b490b1 100644 --- a/app/views/bfs/meetings-2/log-outcome/did-counsel-attend.html +++ b/app/views/bfs/meetings-2/log-outcome/did-counsel-attend.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "counselAttended", - value: data['counselAttended'], + value: data['counselAttended'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Did counsel attend the meeting?", diff --git a/app/views/bfs/meetings-2/log-outcome/did-meeting-happen.html b/app/views/bfs/meetings-2/log-outcome/did-meeting-happen.html index 1491cc26..c9e18275 100644 --- a/app/views/bfs/meetings-2/log-outcome/did-meeting-happen.html +++ b/app/views/bfs/meetings-2/log-outcome/did-meeting-happen.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "meeting3", - value: data['meeting3'], + value: data['meeting3'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Did the meeting take place?", diff --git a/app/views/bfs/meetings-2/log-outcome/duration.html b/app/views/bfs/meetings-2/log-outcome/duration.html index d88be0e5..87756a71 100644 --- a/app/views/bfs/meetings-2/log-outcome/duration.html +++ b/app/views/bfs/meetings-2/log-outcome/duration.html @@ -33,7 +33,7 @@

How long did the meeting last?

- +

@@ -45,7 +45,7 @@

How long did the meeting last?

- +
diff --git a/app/views/bfs/meetings-2/log-outcome/eligible-for-expenses.html b/app/views/bfs/meetings-2/log-outcome/eligible-for-expenses.html index ceb215e2..7ed86f9c 100644 --- a/app/views/bfs/meetings-2/log-outcome/eligible-for-expenses.html +++ b/app/views/bfs/meetings-2/log-outcome/eligible-for-expenses.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "eligibleForExpenses", - value: data['eligibleForExpenses'], + value: data['eligibleForExpenses'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Is Sarah Phillips's bereaved family eligible for expenses?", diff --git a/app/views/bfs/meetings-2/log-outcome/minutes-sent-oic.html b/app/views/bfs/meetings-2/log-outcome/minutes-sent-oic.html index 5ee1110c..c8bade51 100644 --- a/app/views/bfs/meetings-2/log-outcome/minutes-sent-oic.html +++ b/app/views/bfs/meetings-2/log-outcome/minutes-sent-oic.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "meetingNotesToOic", - value: data['meetingNotesToOic'], + value: data['meetingNotesToOic'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Have the meeting notes been sent to the Officer in Charge (OIC)?", diff --git a/app/views/bfs/meetings-2/log-outcome/minutes-sent.html b/app/views/bfs/meetings-2/log-outcome/minutes-sent.html index acee76d6..876fba9e 100644 --- a/app/views/bfs/meetings-2/log-outcome/minutes-sent.html +++ b/app/views/bfs/meetings-2/log-outcome/minutes-sent.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "meetingNotesToVictim", - value: data['meetingNotesToVictim'], + value: data['meetingNotesToVictim'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Have the meeting notes been sent to Sarah Phillips's bereaved family?", diff --git a/app/views/bfs/meetings-2/log-outcome/reason-why.html b/app/views/bfs/meetings-2/log-outcome/reason-why.html index 0b854dea..9f47795a 100644 --- a/app/views/bfs/meetings-2/log-outcome/reason-why.html +++ b/app/views/bfs/meetings-2/log-outcome/reason-why.html @@ -24,7 +24,7 @@ {{ govukTextarea ({ id: "contact-by-text", name: "meetingNotHappenReasonOther", - value: data['meetingNotHappenReasonOther'], + value: data['meetingNotHappenReasonOther'] if data['changeMode'] == 'true', type: "tel", autocomplete: "tel", classes: "govuk-input--width-20", @@ -36,7 +36,7 @@ {{ govukRadios({ name: "meetingNotHappenReason", - value: data['meetingNotHappenReason'], + value: data['meetingNotHappenReason'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Why did the meeting not take place?", diff --git a/app/views/bfs/meetings-2/log-outcome/upload-file.html b/app/views/bfs/meetings-2/log-outcome/upload-file.html index ad085cbf..8d5e321f 100644 --- a/app/views/bfs/meetings-2/log-outcome/upload-file.html +++ b/app/views/bfs/meetings-2/log-outcome/upload-file.html @@ -19,7 +19,7 @@ {{ govukRadios({ name: "meetingNotesSaved", - value: data['meetingNotesSaved'], + value: data['meetingNotesSaved'] if data['changeMode'] == 'true', fieldset: { legend: { text: "Have meeting notes been saved in CMS?", diff --git a/app/views/bfs/meetings-2/log-outcome/who-attended.html b/app/views/bfs/meetings-2/log-outcome/who-attended.html index 9ef0e3c3..2c4b3b74 100644 --- a/app/views/bfs/meetings-2/log-outcome/who-attended.html +++ b/app/views/bfs/meetings-2/log-outcome/who-attended.html @@ -36,7 +36,7 @@

{% if attendee != '_unchecked' %} {% set attendedIndex = attendedIndex + 1 %}
- + @@ -45,7 +45,7 @@

{% endfor %} {% for added in data['addedAttended'] %}
- + diff --git a/app/views/bfs/meetings-2/purpose.html b/app/views/bfs/meetings-2/purpose.html index 401f49a5..cd70d8a1 100644 --- a/app/views/bfs/meetings-2/purpose.html +++ b/app/views/bfs/meetings-2/purpose.html @@ -22,7 +22,7 @@ {{ govukTextarea({ id: "meeting-purpose-details", name: "meetingPurposeDetails", - value: data['meetingPurposeDetails'], + value: data['meetingPurposeDetails'] if data['changeMode'] == 'true', type: "text", spellcheck: false, classes: "govuk-input--width-20", @@ -34,7 +34,7 @@ {{ govukRadios({ name: "meetingPurpose", - value: data['meetingPurpose'], + value: data['meetingPurpose'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What is the purpose of the meeting?", diff --git a/app/views/bfs/meetings-2/purpose2.html b/app/views/bfs/meetings-2/purpose2.html index 91a33a92..67baff08 100644 --- a/app/views/bfs/meetings-2/purpose2.html +++ b/app/views/bfs/meetings-2/purpose2.html @@ -23,7 +23,7 @@ {{ govukTextarea({ id: "meeting-purpose-details", name: "meetingPurposeDetails", - value: data['meetingPurposeDetails'], + value: data['meetingPurposeDetails'] if data['changeMode'] == 'true', type: "text", spellcheck: false, classes: "govuk-input--width-20", @@ -35,7 +35,7 @@ {{ govukRadios({ name: "meetingPurpose", - value: data['meetingPurpose'], + value: data['meetingPurpose'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What is the purpose of the meeting?", diff --git a/app/views/bfs/meetings-2/rescheduled/check-answers.html b/app/views/bfs/meetings-2/rescheduled/check-answers.html index 28bd4fda..2637c3e9 100644 --- a/app/views/bfs/meetings-2/rescheduled/check-answers.html +++ b/app/views/bfs/meetings-2/rescheduled/check-answers.html @@ -32,7 +32,7 @@

Check your answers before changing

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth @@ -57,7 +57,7 @@

Check your answers before changing

Friday, 11 April 2025 at 11:45am
- Change customer reference + Change customer reference
diff --git a/app/views/bfs/meetings-2/rescheduled/check-answers2.html b/app/views/bfs/meetings-2/rescheduled/check-answers2.html index 0d9b9e03..b503e0a0 100644 --- a/app/views/bfs/meetings-2/rescheduled/check-answers2.html +++ b/app/views/bfs/meetings-2/rescheduled/check-answers2.html @@ -32,7 +32,7 @@

Check your answers before confirming details

Purpose of meeting
- CPS pre-trial meeting + {{ data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) }}
Change date of birth @@ -58,7 +58,7 @@

Check your answers before confirming details

11:45am
- Change customer reference + Change customer reference
diff --git a/app/views/bfs/meetings-2/rescheduled/meeting-date.html b/app/views/bfs/meetings-2/rescheduled/meeting-date.html index b23d804a..6b5fe622 100644 --- a/app/views/bfs/meetings-2/rescheduled/meeting-date.html +++ b/app/views/bfs/meetings-2/rescheduled/meeting-date.html @@ -29,7 +29,7 @@

When will the meeting take place?

- +
diff --git a/app/views/bfs/meetings-2/what-do-you-want-to-log.html b/app/views/bfs/meetings-2/what-do-you-want-to-log.html index d3314502..2dfdb343 100644 --- a/app/views/bfs/meetings-2/what-do-you-want-to-log.html +++ b/app/views/bfs/meetings-2/what-do-you-want-to-log.html @@ -18,7 +18,7 @@ {{ govukRadios({ name: "logging", - value: data['logging'], + value: data['logging'] if data['changeMode'] == 'true', fieldset: { legend: { text: "What do you want to log?", diff --git a/app/views/bfs/onb/new-task/meeting-purpose.html b/app/views/bfs/onb/new-task/meeting-purpose.html index 1db8f3d9..81c7b701 100644 --- a/app/views/bfs/onb/new-task/meeting-purpose.html +++ b/app/views/bfs/onb/new-task/meeting-purpose.html @@ -28,21 +28,21 @@

- +
- +
- + @@ -50,35 +50,35 @@

- +
- +
- +
- +
- + @@ -86,7 +86,7 @@

- + @@ -94,7 +94,7 @@

- + @@ -106,14 +106,14 @@

- +
- + diff --git a/app/views/bfs/victim/new-task/meeting-purpose.html b/app/views/bfs/victim/new-task/meeting-purpose.html index 68e54fb8..8e714cd8 100644 --- a/app/views/bfs/victim/new-task/meeting-purpose.html +++ b/app/views/bfs/victim/new-task/meeting-purpose.html @@ -28,84 +28,84 @@

- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- + diff --git a/app/views/bfs/victim/pre-trial/meetings-panel.html b/app/views/bfs/victim/pre-trial/meetings-panel.html index 773fb2bc..fbeee818 100644 --- a/app/views/bfs/victim/pre-trial/meetings-panel.html +++ b/app/views/bfs/victim/pre-trial/meetings-panel.html @@ -2,14 +2,11 @@ {% set meetingState = data['meetingState'] %} {% set knownMeetingStates = ['arranged', 'offered', 'offered-multi', 'no-response', 'not-offered', 'responses', 'outcome', 'outcome-no', 'rescheduled', 'cancelled'] %} -{# Summary card title = purpose of this meeting (set in the onboarding / task creation journey via meetingPurpose). #} -{% if data['meetingPurpose'] == "pre-trial" %}{% set meetingPurposeTitle = "CPS pre-trial meeting" %} -{% elif data['meetingPurpose'] == "charging-decision" %}{% set meetingPurposeTitle = "Inform victim about charging decision" %} -{% elif data['meetingPurpose'] == "stopped-altered" %}{% set meetingPurposeTitle = "Stopped or substantially altered charge (VCL Scheme)" %} -{% elif data['meetingPurpose'] == "vrr" %}{% set meetingPurposeTitle = "Victims' Right to Review (VRR)" %} -{% elif data['meetingPurpose'] == "complaint" %}{% set meetingPurposeTitle = "Victim complaint" %} -{% elif data['meetingPurpose'] == "other" %}{% set meetingPurposeTitle = data['meetingPurposeDetails'] %} -{% else %}{% set meetingPurposeTitle = "CPS pre-trial meeting" %}{% endif %} +{# A meeting task created during onboarding / task creation that has not been logged yet. #} +{% set hasPendingMeetingTask = data['existingTask'] in ['meeting-offer', 'meeting-arranged', 'meeting-outcome'] %} + +{# Summary card title = purpose of this meeting (set in the onboarding / task creation journey via data['meetingPurpose']). #} +{% set meetingPurpose = data['meetingPurpose'] | meetingPurposeLabel(data['meetingPurposeDetails']) %} {% if data['meetingSuccess'] == 'yes' and meetingState in knownMeetingStates %} @@ -70,6 +67,8 @@

{% include "/bfs/victim/pre-trial/states/rescheduled.html" %} {% elif meetingState == 'cancelled' %} {% include "/bfs/victim/pre-trial/states/cancelled.html" %} +{% elif hasPendingMeetingTask %} + {% include "/bfs/victim/pre-trial/states/pending.html" %} {% else %} {% include "/bfs/victim/pre-trial/states/none.html" %} {% endif %} diff --git a/app/views/bfs/victim/pre-trial/states/no-response.html b/app/views/bfs/victim/pre-trial/states/no-response.html index 69f07853..44f48626 100644 --- a/app/views/bfs/victim/pre-trial/states/no-response.html +++ b/app/views/bfs/victim/pre-trial/states/no-response.html @@ -12,7 +12,7 @@

- No response to the CPS pre-trial meeting offer has been received. + No response to the {{ meetingPurpose or "CPS pre-trial meeting" }} offer has been received.

{% include "/bfs/meetings-2/cps-offer/partials/no-response-offers.html" %} diff --git a/app/views/bfs/victim/pre-trial/states/pending.html b/app/views/bfs/victim/pre-trial/states/pending.html new file mode 100644 index 00000000..78f2d461 --- /dev/null +++ b/app/views/bfs/victim/pre-trial/states/pending.html @@ -0,0 +1,35 @@ +
+
+

+ {{ meetingPurpose or "CPS pre-trial meeting" }} +

+
+
+
+
+
+ Status +
+
+ Not yet logged +
+
+ {% if data['taskDueDate'] %} +
+
+ Due date +
+
+ {{ data['taskDueDate'] | formatDate }} +
+
+ {% endif %} +
+ +
+ + + Log meeting details for {{ meetingPurpose or "CPS pre-trial meeting" }} + +
+
diff --git a/app/views/bfs/victim/pre-trial/states/rescheduled.html b/app/views/bfs/victim/pre-trial/states/rescheduled.html index 25a2bd1c..3261184c 100644 --- a/app/views/bfs/victim/pre-trial/states/rescheduled.html +++ b/app/views/bfs/victim/pre-trial/states/rescheduled.html @@ -166,7 +166,7 @@

-

CPS pre-trial meeting offer accepted

+

{{ meetingPurpose or "CPS pre-trial meeting" }} offer accepted

@@ -191,7 +191,7 @@

CPS pre-trial meeting offer accepted


-

CPS pre-trial meeting offered

+

{{ meetingPurpose or "CPS pre-trial meeting" }} offered