Added comments

This commit is contained in:
Godwin
2016-07-09 15:25:27 -07:00
parent 8d010eaf3b
commit c6f8d4ed58
21 changed files with 1206 additions and 27 deletions
@@ -0,0 +1,15 @@
%p=_('email.workshop_comment.paragraph.user_said', vars: {user_name: @comment.user.name})
%blockquote
=_!@comment.comment
- if @comment.reply?
- original_comment = @comment.comment_object
%p=_('email.workshop_comment.paragraph.user_said', vars: {user_name: original_comment.user.name})
%blockquote
=_!original_comment.comment
%p
=_'email.workshop.paragraph.view_workshop'
- workshop_link = @host + view_workshop_path(@workshop.conference.slug, @workshop.id)
%a{href: workshop_link}=workshop_link
+21
View File
@@ -67,3 +67,24 @@
= columns(medium: 12, class: 'workshop-notes') do
%h3=_'articles.workshops.headings.notes','Notes'
= richtext workshop.notes, 3
= columns(medium: 12, id: :comments) do
%h3=_'articles.workshops.headings.Comments'
%ul.comments
- workshop.comments.each do | comment |
%li.comment{id: "comment-#{comment.id}"}
= comment(comment)
- sub_comments = comment.comments
- if sub_comments.present?
%ul.sub-comments.comments
- sub_comments.each do | sub_comment |
%li.sub-comment.comment{id: "comment-#{sub_comment.id}"}
= comment(sub_comment)
= form_tag workshop_comment_path(workshop.conference.slug, workshop.id) do
= hidden_field_tag :comment_id, comment.id
= textarea :reply, nil, plain: true, required: true, label: false, labelledby: "replyto-#{comment.id}"
.actions.right
= button_tag :reply, value: :reply, data: {opens: "#comment-#{comment.id} form", focus: :textarea}, class: :small, id: "replyto-#{comment.id}"
= form_tag workshop_comment_path(workshop.conference.slug, workshop.id) do
= textarea :comment, nil, plain: true, required: true, label: false, labelledby: :add_comment
.actions.right
= button_tag :add_comment, value: :add_comment, id: :add_comment