mconf/mconf-web

View on GitHub
app/views/posts/_post_with_children.html.haml

Summary

Maintainability
Test Coverage
.thread
  .thread-content.thread-content-full{id: "parent-#{post.id}"}
    .thread-title
      %h3
        = icon_comments()
        = post.title
      .post-author
        %span= t('.by')
        - if post.author && post.author.enabled?
          = link_to post.author.name, user_path(post.author)
        - else
          %span= t('_other.user.removed')
    .thread-description
      = render partial: "posts/parent_post" , locals: { post:  post, selected_post: false}
    %ul.thread-action-links
      - if can?(:create, post.space.posts.build)
        %li= link_to t('reply').downcase, reply_post_space_post_path(post.space, post), { name: post.id, title: t('comment.add'), class: "open-modal" }
      - if can?(:update, post)
        %li= link_to t('edit').downcase, edit_space_post_path(post.space, post), { name: post.id, title: t('edit'), class: "open-modal" }
      - if can?(:destroy, post)
        %li= link_to t('remove').downcase, space_post_path(post.space, post), {method: :delete, title: t('delete.one'), data: { confirm: t('delete.confirm', element: post.title) } }
    .thread-description
      - for comment in posts
        - thread_class = cycle("thread-odd" , "thread-even")
        = render partial: "post" , locals: { post:  comment, selected_post: false, thread_class: thread_class}