diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 17:44:38 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-12 17:44:38 -0400 |
commit | 17d660fd4b8516d6b446f7c41d7b076a29a242a1 (patch) | |
tree | 115e7f3c1a3aa5bdc29dfa6d0c994eb795c658f6 /app/views | |
parent | 835af696703484208882a70cc5dd47c5838ecf58 (diff) | |
download | thoughts-17d660fd4b8516d6b446f7c41d7b076a29a242a1.tar.gz thoughts-17d660fd4b8516d6b446f7c41d7b076a29a242a1.tar.bz2 thoughts-17d660fd4b8516d6b446f7c41d7b076a29a242a1.zip |
Added comment deleting
Also I seem to have fixed the JS errors that were preventing the fancy stuff in the admin panel from working.
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/comments/index.html.haml | 23 | ||||
-rw-r--r-- | app/views/comments/_comment.html.haml | 2 | ||||
-rw-r--r-- | app/views/layouts/admin.html.haml | 2 |
3 files changed, 26 insertions, 1 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..7b25c05 --- /dev/null +++ b/app/views/admin/comments/index.html.haml | |||
@@ -0,0 +1,23 @@ | |||
1 | - title "Comments" | ||
2 | %table#entries | ||
3 | %tr | ||
4 | %th Text | ||
5 | %th Author | ||
6 | %th Blog post | ||
7 | %th Date published | ||
8 | %th | ||
9 | - @comments.each do |comment| | ||
10 | %tr{ class: cycle("even", "odd") } | ||
11 | %td= comment.body | ||
12 | %td | ||
13 | %ul | ||
14 | %li= comment.username | ||
15 | %li= comment.email | ||
16 | - unless comment.website.empty? | ||
17 | %li= comment.website | ||
18 | %td= link_to comment.blog.title, comment.blog | ||
19 | %td= comment.published_at.strftime("%B %d, %Y, %l:%M%P") | ||
20 | %td | ||
21 | %ul.admin-actions | ||
22 | %li= link_to "View", blog_url(comment.blog, anchor: "comment-#{comment.id}") | ||
23 | %li= link_to "Delete", admin_comment_url(comment), method: :delete, data: { confirm: "Are you sure?" } | ||
diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 3e10759..3ad21e9 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml | |||
@@ -1,4 +1,4 @@ | |||
1 | .blog-comment | 1 | .blog-comment{ id: "comment-#{comment.id}" } |
2 | %blockquote.bubble.rounded.bottom | 2 | %blockquote.bubble.rounded.bottom |
3 | = image_tag comment.gravatar_url, class: "comment-avatar" | 3 | = image_tag comment.gravatar_url, class: "comment-avatar" |
4 | = markdown(comment.body, { restricted: true }) | 4 | = markdown(comment.body, { restricted: true }) |
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 1c865b0..5d75ef5 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml | |||
@@ -37,5 +37,7 @@ | |||
37 | = link_to "Games", admin_games_url, class: "major-link" | 37 | = link_to "Games", admin_games_url, class: "major-link" |
38 | %ul.minors | 38 | %ul.minors |
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")} | ||
41 | = link_to "Comments", admin_comments_url, class: "major-link" | ||
40 | #main | 42 | #main |
41 | = yield | 43 | = yield |