|
1 |
| -<h1>Comment by <%= link_to comment.user.name, comment.user %></h1> |
2 |
| -<p><%= comment.text %></p> |
3 |
| -<div style="display: flex; align-items: center;"> |
4 |
| - Posted on <%= comment.created_at.strftime("%B %d, %Y at %I:%M %p") %> |
5 |
| - - Score: <span id="score-Comment-<%= comment.id %>"><%= comment.score %></span> |
6 |
| - <% user_vote = @user_votes[comment.id] %> |
7 |
| - <%= button_to "Upvote", upvote_article_comment_path(comment), method: :post, class: "btn btn-sm upvote-button", data: { votable_type: 'Comment', votable_id: comment.id, article_id: comment.article.id } %> |
8 |
| - <%= button_to "Downvote", downvote_article_comment_path(comment), method: :post, method: :post, class: "btn btn-sm downvote-button", data: { votable_type: 'Comment', votable_id: comment.id, article_id: comment.article.id } %> |
9 |
| -</div> |
10 |
| -<h2>Replies</h2> |
11 |
| -<ul> |
12 |
| - <% comment.replies.each do |reply| %> |
13 |
| - <%= render_comment_tree(reply) %> |
14 |
| - <% end %> |
15 |
| -</ul> |
16 |
| - |
17 |
| -<h3>Write a Reply</h3> |
18 |
| -<%= form_with(model: [comment.article, @reply], local: true) do |form| %> |
19 |
| - <div class="field"> |
20 |
| - <%= form.text_area :text %> |
21 |
| - </div> |
22 |
| - <%= form.hidden_field :parent_id, value: comment.id %> |
23 |
| - <div class="actions"> |
24 |
| - <%= form.submit "Reply" %> |
25 |
| - </div> |
26 |
| -<% end %> |
27 |
| - |
| 1 | +<tr style="height:10px"></tr> |
| 2 | +<tr> |
| 3 | + <td> |
| 4 | + <table border="0" cellpadding="0" cellspacing="0"> |
| 5 | + <tbody> |
| 6 | + <tr> |
| 7 | + <td align="right"> |
| 8 | + <span class="rank"><%= 1 %>.</span> |
| 9 | + </td> |
| 10 | + <td valign="top" class="votelinks"> |
| 11 | + <center> |
| 12 | + <%= button_to upvote_article_comment_path(comment), method: :post, class: "btn btn-sm upvote-button", data: { votable_type: 'Comment', votable_id: comment.id, article_id: comment.article.id } do %> |
| 13 | + <i class="fas fa-arrow-up"></i> |
| 14 | + <% end %> |
| 15 | + <%= button_to downvote_article_comment_path(comment), method: :post, class: "btn btn-sm downvote-button", data: { votable_type: 'Comment', votable_id: comment.id, article_id: comment.article.id } do %> |
| 16 | + <i class="fas fa-arrow-down"></i> |
| 17 | + <% end %> |
| 18 | + </center> |
| 19 | + </td> |
| 20 | + <td valign="top" style="padding-left: 10px;"> |
| 21 | + <%= comment.text %> |
| 22 | + </td> |
| 23 | + </tr> |
| 24 | + <tr> |
| 25 | + <td colspan="2"></td> |
| 26 | + <td class="subtext"> |
| 27 | + <span id="score-Comment-<%= comment.id %>"><%= comment.score %> points</span> |
| 28 | + by <%= link_to comment.user.name, user_path(comment.user) %> |
| 29 | + <span class="age"><%= time_ago_in_words(comment.created_at) %> ago</span> |
| 30 | + </td> |
| 31 | + </tr> |
| 32 | + <tr style="height:5px"></tr> |
| 33 | + </tbody> |
| 34 | + </table> |
| 35 | + <%= form_with(model: [comment.article, @reply], local: true) do |form| %> |
| 36 | + <div class="field"> |
| 37 | + <%= form.text_area :text %> |
| 38 | + </div> |
| 39 | + <%= form.hidden_field :parent_id, value: comment.id %> |
| 40 | + <div class="actions"> |
| 41 | + <%= form.submit "Reply" %> |
| 42 | + </div> |
| 43 | + <% end %> |
| 44 | + </td> |
| 45 | +</tr> |
0 commit comments