openaustralia/planningalerts

View on GitHub
app/views/_tailwind/comments/_comment_with_application.html.erb

Summary

Maintainability
Test Coverage
<%# TODO: Can we factor out common elements between this partial and _comment.html.erb? %>
<%= render Tailwind::PanelListItem.new(url: comment_path(comment)) do |c| %>
  <div class="my-4">
    <%= render Tailwind::QuotedBlock.new do %>
      <div class="mb-6 text-xl text-navy">
        <div><%= c.linkify(comment.application.address) %></div>
        <div class="font-bold line-clamp-2"><%= comment.application.description %></div>
      </div>
      <% if comment.visible? %>
        <%# TODO: Use blockquote for the body of the comment? %>
        <%= render "comments/comment_text", comment: %>

        <%# TODO: Smaller line height? %>
        <div class="mt-6 text-lg font-bold text-navy">
          <%= comment.name %>
        </div>

        <%= render "comments/comment_date", comment: %>

        <%# Not showing an info box here with a detailed delivery status because it might have links in it. Don't want links inside of links. %>
        <div class="max-w-xl mt-6 text-xl text-warm-grey">
          <%= render "comments/delivery_status_text_short", comment: %>
        </div>
      <% else %>
        <p class="text-xl italic text-navy">This comment was hidden by site administrators</p>

        <div class="mt-6">
          <%= render "comments/comment_date", comment: %>
        </div>
      <% end %>
    <% end %>
  </div>
<% end %>

<%
=begin
%>

<figure class="comment-item panel" id="comment<%= comment.id %>">
  <%= render "comments/location_heading", comment: comment if with_address %>
  <div class="panel-body">
    <figcaption class="comment-meta comment-heading">
      <%= render "comments/meta_sentence", comment: %>
    </figcaption>
    <blockquote class="comment-text">
      <% if comment.visible? %>
        <%= comment_as_html(comment.text) %>
      <% else %>
        <em>Hidden by site administrators</em>
      <% end %>
    </blockquote>
  </div>
</figure>

<%
=end
%>