diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-13 13:13:28 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-13 13:13:28 -0400 |
commit | d365294db7edd79f01b51ac30413707a556f84bb (patch) | |
tree | 817396db46ac064962362970bea8e005a9cf2660 /app/views | |
parent | dd9b9ac1c2f032e02757e7e4fa4aa588234933d4 (diff) | |
download | thoughts-d365294db7edd79f01b51ac30413707a556f84bb.tar.gz thoughts-d365294db7edd79f01b51ac30413707a556f84bb.tar.bz2 thoughts-d365294db7edd79f01b51ac30413707a556f84bb.zip |
Added pending comment page to admin panel
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/comments/pending.haml | 25 | ||||
-rw-r--r-- | app/views/layouts/admin.html.haml | 2 |
2 files changed, 27 insertions, 0 deletions
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 @@ | |||
1 | - title "Pending Comments" | ||
2 | = will_paginate @comments | ||
3 | %table#entries | ||
4 | %tr | ||
5 | %th Text | ||
6 | %th Author | ||
7 | %th Blog post | ||
8 | %th Date updated | ||
9 | %th | ||
10 | - @comments.each do |comment| | ||
11 | %tr{ class: cycle("even", "odd") } | ||
12 | %td= comment.body | ||
13 | %td | ||
14 | %ul | ||
15 | %li= comment.username | ||
16 | %li= comment.email | ||
17 | - unless comment.website.empty? | ||
18 | %li= comment.website | ||
19 | %td= link_to comment.blog.title, comment.blog | ||
20 | %td= comment.published_at.strftime("%B %d, %Y, %l:%M%P") | ||
21 | %td | ||
22 | %ul.admin-actions | ||
23 | %li= link_to "Accept", accept_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to accept this comment?" } | ||
24 | %li= link_to "Reject", reject_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to reject this comment?" } | ||
25 | = 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 @@ | |||
39 | %li.minor= link_to "New game", new_admin_game_url | 39 | %li.minor= link_to "New game", new_admin_game_url |
40 | %li{major_sidebar_attrs("comments")} | 40 | %li{major_sidebar_attrs("comments")} |
41 | = link_to "Comments", admin_comments_url, class: "major-link" | 41 | = link_to "Comments", admin_comments_url, class: "major-link" |
42 | %ul.minors | ||
43 | %li.minor= link_to "Pending", pending_admin_comments_url | ||
42 | #main | 44 | #main |
43 | = yield | 45 | = yield |