2012-06-30 18:18:36 +02:00
|
|
|
<li id="comment_<%= comment.short_id %>" data-shortid="<%= comment.short_id %>"
|
|
|
|
class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
|
|
|
|
"upvoted" : "downvoted") : "" %>
|
2012-07-03 19:12:20 +02:00
|
|
|
<%= comment.highlighted ? "highlighted" : "" %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<%= comment.score <= 0 ? "negative" : "" %>
|
|
|
|
<%= comment.score <= -3 ? "negative_3" : "" %>
|
|
|
|
<%= comment.score <= -5 ? "negative_5" : "" %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<%= comment.score <= -7 ? "negative_7" : "" %>">
|
2012-07-12 20:30:20 +02:00
|
|
|
<% if !comment.is_gone? %>
|
|
|
|
<div class="voters">
|
|
|
|
<a class="upvoter"></a>
|
|
|
|
<div class="score">
|
|
|
|
<%= comment.score %>
|
|
|
|
</div>
|
|
|
|
<a class="downvoter"></a>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<div class="details">
|
|
|
|
<div class="byline">
|
2012-06-30 18:18:36 +02:00
|
|
|
<% if comment.previewing %>
|
|
|
|
<a><%= comment.user.username %></a>
|
2012-06-30 21:14:35 +02:00
|
|
|
previewed
|
2012-06-17 03:15:46 +02:00
|
|
|
just now
|
2012-06-30 18:18:36 +02:00
|
|
|
<% else %>
|
|
|
|
<a href="/u/<%= comment.user.username %>"><%= comment.user.username
|
|
|
|
%></a>
|
2012-06-30 21:14:35 +02:00
|
|
|
|
2012-07-01 20:31:31 +02:00
|
|
|
<%= comment.has_been_edited?? "edited" : "" %>
|
|
|
|
<%= time_ago_in_words(comment.has_been_edited?? comment.updated_at :
|
|
|
|
comment.created_at).gsub(/^about /, "") %> ago
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
|
|
|
|
2012-06-30 21:14:35 +02:00
|
|
|
<% if !comment.previewing %>
|
|
|
|
|
|
|
|
|
<a href="<%= story.comments_url %>/comments/<%= comment.short_id
|
|
|
|
%>">link</a>
|
2012-07-05 02:33:12 +02:00
|
|
|
|
2012-07-12 20:30:20 +02:00
|
|
|
<% if comment.is_editable_by_user?(@user) %>
|
|
|
|
|
|
|
|
|
<a class="comment_editor">edit</a>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if comment.is_gone? && comment.is_undeletable_by_user?(@user) %>
|
2012-07-05 02:33:12 +02:00
|
|
|
|
|
2012-07-12 20:30:20 +02:00
|
|
|
<a class="comment_undeletor">undelete</a>
|
2012-09-02 16:50:07 +02:00
|
|
|
<% elsif !comment.is_gone? && comment.is_deletable_by_user?(@user) %>
|
2012-07-12 20:30:20 +02:00
|
|
|
|
|
|
|
|
<a class="comment_deletor">delete</a>
|
|
|
|
<% end %>
|
|
|
|
|
2012-11-22 05:13:50 +01:00
|
|
|
<% if !story.is_gone? && !comment.is_gone? &&
|
|
|
|
!(defined?(show_story) && show_story) %>
|
2012-07-12 20:30:20 +02:00
|
|
|
|
|
2012-07-05 02:33:12 +02:00
|
|
|
<a class="comment_replier">reply</a>
|
2012-06-30 21:14:35 +02:00
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
2012-12-09 05:37:30 +01:00
|
|
|
<span class="reason">
|
|
|
|
<% if comment.downvotes > 0 && comment.user_id == @user.try(:id) %>
|
|
|
|
| <%= comment.vote_summary.downcase %>
|
|
|
|
<% elsif comment.current_vote && comment.current_vote[:vote] == -1 %>
|
|
|
|
| <%= Vote::COMMENT_REASONS[comment.current_vote[:reason]].downcase
|
|
|
|
%>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
2012-06-30 21:14:35 +02:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if defined?(show_story) && show_story %>
|
2012-07-12 00:20:43 +02:00
|
|
|
| on:
|
2012-06-30 21:14:35 +02:00
|
|
|
<a href="<%= story.comments_url %>"><%= story.title %></a>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="comment_text">
|
2012-07-12 20:30:20 +02:00
|
|
|
<% if comment.is_gone? %>
|
|
|
|
<p>
|
|
|
|
<span class="na">
|
2012-12-30 19:11:47 +01:00
|
|
|
[<%= comment.gone_text %>]
|
2012-07-12 20:30:20 +02:00
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
<% else %>
|
|
|
|
<%= raw comment.markeddown_comment %>
|
|
|
|
<% end %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
|
|
|
<div class="comment_reply"></div>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
</li>
|