From fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 14 Oct 2023 11:12:05 -0400 Subject: Added comment replying --- app/views/comments/_comment.html.haml | 1 + app/views/comments/_form.html.haml | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'app/views/comments') diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 3ad21e9..225b5d9 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -11,3 +11,4 @@ = link_to comment.username, comment.website on = comment.published_at.strftime("%B #{comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") + = link_to (image_tag "comment_add.png"), "#", class: "comment-reply-to", title: "Reply to comment", data: { comment_id: comment.id, comment_author: comment.username } diff --git a/app/views/comments/_form.html.haml b/app/views/comments/_form.html.haml index f6df807..eb374c7 100644 --- a/app/views/comments/_form.html.haml +++ b/app/views/comments/_form.html.haml @@ -1,6 +1,12 @@ = form_for @comment || blog.comments.new, html: { id: "comment-form" } do |f| + = f.hidden_field :reply_to_id %fieldset#comment-body-field %blockquote.bubble.rounded.bottom + #comment-reply-msg + = link_to (image_tag "cross"), "#", class: "comment-reply-cancel" + Replying to comment by + = succeed ":" do + %span.comment-reply-author = f.label :body = f.text_area :body %cite.bubble Feel free to post a comment! You may use Markdown. -- cgit 1.4.1