From 2e1365d37bddf787c7089126c1a5ff1c623ab0e2 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 20 Mar 2024 10:49:38 -0400 Subject: Added mass pending comment deletion/markspamming --- app/views/admin/comments/pending.haml | 52 +++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'app/views') diff --git a/app/views/admin/comments/pending.haml b/app/views/admin/comments/pending.haml index 3303457..5352b12 100644 --- a/app/views/admin/comments/pending.haml +++ b/app/views/admin/comments/pending.haml @@ -1,26 +1,32 @@ - title "Pending Comments" = will_paginate @comments -%table#entries - %tr - %th Text - %th Author - %th Blog post - %th Date updated - %th - - @comments.each do |comment| - %tr{ class: cycle("even", "odd") } - %td= comment.body - %td - %ul - %li= comment.username - %li= comment.email - - unless comment.website.empty? - %li= comment.website - %td= link_to comment.blog.title, comment.blog - %td= comment.created_at.strftime("%B %d, %Y, %l:%M%P") - %td - %ul.admin-actions - %li= link_to "Accept", accept_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to accept this comment?" } - %li= link_to "Reject", reject_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to reject this comment?" } - %li= link_to "Mark Spam", mark_spam_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to mark this comment as spam?" } += form_tag mass_admin_comments_url, method: :post do + #action-box + = select_tag "mass_action", options_for_select(["Delete", "Mark Spam"]), include_blank: true + = submit_tag "Mass action", data: { confirm: "Are you sure you want to do this action?" } + %table#entries + %tr + %th= check_box_tag "check_all" + %th Text + %th Author + %th Blog post + %th Date updated + %th + - @comments.each do |comment| + %tr{ class: cycle("even", "odd") } + %td= check_box_tag "comment_ids[]", comment.id, class: "comment_ids" + %td= comment.body + %td + %ul + %li= comment.username + %li= comment.email + - unless comment.website.empty? + %li= comment.website + %td= link_to comment.blog.title, comment.blog + %td= comment.created_at.strftime("%B %d, %Y, %l:%M%P") + %td + %ul.admin-actions + %li= link_to "Accept", accept_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to accept this comment?" } + %li= link_to "Reject", reject_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to reject this comment?" } + %li= link_to "Mark Spam", mark_spam_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to mark this comment as spam?" } = will_paginate @comments -- cgit 1.4.1