Skip to content

Commit

Permalink
Add first view of application details for consultees view
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccaoneill committed Jan 27, 2025
1 parent a532dfc commit 4f3e8ee
Show file tree
Hide file tree
Showing 12 changed files with 234 additions and 142 deletions.
2 changes: 1 addition & 1 deletion app/components/site_map_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@
<% end %>
<% else %>
<p class="govuk-body"><%= t(".no_digital_sitemap") %></p>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/models/press_notice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class NotCreatableError < StandardError; end
with_options on: :confirmation do
validates :published_at, presence: true,
date: {
on_or_before: :current,
on_or_before: :consultation_end_date,
on_or_after: :consultation_start_date
}
end
Expand Down
133 changes: 0 additions & 133 deletions app/presenters/concerns/status_presenter.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/presenters/planning_application_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PlanningApplicationPresenter

presents :planning_application

include StatusPresenter
include BopsCore::StatusPresenter
include ProposalDetailsPresenter
include ValidationTasksPresenter
include AssessmentTasksPresenter
Expand Down
2 changes: 1 addition & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ en:
date_blank: Provide the date when the press notice was published
date_invalid: The date the press notice was published must be a valid date
date_not_on_or_after: The date the press notice was published must be on or after the consultation start date
date_not_on_or_before: The date the press notice was published must be on or before today
date_not_on_or_before: The date the press notice was published must be on or before the consultation end date
reasons:
blank: Provide a reason for the press notice
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def show
private

def set_planning_application
@planning_application = planning_applications_scope.find_by!(reference:)
planning_application = planning_applications_scope.find_by!(reference:)
@planning_application = PlanningApplicationPresenter.new(view_context, planning_application)
rescue ActiveRecord::RecordNotFound
render_not_found
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# frozen_string_literal: true

module BopsConsultees
class PlanningApplicationPresenter
include Presentable

presents :planning_application

include BopsCore::StatusPresenter

def initialize(template, planning_application)
@template = template
@planning_application = planning_application
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,85 @@
<% end %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">
<%= @planning_application.full_address %>
</h1>

<p class="govuk-body">
<p class="govuk-body ">
<%= t(".application_number") %> <strong><%= @planning_application.reference %></strong>
</p>

<p class="govuk-body govuk-!-margin-bottom-6">
<%= @planning_application.status_tag %>
<%= @planning_application.days_status_tag %>
</p>

<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner">
<div class="govuk-notification-banner__header">
<h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title">
Important
</h2>
</div>
<div class="govuk-notification-banner__content">
<p class="govuk-notification-banner__heading">
Submit your comments by
<%= @planning_application.consultation.end_date %>
</p>
<p class="gov-uk-body">
Jump to
<a class="govuk-notification-banner__link" href="#comments-form">comments section</a>.
</p>
</div>
</div>
</div>
<div class="govuk-grid-column-full">
<% if @planning_application.boundary_geojson.present? %>
<%= tag.div id: :"map-container", data: {
controller: :map,
latLong: [@planning_application.latitude, @planning_application.longitude].join(","),
layers: {
redline: @planning_application.boundary_geojson
}
} do %>
<%= tag.div id: :map %>
<% end %>
<% else %>
<p class="govuk-body"><%= t(".no_digital_sitemap") %></p>
<% end %>
</div>
</div>

<hr class="govuk-section-break govuk-section-break--l govuk-section-break--visible">

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h2 class="govuk-heading-m">Pre-application details</h2>
<div id="description">
<p class="govuk-heading-s govuk-!-margin-bottom-2">Description</p>
<p class="govuk-body">
<%= @planning_application.description %>
</p>
</div>
<div id="application-type">
<p class="govuk-heading-s govuk-!-margin-bottom-2">Application type</p>
<p class="govuk-body">
<%= @planning_application.application_type.description %>
</p>
</div>
</div>
<div class="govuk-grid-column-one-third">
<p class="govuk-body-s govuk-!-margin-bottom-2"><strong>Planning Officer</strong></p>
<% if @planning_application.user %>
<p class="govuk-body-s govuk-!-margin-bottom-2"> <%= @planning_application.user.name %></p>
<p class="govuk-body-s govuk-!-margin-bottom-2"><%= @planning_application.user.mobile_number %></p>
<%= mail_to @planning_application.user.email, @planning_application.user.email, class: "govuk-link govuk-link--no-visited-state govuk-!-margin-top-1" %>
<% else %>
<p class="govuk-body-s govuk-!-margin-bottom-2"> No planning officer assigned</p>
<% end %>
</div>
</div>

<div class="govuk-heading-s">
<h2 id="comments-form">Submit a comment</h2>
</div>
1 change: 1 addition & 0 deletions engines/bops_consultees/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ en:
planning_applications:
show:
application_number: Application number
no_digital_sitemap: No digital site map provided
overview: Planning application overview
Loading

0 comments on commit 4f3e8ee

Please sign in to comment.