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" : "" %>
|
2013-12-24 00:15:58 +01:00
|
|
|
<%= comment.score <= 0 ? "negative" : "" %>
|
|
|
|
<%= comment.score <= -3 ? "negative_3" : "" %>
|
|
|
|
<%= comment.score <= -5 ? "negative_5" : "" %>
|
|
|
|
<%= comment.score <= -7 ? "negative_7" : "" %>">
|
2012-07-12 20:30:20 +02:00
|
|
|
<% if !comment.is_gone? %>
|
|
|
|
<div class="voters">
|
2014-01-13 06:17:09 +01:00
|
|
|
<% if @user %>
|
|
|
|
<a class="upvoter"></a>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to "", login_url, :class => "upvoter" %>
|
|
|
|
<% end %>
|
|
|
|
<div class="score"><%= comment.score %></div>
|
|
|
|
<% if @user && @user.can_downvote? %>
|
|
|
|
<a class="downvoter"></a>
|
|
|
|
<% else %>
|
|
|
|
<span class="downvoter downvoter_stub"></span>
|
|
|
|
<% end %>
|
2012-07-12 20:30:20 +02:00
|
|
|
</div>
|
|
|
|
<% end %>
|
2013-12-24 00:15:58 +01: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 %>
|
2014-01-13 06:17:09 +01:00
|
|
|
<a href="/u/<%= comment.user.username %>"
|
2014-01-13 17:12:17 +01:00
|
|
|
<% if !comment.user.is_active? %>
|
|
|
|
class="inactive_user"
|
2014-01-13 06:17:09 +01:00
|
|
|
<% elsif comment.user.is_new? %>
|
|
|
|
class="new_user"
|
|
|
|
<% end %>
|
|
|
|
><%= 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" : "" %>
|
2013-02-22 18:22:39 +01:00
|
|
|
<%= raw(time_ago_in_words_label(comment.has_been_edited? ?
|
|
|
|
comment.updated_at : comment.created_at).gsub(/^about /, "")) %> ago
|
2013-12-28 19:00:29 +01:00
|
|
|
<%= comment.is_from_email?? "via e-mail" : "" %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
|
|
|
|
2012-06-30 21:14:35 +02:00
|
|
|
<% if !comment.previewing %>
|
|
|
|
|
|
2014-01-13 08:11:34 +01:00
|
|
|
<a href="<%= comment.url %>">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 %>
|
|
|
|
|
2014-01-13 08:11:34 +01:00
|
|
|
<% if @user && !comment.story.is_gone? && !comment.is_gone? &&
|
2012-11-22 05:13:50 +01:00
|
|
|
!(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:
|
2014-01-13 08:11:34 +01:00
|
|
|
<a href="<%= comment.story.comments_url %>"><%= comment.story.title %></a>
|
2012-06-30 21:14:35 +02:00
|
|
|
<% end %>
|
2013-12-24 00:15:58 +01:00
|
|
|
</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 %>
|
2013-12-24 00:15:58 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2012-06-17 03:15:46 +02:00
|
|
|
</li>
|
2014-01-18 20:13:58 +01:00
|
|
|
|
|
|
|
<% if comment.highlighted %>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("html").animate({
|
|
|
|
scrollTop: $("#comment_<%= comment.short_id %>").offset().top
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<% end %>
|