Skip to content

Commit

Permalink
[Bexley][WW] Add request summary/extra info to confirmation page
Browse files Browse the repository at this point in the history
  • Loading branch information
nephila-nacrea committed Nov 11, 2024
1 parent 6b5689a commit cd50694
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
8 changes: 8 additions & 0 deletions t/app/controller/waste_bexley_container_requests.t
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,14 @@ FixMyStreet::override_config {
$mech->content_contains( 'Your container request has been sent',
'Request successful' );

note 'Confirmation summary';
$mech->content_contains( 'class="li-delivery">Green Wheelie Bin' );
$mech->content_contains( 'class="li-delivery">White Recycling Box' );
$mech->content_contains( 'class="li-delivery">Recycling Box Lids' );
$mech->content_contains( 'class="li-delivery">Brown Caddy' );
$mech->content_contains( 'class="li-removal">Green Wheelie Bin' );
$mech->content_contains( 'class="li-removal">Brown Caddy' );

my $rows = FixMyStreet::DB->resultset("Problem")->order_by('id');
is $rows->count, 7, 'correct number of reports raised';

Expand Down
66 changes: 64 additions & 2 deletions templates/web/bexley/waste/_confirmation_after.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
[% IF report.category == 'Report missed collection' %]
[%
is_missed_collection = report.category == 'Report missed collection';
is_delivery_request = report.category == 'Request new container';
is_removal_request = report.category == 'Request container removal';
is_container_request = is_delivery_request || is_removal_request;
%]

[% IF is_missed_collection %]

<h2>Bins reported as missed:</h2>
<p>
Expand All @@ -19,7 +26,62 @@ <h2>What happens next?</h2>
<br>
Please leave your bin(s) out until our contractor returns.
<br>
If you need to contact us about this report, please quote your reference number.
If you need to contact us about a report, please quote its reference number.
</p>

<br>

[% ELSIF is_container_request %]

[%
titles = [ report.title ]; titles.import( report.get_extra_metadata('grouped_titles') );

delivery_prefix = 'Request new ';
removal_prefix = 'Request removal of ';
delivery_titles = [];
removal_titles = [];

FOR title IN titles;
IF title.match(delivery_prefix);
delivery_titles.push( title.remove(delivery_prefix) );
ELSIF title.match(removal_prefix);
removal_titles.push( title.remove(removal_prefix) );
END;
END;
%]

[% IF delivery_titles.size %]
<h2>New bin(s) requested for delivery:</h2>
<p>
<ul>
[% FOR title IN delivery_titles %]
<li class="li-delivery">[% title %]</li>
[% END %]
</ul>
</p>
[% END %]

[% IF removal_titles.size %]
<h2>Old bin(s) requested for collection:</h2>
<p>
<ul>
[% FOR title IN removal_titles %]
<li class="li-removal">[% title %]</li>
[% END %]
</ul>
</p>
[% END %]

<h2>Address:</h2>
<p>[% property.address %]</p>

<h2>What happens next?</h2>
<p>
Your request has been sent to our waste contractor and will be completed within [% cobrand.wasteworks_config.request_timeframe || '10 working days' %].
<br>
Please ensure that old bins which are due to be collected are left somewhere they can be accessed.
<br>
If you need to contact us about a report, please quote its reference number.
</p>

<br>
Expand Down

0 comments on commit cd50694

Please sign in to comment.