diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-14 11:12:05 -0400 |
commit | fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd (patch) | |
tree | 27d42a442c000781d100dfa7fd8b976aefb03c31 /app/views | |
parent | 0aace2986a9a7a6d4c84a9ba6819d3df7821e267 (diff) | |
download | thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.gz thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.tar.bz2 thoughts-fce622b5b1959892b6f6ea94bfe3a1c4eb52d8dd.zip |
Added comment replying
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/comment_mailer/reply_comment_email.html.haml | 14 | ||||
-rw-r--r-- | app/views/comment_mailer/reply_comment_email.text.erb | 19 | ||||
-rw-r--r-- | app/views/comments/_comment.html.haml | 1 | ||||
-rw-r--r-- | app/views/comments/_form.html.haml | 6 |
4 files changed, 40 insertions, 0 deletions
diff --git a/app/views/comment_mailer/reply_comment_email.html.haml b/app/views/comment_mailer/reply_comment_email.html.haml new file mode 100644 index 0000000..22009ee --- /dev/null +++ b/app/views/comment_mailer/reply_comment_email.html.haml | |||
@@ -0,0 +1,14 @@ | |||
1 | %p | ||
2 | A reply has been posted to your comment on | ||
3 | = succeed "." do | ||
4 | = link_to @comment.blog.title, @comment.blog | ||
5 | The original comment: | ||
6 | %blockquote= @comment.reply_to.body | ||
7 | %p | ||
8 | = @comment.username | ||
9 | left the following response: | ||
10 | %blockquote= @comment.body | ||
11 | %p | ||
12 | Posted: | ||
13 | = @comment.published_at.strftime("%B #{@comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") | ||
14 | %p= link_to "See the comment on the web", blog_url(@comment.blog, anchor: "comment-#{@comment.id}") | ||
diff --git a/app/views/comment_mailer/reply_comment_email.text.erb b/app/views/comment_mailer/reply_comment_email.text.erb new file mode 100644 index 0000000..bd60692 --- /dev/null +++ b/app/views/comment_mailer/reply_comment_email.text.erb | |||
@@ -0,0 +1,19 @@ | |||
1 | A reply has been posted to your comment on <%= @comment.blog.title %>. The original comment: | ||
2 | |||
3 | --- | ||
4 | |||
5 | <%= @comment.reply_to.body %> | ||
6 | |||
7 | --- | ||
8 | |||
9 | <%= @comment.username %> posted the following response: | ||
10 | |||
11 | --- | ||
12 | |||
13 | <%= @comment.body %> | ||
14 | |||
15 | --- | ||
16 | |||
17 | Posted: <%= @comment.published_at.strftime("%B #{@comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") %> | ||
18 | |||
19 | See the comment on the web: <%= blog_url(@comment.blog, anchor: "comment-#{@comment.id}") %> | ||
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 @@ | |||
11 | = link_to comment.username, comment.website | 11 | = link_to comment.username, comment.website |
12 | on | 12 | on |
13 | = comment.published_at.strftime("%B #{comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") | 13 | = comment.published_at.strftime("%B #{comment.published_at.day.ordinalize}, %Y at %-I:%M:%S%P") |
14 | = 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 @@ | |||
1 | = form_for @comment || blog.comments.new, html: { id: "comment-form" } do |f| | 1 | = form_for @comment || blog.comments.new, html: { id: "comment-form" } do |f| |
2 | = f.hidden_field :reply_to_id | ||
2 | %fieldset#comment-body-field | 3 | %fieldset#comment-body-field |
3 | %blockquote.bubble.rounded.bottom | 4 | %blockquote.bubble.rounded.bottom |
5 | #comment-reply-msg | ||
6 | = link_to (image_tag "cross"), "#", class: "comment-reply-cancel" | ||
7 | Replying to comment by | ||
8 | = succeed ":" do | ||
9 | %span.comment-reply-author | ||
4 | = f.label :body | 10 | = f.label :body |
5 | = f.text_area :body | 11 | = f.text_area :body |
6 | %cite.bubble Feel free to post a comment! You may use Markdown. | 12 | %cite.bubble Feel free to post a comment! You may use Markdown. |