about summary refs log tree commit diff stats
path: root/app/views/admin/comments
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/admin/comments')
-rw-r--r--app/views/admin/comments/index.html.haml25
-rw-r--r--app/views/admin/comments/pending.haml32
2 files changed, 57 insertions, 0 deletions
diff --git a/app/views/admin/comments/index.html.haml b/app/views/admin/comments/index.html.haml new file mode 100644 index 0000000..8cfa0bb --- /dev/null +++ b/app/views/admin/comments/index.html.haml
@@ -0,0 +1,25 @@
1- title "Comments"
2= will_paginate @comments
3%table#entries
4 %tr
5 %th Text
6 %th Author
7 %th Blog post
8 %th Date published
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 "View", blog_url(comment.blog, anchor: "comment-#{comment.id}")
24 %li= link_to "Delete", admin_comment_url(comment), method: :delete, data: { confirm: "Are you sure?" }
25= will_paginate @comments
diff --git a/app/views/admin/comments/pending.haml b/app/views/admin/comments/pending.haml new file mode 100644 index 0000000..5352b12 --- /dev/null +++ b/app/views/admin/comments/pending.haml
@@ -0,0 +1,32 @@
1- title "Pending Comments"
2= will_paginate @comments
3= form_tag mass_admin_comments_url, method: :post do
4 #action-box
5 = select_tag "mass_action", options_for_select(["Delete", "Mark Spam"]), include_blank: true
6 = submit_tag "Mass action", data: { confirm: "Are you sure you want to do this action?" }
7 %table#entries
8 %tr
9 %th= check_box_tag "check_all"
10 %th Text
11 %th Author
12 %th Blog post
13 %th Date updated
14 %th
15 - @comments.each do |comment|
16 %tr{ class: cycle("even", "odd") }
17 %td= check_box_tag "comment_ids[]", comment.id, class: "comment_ids"
18 %td= comment.body
19 %td
20 %ul
21 %li= comment.username
22 %li= comment.email
23 - unless comment.website.empty?
24 %li= comment.website
25 %td= link_to comment.blog.title, comment.blog
26 %td= comment.created_at.strftime("%B %d, %Y, %l:%M%P")
27 %td
28 %ul.admin-actions
29 %li= link_to "Accept", accept_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to accept this comment?" }
30 %li= link_to "Reject", reject_admin_comment_url(comment), method: :post, data: { confirm: "Are you sure you want to reject this comment?" }
31 %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?" }
32= will_paginate @comments