Skip to content

Commit

Permalink
Show consultee comments on planning application
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed Nov 9, 2023
1 parent 6cc5a7a commit f0f5ff7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
28 changes: 27 additions & 1 deletion app/views/planning_applications/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<hr>
<% end %>

<h2 class="govuk-heading-m govuk-!-margin-top-8">Comments</h2>
<h2 class="govuk-heading-m govuk-!-margin-top-8">Neighbour Comments</h2>
<% if @planning_application["published_comments"].present? %>
<hr>
<ul class="govuk-list">
Expand All @@ -67,3 +67,29 @@
<% else %>
<p class="govuk-body">No comments have been made on this application yet.</p>
<% end %>

<h2 class="govuk-heading-m govuk-!-margin-top-8">Consultee Comments</h2>
<% if @planning_application["consultee_comments"].present? %>
<hr>
<ul class="govuk-list">
<% @planning_application["consultee_comments"].each do |comment| %>
<li>
<% if comment["summmary_tag"].present? %>
<span class="govuk-tag <%= "govuk-tag--#{tag_colour(comment["summary_tag"])}" %>">
<%= comment["summary_tag"] %>
</span>
<br>
<% end %>
<p>
<strong>Date received:</strong> <%= comment["received_at"].to_date.strftime("%d/%m/%y") %>
</p>
<p>
<%= simple_format(comment["comment"]) %>
</p>
</li>
<hr>
<% end %>
</ul>
<% else %>
<p class="govuk-body">No comments have been made on this application yet.</p>
<% end %>
7 changes: 7 additions & 0 deletions spec/fixtures/test_planning_application.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@
"summary_tag": "objection"
}
],
"consultee_comments": [
{
"comment": "This is illegal",
"received_at": "2020-05-18T06:18:17.540+01:00",
"summary_tag": null
}
],
"consultation": {
"end_date": "2020-05-17T06:18:17.540+01:00"
},
Expand Down
2 changes: 2 additions & 0 deletions spec/system/planning_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
expect(page).to have_content("objection")
expect(page).to have_content("17/05/20")
expect(page).to have_content("This is bad")
expect(page).to have_content("18/05/20")
expect(page).to have_content("This is illegal")
end

it "shows 404 if not found" do
Expand Down

0 comments on commit f0f5ff7

Please sign in to comment.