Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show consultee comments on planning application #180

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 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,23 @@
<% 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>
<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 %>
6 changes: 6 additions & 0 deletions spec/fixtures/test_planning_application.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
"summary_tag": "objection"
}
],
"consultee_comments": [
{
"comment": "This is illegal",
"received_at": "2020-05-18T06:18:17.540+01:00"
}
],
"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