docbrown/app/views/comments/_liquid.html.erb
Jeremy Friesen a65954107f
Refactoring to add helper method (#16064)
* Refactoring to add helper method

Prior to this commit, we made view level calls to service modules.  This
refactor provides convenience methods on the model.

Furthermore, it addresses a few Rubocop violations that "come along for
the ride."

* Ensuring cached entity squaks like User

* Fixing broken spec

* Fixing typo
2022-01-12 11:21:44 -05:00

20 lines
670 B
Text

<div class="liquid-comment">
<% if comment %>
<div class="details">
<a href="/<%= comment.user.username %>">
<img class="profile-pic" src="<%= comment.user.profile_image_url_for(length: 50) %>" alt="<%= comment.user.username %> profile image" />
</a>
<a href="/<%= comment.user.username %>">
<span class="comment-username"><%= comment.user.name %></span>
</a>
<%= render "comments/comment_date", decorated_comment: comment.decorate %>
</div>
<div class="body">
<%= comment.safe_processed_html %>
</div>
<% else %>
<div class="body">
<p>Comment Not Found</p>
</div>
<% end %>
</div>