diff --git a/app/models/comment.rb b/app/models/comment.rb index 012f97794..6cd3f0796 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -26,6 +26,7 @@ class Comment < ApplicationRecord scope(:in_past_week, -> { where("confirmed_at > ?", 7.days.ago) }) delegate :email, to: :user + delegate :comment_authority_with_fallback, to: :application counter_culture :application, column_name: proc { |comment| comment.visible? ? "visible_comments_count" : nil }, diff --git a/app/views/_tailwind/comments/_delivery_status.html.erb b/app/views/_tailwind/comments/_delivery_status.html.erb index bdc2dbfbf..5354e4dfb 100644 --- a/app/views/_tailwind/comments/_delivery_status.html.erb +++ b/app/views/_tailwind/comments/_delivery_status.html.erb @@ -9,7 +9,7 @@ <% component.with_summary { "Delivered to the planning authority" } %> <%# TODO: Use more sensible time zone %> This comment was successfully delivered to the email server of - <%= comment.application.comment_authority_with_fallback %> + <%= comment.comment_authority_with_fallback %> on <%= comment.last_delivered_at.utc.to_fs(:long) %> UTC <% end %> @@ -17,7 +17,7 @@ <%= render Tailwind::DisclosureComponent.new(size: "xl") do |component| %> <% component.with_summary { "There was a problem delivering this to the planning authority" } %> The comment was hard bounced by the email server of - <%= comment.application.comment_authority_with_fallback %> + <%= comment.comment_authority_with_fallback %> on <%= comment.last_delivered_at.utc.to_fs(:long) %> UTC Please follow up by diff --git a/app/views/_tailwind/comments/preview.html.erb b/app/views/_tailwind/comments/preview.html.erb index 799b36eed..da1a3ec7f 100644 --- a/app/views/_tailwind/comments/preview.html.erb +++ b/app/views/_tailwind/comments/preview.html.erb @@ -27,7 +27,7 @@
<%= render Tailwind::ButtonComponent.new(tag: :button, size: "2xl", type: :primary) do %> - Publish (and send to <%= @comment.application.comment_authority_with_fallback %>) + Publish (and send to <%= @comment.comment_authority_with_fallback %>) <% end %>
@@ -37,7 +37,7 @@

Email preview

- Your comment and details will also automatically be sent to <%= @comment.application.comment_authority_with_fallback %>. + Your comment and details will also automatically be sent to <%= @comment.comment_authority_with_fallback %>. They may consider your submission when they decide whether to approve this application.

diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index ac4ce6edb..ed6a8620a 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -29,12 +29,12 @@ - elsif comment.last_delivered_successfully This comment was successfully delivered to the email server of - = comment.application.comment_authority_with_fallback + = comment.comment_authority_with_fallback at = comment.last_delivered_at - else The comment was hard bounced by the email server of - = comment.application.comment_authority_with_fallback + = comment.comment_authority_with_fallback at = comment.last_delivered_at Please follow up by diff --git a/app/views/comments/_confirmed.html.haml b/app/views/comments/_confirmed.html.haml index 823cdf58a..5afab3017 100755 --- a/app/views/comments/_confirmed.html.haml +++ b/app/views/comments/_confirmed.html.haml @@ -1,7 +1,7 @@ .notice-comment-confirmed %h1.page-title Thanks, your comment has been sent! %p - Your comment has been sent to #{comment.application.comment_authority_with_fallback} + Your comment has been sent to #{comment.comment_authority_with_fallback} and #{link_to "posted below", comment_path(comment)}. = link_to "Share your comment on Facebook", "https://www.facebook.com/sharer/sharer.php?u=#{comment_url(comment)}&t=",