2015-09-23 04:58:29 +02:00
|
|
|
<input id="comment_folder_<%= comment.short_id %>"
|
2016-03-24 19:55:25 +01:00
|
|
|
class="comment_folder_button" type="checkbox"
|
2017-05-23 13:28:25 +02:00
|
|
|
<%= comment.score <= Comment::DOWNVOTABLE_MIN_SCORE ? "checked" : "" %>>
|
|
|
|
<div id="c_<%= comment.short_id %>"
|
2014-12-14 07:24:18 +01:00
|
|
|
data-shortid="<%= comment.short_id if comment.persisted? %>"
|
2012-06-30 18:18:36 +02:00
|
|
|
class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
|
|
|
|
"upvoted" : "downvoted") : "" %>
|
2017-05-11 12:37:38 +02:00
|
|
|
<%= comment.score <= -1 ? "negative_1" : "" %>
|
|
|
|
<%= comment.score <= -3 ? "negative_3" : "" %>
|
|
|
|
<%= comment.score <= -5 ? "negative_5" : "" %>">
|
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 %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<%= link_to "", login_path, :class => "upvoter" %>
|
2014-01-13 06:17:09 +01:00
|
|
|
<% end %>
|
|
|
|
<div class="score"><%= comment.score %></div>
|
2014-02-17 17:13:08 +01:00
|
|
|
<% if @user && @user.can_downvote?(comment) %>
|
2014-01-13 06:17:09 +01:00
|
|
|
<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">
|
2014-12-14 07:24:18 +01:00
|
|
|
<a name="c_<%= comment.short_id %>"></a>
|
|
|
|
|
2015-09-23 04:58:29 +02:00
|
|
|
<label for="comment_folder_<%= comment.short_id %>"
|
|
|
|
class="comment_folder"></label>
|
2015-07-24 07:30:53 +02:00
|
|
|
|
2015-11-18 18:35:34 +01:00
|
|
|
<% if defined?(was_merged) && was_merged %>
|
|
|
|
<span class="merge"></span>
|
|
|
|
<% end %>
|
|
|
|
|
2016-01-21 18:58:26 +01:00
|
|
|
<% if (@user && @user.show_avatars?) || !@user %>
|
2017-05-19 14:06:09 +02:00
|
|
|
<a href="/u/<%= comment.user.username %>"><%=
|
|
|
|
avatar_img(comment.user, 16) %></a>
|
2015-07-31 17:51:33 +02:00
|
|
|
<% end %>
|
|
|
|
|
2014-11-14 21:09:28 +01:00
|
|
|
<a href="/u/<%= comment.user.username %>"
|
2015-10-16 20:08:05 +02:00
|
|
|
class="<%= comment.html_class_for_user %>"><%=
|
|
|
|
comment.user.username %></a>
|
2014-11-14 21:09:28 +01:00
|
|
|
|
|
|
|
<% if comment.hat %>
|
|
|
|
<%= comment.hat.to_html_label %>
|
|
|
|
<% end %>
|
|
|
|
|
2012-06-30 18:18:36 +02:00
|
|
|
<% if comment.previewing %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<%= t('.previewed') %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<% else %>
|
2014-02-03 21:37:31 +01:00
|
|
|
<% if comment.has_been_edited? %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<%= t('.edited') %>
|
2014-02-03 21:37:31 +01:00
|
|
|
<% elsif comment.is_from_email? %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<%= t('.emailed') %>
|
2014-02-03 21:37:31 +01:00
|
|
|
<% end %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<%= distance_of_time_in_words((comment.has_been_edited? ?
|
|
|
|
comment.updated_at : comment.created_at), Time.now, :strip_about => true) %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
|
|
|
|
2012-06-30 21:14:35 +02:00
|
|
|
<% if !comment.previewing %>
|
|
|
|
|
|
2017-05-23 13:28:25 +02:00
|
|
|
<a href="<%= comment.url %>"><%= t('.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) %>
|
|
|
|
|
|
2016-11-09 17:25:40 +01:00
|
|
|
<a class="comment_editor"><%= t('.edit') %></a>
|
2012-07-12 20:30:20 +02:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<% if comment.is_gone? && comment.is_undeletable_by_user?(@user) %>
|
2012-07-05 02:33:12 +02:00
|
|
|
|
|
2016-11-09 17:25:40 +01:00
|
|
|
<a class="comment_undeletor"><%= t('.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
|
|
|
|
|
2016-02-10 15:57:38 +01:00
|
|
|
<% if @user && @user.is_moderator? && @user.id != comment.user_id %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<a class="comment_moderator"><%= t('.delete') %></a>
|
2016-02-10 15:57:38 +01:00
|
|
|
<% else %>
|
2016-11-09 17:25:40 +01:00
|
|
|
<a class="comment_deletor"><%= t('.delete') %></a>
|
2016-02-10 15:57:38 +01:00
|
|
|
<% end %>
|
2012-07-12 20:30:20 +02:00
|
|
|
<% end %>
|
|
|
|
|
2017-05-17 10:23:25 +02:00
|
|
|
<% if !comment.parent_comment_id && @user && @user.is_moderator? %>
|
|
|
|
|
|
|
|
|
<% if comment.is_dragon? %>
|
|
|
|
<a class="comment_undragon"><%= t('.undragon') %></a>
|
|
|
|
<% else %>
|
|
|
|
<a class="comment_dragon"><%= t('.dragon') %></a>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
2014-01-21 03:04:54 +01:00
|
|
|
<% if @user && !comment.story.is_gone? && !comment.is_gone? %>
|
2012-07-12 20:30:20 +02:00
|
|
|
|
|
2016-11-09 17:25:40 +01:00
|
|
|
<a class="comment_replier" unselectable="on"><%= t('.reply') %></a>
|
2012-06-30 21:14:35 +02:00
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
|
2016-06-22 22:29:55 +02:00
|
|
|
<% if defined?(show_story) && show_story %>
|
2016-11-10 15:06:23 +01:00
|
|
|
| <%= t('.about') %>
|
2016-06-22 22:29:55 +02:00
|
|
|
<a href="<%= comment.story.comments_path %>"><%= comment.story.title
|
|
|
|
%></a>
|
|
|
|
<% end %>
|
|
|
|
|
2012-12-09 05:37:30 +01:00
|
|
|
<span class="reason">
|
2015-02-07 19:23:51 +01:00
|
|
|
<% if comment.downvotes > 0 &&
|
|
|
|
((comment.score <= 0 && comment.user_id == @user.try(:id)) ||
|
|
|
|
@user.try("is_moderator?")) %>
|
2016-02-10 15:38:28 +01:00
|
|
|
| <%= comment.vote_summary_for_user(@user).downcase %>
|
2012-12-09 05:37:30 +01:00
|
|
|
<% elsif comment.current_vote && comment.current_vote[:vote] == -1 %>
|
2015-02-07 19:23:51 +01:00
|
|
|
| -1
|
|
|
|
<%= Vote::COMMENT_REASONS[comment.current_vote[:reason]].downcase %>
|
2012-12-09 05:37:30 +01:00
|
|
|
<% end %>
|
|
|
|
</span>
|
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>
|
2014-01-16 04:25:20 +01:00
|
|
|
</div>
|