the-teacher/the_comments

View on GitHub
app/views/the_comments/slim/index.html.slim

Summary

Maintainability
Test Coverage
- content_for :title do
  = t "the_comments.management"

- content_for :comments_sidebar do
  = render partial: 'the_comments/slim/sidebar'

- content_for :comments_main do
  = paginate @comments

  .comments
    - @comments.each do |comment|
      - klass = { published: :success, draft: :info, deleted: :danger }[comment.state.to_sym]
      .panel  class: "panel-#{klass}"  
        .panel-heading= comment.header_title
        .panel-body
          = render partial: 'the_comments/slim/comment_body', locals: { comment: comment }

  = paginate @comments