Skip to content
This repository was archived by the owner on Apr 26, 2021. It is now read-only.

Commit

Permalink
Merge pull request #55 from hmcts/fr-updates-2
Browse files Browse the repository at this point in the history
Financial Remedy iteration 2
  • Loading branch information
adamsilver authored Jul 26, 2018
2 parents 2952eb6 + 910bff1 commit 18607d1
Show file tree
Hide file tree
Showing 12 changed files with 473 additions and 62 deletions.
20 changes: 20 additions & 0 deletions app/assets/sass/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,23 @@ mark.comment {
.jui-measure {
max-width: 833px;
}

.jui-case-action-alert {
background-color: govuk-colour("bright-red");
color: govuk-colour("white");
padding: govuk-spacing(4);
margin-bottom: govuk-spacing(6);
}

.jui-case-action-alert h2 {
color: govuk-colour("white");
}

.jui-case-action-alert p {
margin-bottom: 0;
color: govuk-colour("white");
}

.jui-case-action-alert a {
color: govuk-colour("white");
}
24 changes: 12 additions & 12 deletions app/data/cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = [
{
id: 'FR1231612322',
typeId: types.fr.id,
status: 'Draft consent order submitted',
status: '<a href="/app/cases/FR1231612322/documents/1">Review draft consent order</a>',
applicationDate: moment('2017-11-20 13:01'),
lastAction: moment('2018-01-25 16:48'),
tribunalCentre: 'Fox Court',
Expand All @@ -20,13 +20,13 @@ module.exports = [
},
{
id: uuid(),
date: moment('2018-07-07 13:01'),
title: 'D84 submitted',
date: moment('2018-05-20 13:01'),
title: 'Statement of information (D81) submitted',
by: 'John Smith'
},
{
id: uuid(),
date: moment('2018-07-10 13:01'),
date: moment('2018-05-20 13:01'),
title: 'Form A submitted',
by: 'John Smith'
},
Expand Down Expand Up @@ -61,13 +61,13 @@ module.exports = [
],
documents: [{
id: '1',
label: 'Consent order'
label: 'Draft consent order'
}, {
id: '3',
label: 'Statement of information (D81)'
}, {
id: '2',
label: 'Form A'
}, {
id: '3',
label: 'D81'
}],
linkedCases: [{
type: 'Divorce',
Expand All @@ -78,7 +78,7 @@ module.exports = [
{
id: 'SC1231612322',
typeId: types.pip.id,
status: 'Deadline expired',
status: 'Review case',
applicationDate: moment('2017-11-20 13:01'),
lastAction: moment('2018-01-25 16:48'),
urgent: true,
Expand Down Expand Up @@ -273,7 +273,7 @@ module.exports = [
}
}
],
status: 'Party replied',
status: 'Review party response',
applicationDate: moment('2018-05-09'),
lastAction: moment('2018-05-09'),
urgent: false,
Expand Down Expand Up @@ -342,7 +342,7 @@ module.exports = [
}
}
],
status: 'Consider decree nisi',
status: 'Review decree nisi',
reason: 'Separated for 2 years and consent',
applicationDate: moment('2018-05-09'),
documents: [{
Expand Down Expand Up @@ -404,7 +404,7 @@ module.exports = [
}
}
],
status: 'Consider decree nisi',
status: 'Review decree nisi',
reason: 'Separated for 2 years and consent',
applicationDate: moment('2018-05-09'),
documents: [{
Expand Down
58 changes: 51 additions & 7 deletions app/routes/fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ router.get('/app/cases/:id/fr/decision', (req, res) => {
});

router.post('/app/cases/:id/fr/decision', (req, res) => {
if(req.body.decision === 'Approve') {
if(req.body.decision === 'Approve consent order') {
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
} else if(req.body.decision === 'Approve with changes') {
res.redirect(`/app/cases/${req.params.id}/fr/upload-1`);
} else if(req.body.decision === 'Ask for more information') {
res.redirect(`/app/cases/${req.params.id}/fr/more-information`);
} else if(req.body.decision === 'List for hearing') {
res.redirect(`/app/cases/${req.params.id}/fr/hearing-details`);
} else {
res.redirect(`/app/cases/${req.params.id}/fr/upload-1`);
}
Expand All @@ -104,11 +106,11 @@ router.post('/app/cases/:id/fr/upload-1', (req, res) => {
res.redirect(`/app/cases/${req.params.id}/fr/upload-2`);
} else {
switch(req.session.data.decision) {
case 'Approve':
case 'Approve with changes':
case 'Approve consent order':
case 'Ask for more information':
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
break;
case 'Reject':
case 'Reject consent order':
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
break;
}
Expand All @@ -131,13 +133,51 @@ router.get('/app/cases/:id/fr/upload-2', (req, res) => {
});

router.post('/app/cases/:id/fr/upload-2', (req, res) => {
if(req.session.data.decision === 'Approve with changes') {
if(req.session.data.decision === 'Ask for more information') {
res.redirect(`/app/cases/${req.params.id}/fr/notes`);
} else {
res.redirect(`/app/cases/${req.params.id}/fr/reject-reasons`);
}
});

router.get('/app/cases/:id/fr/more-information', (req, res) => {
var _case = helpers.getCase(req.session.cases, req.params.id);

var pageObject = {
casebar: helpers.getCaseBarObject(_case),
caseActions: helpers.getCaseActions(_case),
backLink: {
href: `/app/cases/${_case.id}/fr/decision`
},
_case: _case
};

res.render('app/case/fr/decision/more-information', pageObject);
});

router.post('/app/cases/:id/fr/more-information', (req, res) => {
res.redirect(`/app/cases/${req.params.id}/fr/check`);
});

router.get('/app/cases/:id/fr/hearing-details', (req, res) => {
var _case = helpers.getCase(req.session.cases, req.params.id);

var pageObject = {
casebar: helpers.getCaseBarObject(_case),
caseActions: helpers.getCaseActions(_case),
backLink: {
href: `/app/cases/${_case.id}/fr/decision`
},
_case: _case
};

res.render('app/case/fr/decision/hearing-details', pageObject);
});

router.post('/app/cases/:id/fr/hearing-details', (req, res) => {
res.redirect(`/app/cases/${req.params.id}/fr/check`);
});

router.get('/app/cases/:id/fr/notes', (req, res) => {
var _case = helpers.getCase(req.session.cases, req.params.id);

Expand Down Expand Up @@ -186,6 +226,10 @@ router.get('/app/cases/:id/fr/check', (req, res) => {
reasons: []
};

if(req.session.data.decision === 'List for hearing') {
pageObject.backLink.href = `/app/cases/${_case.id}/fr/hearing-details`
}

if(req.session.data.reject) {
req.session.data.reject.forEach((item) => {
if(item == 'not enough') {
Expand Down
6 changes: 3 additions & 3 deletions app/routes/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function getCaseActions(_case) {
return [
{
href: `/app/cases/${_case.id}/pip/make-decision`,
text: 'Make a decision'
text: 'Make decision'
},
{
href: `/app/cases/${_case.id}/pip/list-for-hearing`,
Expand All @@ -57,14 +57,14 @@ function getCaseActions(_case) {
return [
{
href: `/app/cases/${_case.id}/fr/decision`,
text: 'Make a decision'
text: 'Make decision'
}
];
case 'divorce':
return [
{
href: `/app/cases/${_case.id}/divorce/make-decision`,
text: 'Make a decision'
text: 'Make decision'
},
{
href: `/app/cases/${_case.id}/divorce/mark-as-prepared`,
Expand Down
129 changes: 122 additions & 7 deletions app/views/app/case/fr/decision/check.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,105 @@ <h1 class="govuk-heading-xl">Check your decision</h1>
</dd>

</div>
{% if data.reason %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Reason for hearing</dt>

<dd class="app-check-your-answers__answer">
{{data.reason}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if data.duration %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Hearing duration (minutes)</dt>

<dd class="app-check-your-answers__answer">
{{data.duration}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if data['minimum-notice-needed'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Minimum duration needed (working days)</dt>

<dd class="app-check-your-answers__answer">
{{data['minimum-notice-needed']}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}

{% if data['latest-listing-date-day'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Latest date this can be listed</dt>

<dd class="app-check-your-answers__answer">
{{data['latest-listing-date-day']}}/{{data['latest-listing-date-month']}}/{{data['latest-listing-date-year']}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if data['listed-for-you'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Do you want it to be listed for you?</dt>

<dd class="app-check-your-answers__answer">
{{data['listed-for-you']}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if data['transfer'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Do you want the hearing to be transferred to another court?</dt>

<dd class="app-check-your-answers__answer">
{{data['transfer']}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if data['name-of-court'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Name of court</dt>

<dd class="app-check-your-answers__answer">
{{data['name-of-court']}}
</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/hearing-details">Change <span class="govuk-visually-hidden">hearing details</span></a>
</dd>
</div>
{% endif %}
{% if reasons.length %}
<div class="app-check-your-answers__contents">

Expand All @@ -67,17 +166,33 @@ <h1 class="govuk-heading-xl">Check your decision</h1>

</div>
{% endif %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Notes</dt>
{% if data['information-needed'] %}
<div class="app-check-your-answers__contents">

<dd class="app-check-your-answers__answer">{{data['decision-notes']}}</dd>
<dt class="app-check-your-answers__question">Information needed</dt>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/decision">Change <span class="govuk-visually-hidden">decision</span></a>
</dd>
<dd class="app-check-your-answers__answer">{{data['information-needed']}}</dd>

</div>
<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/more-information">Change <span class="govuk-visually-hidden">information needed</span></a>
</dd>

</div>
{% endif %}
{% if data['decision-notes'] %}
<div class="app-check-your-answers__contents">

<dt class="app-check-your-answers__question">Notes</dt>

<dd class="app-check-your-answers__answer">{{data['decision-notes']}}</dd>

<dd class="app-check-your-answers__change">
<a href="/app/cases/{{_case.id}}/fr/decision">Change <span class="govuk-visually-hidden">decision</span></a>
</dd>

</div>
{% endif %}

</dl>

Expand Down
Loading

0 comments on commit 18607d1

Please sign in to comment.