From d365294db7edd79f01b51ac30413707a556f84bb Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Fri, 13 Oct 2023 13:13:28 -0400 Subject: Added pending comment page to admin panel --- app/views/admin/comments/pending.haml | 25 +++++++++++++++++++++++++ app/views/layouts/admin.html.haml | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 app/views/admin/comments/pending.haml (limited to 'app/views') diff --git a/app/views/admin/comments/pending.haml b/app/views/admin/comments/pending.haml new file mode 100644 index 0000000..6abf371 --- /dev/null +++ b/app/views/admin/comments/pending.haml @@ -0,0 +1,25 @@ +- 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.published_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?" } += will_paginate @comments diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 0f54183..3949b5e 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -39,5 +39,7 @@ %li.minor= link_to "New game", new_admin_game_url %li{major_sidebar_attrs("comments")} = link_to "Comments", admin_comments_url, class: "major-link" + %ul.minors + %li.minor= link_to "Pending", pending_admin_comments_url #main = yield -- cgit 1.4.1