Files
fizzy/app/views/comments/_comment.html.erb
T

21 lines
1.0 KiB
Plaintext

<%# FIXME: Can't use a Current.user reference in a partial that must be cached. Needs to convert to use Stimulus controller pulling from a meta current-id %>
<%= tag.div id: dom_id(comment), class: [ "comment flex align-start full-width", { "comment--mine": Current.user == comment.creator } ] do %>
<figure class="comment__avatar flex-item-no-shrink">
<%= avatar_tag comment.creator, loading: :lazy %>
</figure>
<div class="comment__content flex flex-column full-width fill-shade border-radius">
<div class="comment__author flex align-center gap-half">
<strong><%= comment.creator.name %></strong>
<%= link_to bucket_bubble_path(comment.bubble.bucket, comment.bubble, anchor: "comment_#{comment.id}"), class: "txt-undecorated" do %>
<%= tag.time comment.created_at, class: "comment__timestamp" do %>
<%= comment.created_at.strftime("%b %d") %>
<% end %>
<% end %>
</div>
<div class="comment__body txt-align-start">
<%= simple_format comment.body %>
</div>
</div>
<% end %>