8c3841331d
though i wonder with highlighting comments and now scrolling to them, why we bother excluding all other threads. we aren't pagingating threads anyway.
108 lines
3.3 KiB
Plaintext
108 lines
3.3 KiB
Plaintext
<li id="comment_<%= comment.short_id %>" data-shortid="<%= comment.short_id %>"
|
|
class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
|
|
"upvoted" : "downvoted") : "" %>
|
|
<%= comment.highlighted ? "highlighted" : "" %>
|
|
<%= comment.score <= 0 ? "negative" : "" %>
|
|
<%= comment.score <= -3 ? "negative_3" : "" %>
|
|
<%= comment.score <= -5 ? "negative_5" : "" %>
|
|
<%= comment.score <= -7 ? "negative_7" : "" %>">
|
|
<% if !comment.is_gone? %>
|
|
<div class="voters">
|
|
<% 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 %>
|
|
</div>
|
|
<% end %>
|
|
<div class="details">
|
|
<div class="byline">
|
|
<% if comment.previewing %>
|
|
<a><%= comment.user.username %></a>
|
|
previewed
|
|
just now
|
|
<% else %>
|
|
<a href="/u/<%= comment.user.username %>"
|
|
<% if !comment.user.is_active? %>
|
|
class="inactive_user"
|
|
<% elsif comment.user.is_new? %>
|
|
class="new_user"
|
|
<% end %>
|
|
><%= comment.user.username %></a>
|
|
|
|
<%= comment.has_been_edited?? "edited" : "" %>
|
|
<%= raw(time_ago_in_words_label(comment.has_been_edited? ?
|
|
comment.updated_at : comment.created_at).gsub(/^about /, "")) %> ago
|
|
<%= comment.is_from_email?? "via e-mail" : "" %>
|
|
<% end %>
|
|
|
|
<% if !comment.previewing %>
|
|
|
|
|
<a href="<%= comment.url %>">link</a>
|
|
|
|
<% if comment.is_editable_by_user?(@user) %>
|
|
|
|
|
<a class="comment_editor">edit</a>
|
|
<% end %>
|
|
|
|
<% if comment.is_gone? && comment.is_undeletable_by_user?(@user) %>
|
|
|
|
|
<a class="comment_undeletor">undelete</a>
|
|
<% elsif !comment.is_gone? && comment.is_deletable_by_user?(@user) %>
|
|
|
|
|
<a class="comment_deletor">delete</a>
|
|
<% end %>
|
|
|
|
<% if @user && !comment.story.is_gone? && !comment.is_gone? &&
|
|
!(defined?(show_story) && show_story) %>
|
|
|
|
|
<a class="comment_replier">reply</a>
|
|
<% end %>
|
|
|
|
<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>
|
|
<% end %>
|
|
|
|
<% if defined?(show_story) && show_story %>
|
|
| on:
|
|
<a href="<%= comment.story.comments_url %>"><%= comment.story.title %></a>
|
|
<% end %>
|
|
</div>
|
|
<div class="comment_text">
|
|
<% if comment.is_gone? %>
|
|
<p>
|
|
<span class="na">
|
|
[<%= comment.gone_text %>]
|
|
</span>
|
|
</p>
|
|
<% else %>
|
|
<%= raw comment.markeddown_comment %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="comment_reply"></div>
|
|
</div>
|
|
</li>
|
|
|
|
<% if comment.highlighted %>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$("html").animate({
|
|
scrollTop: $("#comment_<%= comment.short_id %>").offset().top
|
|
});
|
|
});
|
|
</script>
|
|
<% end %>
|