openaustralia/planningalerts

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

Summary

Maintainability
Test Coverage
<%= render Tailwind::QuotedBlock.new do %>
  <% 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: %>

    <%# This bit with the delivery status and actions can be hidden by setting show_extra: false %>
    <% if show_extra %>
      <%= render "comments/delivery_status", comment: %>
      <div class="mt-4">
        <%= render "comments/actions", comment: %>
      </div>
    <% end %>
  <% 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 %>

<%
=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
%>