- @page_title = "Comments" .row-fluid = render :partial => "/gluttonberg/admin/content/main/sidebar" .span9 .row-fluid .page-header %h1 = @page_title .subnav - if action_name != "index" = sub_nav do = nav_link("Pending (#{Gluttonberg::Blog::Comment.all_pending.count})", admin_comments_pending_path) = nav_link("Approved (#{Gluttonberg::Blog::Comment.all_approved.count})", admin_comments_approved_path) = nav_link("Rejected (#{Gluttonberg::Blog::Comment.all_rejected.count})", admin_comments_rejected_path) = nav_link("Spam (#{Gluttonberg::Blog::Comment.all_spam.count})", admin_comments_spam_path) - if @comments.empty? %p.empty No Comments - else %table{:cellpadding => 0, :cellspacing => 0, :summary => "Articles" , :class => "table table-bordered "} %thead %tr %th Author %th Comment %th Date Commented %th.controls Controls %tbody - @comments.each do |comment| %tr %td{:style => "width:15%;"} = comment.author_name %td{:style => "width:50%;"} = simple_format(comment.body) %td{:style => "width:10%;"} = comment.created_at %td.controls{:style => "width:20%;"} .btn-group %a{ :class => "btn dropdown-toggle" , "data-toggle" => "dropdown" , :href => "#"} Actions %span.caret %ul.dropdown-menu - if comment.moderation_required && can?(:moderate , Gluttonberg::Blog::Comment) %li= link_to("Approve", admin_comments_moderation_path(comment, :moderation => "approve"), :class => "") %li= link_to( "Reject", admin_comments_moderation_path(comment, :moderation => "disapprove") , :class => "") %li= link_to( "Block comments from this author", admin_comments_block_author_path(comment) , :class => "") - elsif can?(:moderate , Gluttonberg::Blog::Comment) - if comment.approved == true %li= link_to( "Reject", admin_comments_moderation_path(comment, :moderation => "disapprove") , :class => "") - else %li= link_to("Approve", admin_comments_moderation_path(comment, :moderation => "approve"), :class => "") %li.divider %li.danger= link_to("Delete", admin_comments_delete_path(comment), :class => "") = will_paginate(@comments) - if action_name == "pending" %p If you have recently updated spam settings then please click on following link for re-assessing all pending comments with new spam settings. = link_to "Detect spam in all pending comments" , admin_comments_spam_detection_for_all_pending_path , :class => "btn btn-info"