Skip to content

Commit

Permalink
Use bops_ticket_panel
Browse files Browse the repository at this point in the history
  • Loading branch information
EGiataganas committed Feb 21, 2025
1 parent b3e864b commit dec7cab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,18 @@
<strong>Relevant dates: </strong> <%= evidence_group.date_range %>
</p>

<% if evidence_group.applicant_comment.present? %>
<div class="govuk-inset-text" style="background-color: #f3f2f1; border-left: 10px solid #b1b4b6;">
<p class="govuk-body">
<strong>Applicant comment</strong>
</p>
<p class="govuk-body">
<%= evidence_group.applicant_comment %>
</p>
</div>
<% if applicant_comment = evidence_group.applicant_comment %>
<%= bops_ticket_panel(colour: "grey", classes: %w[govuk-!-margin-bottom-2]) do |ticket| %>
<% ticket.with_body { applicant_comment } %>
<% ticket.with_footer { "By applicant" } %>
<% end %>
<% end %>

<% if evidence_group.persisted_comments.any? %>
<div class="govuk-inset-text" style="background-color: #fff7bf; border-left: 10px solid #ffdd00;">
<p class="govuk-body">
<strong>Officer comment</strong>
</p>
<p class="govuk-body">
<%= simple_format(evidence_group.persisted_comments.last.text) %>
</p>
</div>
<% if comment = evidence_group.last_comment %>
<%= bops_ticket_panel(colour: "yellow", classes: %w[govuk-!-margin-bottom-2]) do |ticket| %>
<% ticket.with_body { comment.text } %>
<% ticket.with_footer { comment.information } %>
<% end %>
<% end %>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def initialize(planning_application:, evidence_groups:)
end

delegate :immunity_detail, to: :planning_application
delegate :bops_ticket_panel, to: :helpers

attr_reader :planning_application, :evidence_groups
end
Expand Down
4 changes: 4 additions & 0 deletions app/presenters/evidence_group_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ def date_range
end
end

def last_comment
@last_comment ||= persisted_comments.last
end

private

attr_reader :evidence_group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(colour: nil, id: nil, classes: [], html_attributes: {})
end

def call
tag.div(**default_attributes) do
tag.div(**html_attributes) do
safe_join([body_wrapper, footer_wrapper].compact_blank)
end
end
Expand Down

0 comments on commit dec7cab

Please sign in to comment.