fairmondo/fairmondo

View on GitHub
app/views/comments/_comment.html.slim

Summary

Maintainability
Test Coverage
.Comment-single class="commentable_#{comment.commentable_id}_comment_#{comment.id}"
  = image_tag comment.user_image_url(:thumb), class: "author_image"
  .meta
    = link_to comment.user_nickname, user_path(comment.user)
    |  
    = timeago_tag comment.created_at, lang: :de, class: "Timeago"
    = javascript_tag "$('.Timeago').timeago();" if request.xhr?
    /refresh timeago evaluation
    - if comment.id && policy(comment).destroy?
      .delete
        = link_to comment_path(comment.commentable, comment), method: :delete, remote: true do
          i.fa.fa-times
  .text
    = comment.text