From 17d660fd4b8516d6b446f7c41d7b076a29a242a1 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 12 Oct 2023 17:44:38 -0400 Subject: Added comment deleting Also I seem to have fixed the JS errors that were preventing the fancy stuff in the admin panel from working. --- app/views/admin/comments/index.html.haml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/views/admin/comments/index.html.haml (limited to 'app/views/admin') diff --git a/app/views/admin/comments/index.html.haml b/app/views/admin/comments/index.html.haml new file mode 100644 index 0000000..7b25c05 --- /dev/null +++ b/app/views/admin/comments/index.html.haml @@ -0,0 +1,23 @@ +- title "Comments" +%table#entries + %tr + %th Text + %th Author + %th Blog post + %th Date published + %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 "View", blog_url(comment.blog, anchor: "comment-#{comment.id}") + %li= link_to "Delete", admin_comment_url(comment), method: :delete, data: { confirm: "Are you sure?" } -- cgit 1.4.1