2012-06-30 18:18:36 +02:00
|
|
|
<li id="story_<%= story.short_id %>" data-shortid="<%= story.short_id %>"
|
2014-03-04 00:14:33 +01:00
|
|
|
class="story <%= story.vote == 1 ? "upvoted" : "" %> <%= story.vote == -1 ?
|
|
|
|
"downvoted" : "" %> <%= story.vote == 0 ? "hidden" : "" %> <%= story.is_expired? ?
|
|
|
|
"expired" : "" %>">
|
2014-02-08 21:28:27 +01:00
|
|
|
<div class="story_liner">
|
2012-12-09 05:38:36 +01:00
|
|
|
<div class="voters">
|
2012-06-17 03:15:46 +02:00
|
|
|
<% if @user %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<a class="upvoter"></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% else %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<%= link_to "", login_path, :class => "upvoter" %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
2014-03-04 00:14:33 +01:00
|
|
|
<div class="score"><%= story.score %></div>
|
2012-12-09 05:38:36 +01:00
|
|
|
</div>
|
|
|
|
<div class="details">
|
|
|
|
<span class="link">
|
2012-07-05 02:33:12 +02:00
|
|
|
<% if story.can_be_seen_by_user?(@user) %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= story.url_or_comments_path %>"><%= story.title %></a>
|
2012-07-05 02:33:12 +02:00
|
|
|
<% end %>
|
|
|
|
<% if story.is_gone? %>
|
2012-09-02 16:50:07 +02:00
|
|
|
[Story removed by <%= story.is_moderated? ? "moderator" :
|
|
|
|
"original submitter" %>]
|
2012-07-05 02:33:12 +02:00
|
|
|
<% end %>
|
2012-12-09 05:38:36 +01:00
|
|
|
</span>
|
2012-07-05 02:33:12 +02:00
|
|
|
<% if story.can_be_seen_by_user?(@user) %>
|
|
|
|
<span class="tags">
|
2015-01-05 19:06:24 +01:00
|
|
|
<% story.sorted_taggings.each do |tagging| %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= tag_path(tagging.tag.tag) %>"
|
2013-08-05 08:02:48 +02:00
|
|
|
class="<%= tagging.tag.css_class %>"
|
|
|
|
title="<%= tagging.tag.description %>"><%= tagging.tag.tag %></a>
|
2012-07-05 02:33:12 +02:00
|
|
|
<% end %>
|
|
|
|
</span>
|
2013-03-17 21:39:48 +01:00
|
|
|
<span class="domain"><%= story.domain %></span>
|
2014-04-09 00:51:12 +02:00
|
|
|
|
|
|
|
<% if defined?(single_story) && single_story %>
|
|
|
|
<% story.merged_stories.each do |ms| %>
|
|
|
|
<br>
|
|
|
|
<span class="merge"></span>
|
|
|
|
<span class="link">
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= ms.url_or_comments_path %>"><%= ms.title %></a>
|
2014-04-09 00:51:12 +02:00
|
|
|
</span>
|
|
|
|
<span class="tags">
|
2015-01-05 19:06:24 +01:00
|
|
|
<% ms.sorted_taggings.each do |tagging| %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= tag_path(tagging.tag.tag) %>"
|
2014-04-09 00:51:12 +02:00
|
|
|
class="<%= tagging.tag.css_class %>"
|
|
|
|
title="<%= tagging.tag.description %>"><%= tagging.tag.tag %></a>
|
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
<span class="domain"><%= ms.domain %></span>
|
2015-01-02 01:54:26 +01:00
|
|
|
<span class="byline">
|
|
|
|
by <a href="/u/<%= ms.user.username %>"
|
|
|
|
<% if ms.user.is_new? %>
|
|
|
|
class="new_user"
|
|
|
|
<% end %>><%= ms.user.username %></a>
|
|
|
|
|
2015-01-06 21:08:15 +01:00
|
|
|
<%= time_ago_in_words_label(ms.created_at, :strip_about => true) %>
|
|
|
|
ago
|
2015-01-02 01:54:26 +01:00
|
|
|
</span>
|
2014-04-09 00:51:12 +02:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2012-07-05 02:33:12 +02:00
|
|
|
<% end %>
|
2012-12-09 05:38:36 +01:00
|
|
|
<div class="byline">
|
2012-07-12 01:28:27 +02:00
|
|
|
<% if story.previewing %>
|
|
|
|
by <a><%= story.user.username %></a>
|
|
|
|
just now
|
|
|
|
<% else %>
|
2014-11-07 20:42:33 +01:00
|
|
|
by <a href="/u/<%= story.user.username %>"
|
|
|
|
<% if story.user.is_new? %>
|
|
|
|
class="new_user"
|
|
|
|
<% end %>><%= story.user.username %></a>
|
|
|
|
|
2015-01-06 21:08:15 +01:00
|
|
|
<%= time_ago_in_words_label(story.created_at, :strip_about => true) %>
|
|
|
|
ago
|
2012-06-17 03:15:46 +02:00
|
|
|
|
2012-07-12 01:28:27 +02:00
|
|
|
<% if story.is_editable_by_user?(@user) %>
|
2012-07-05 02:33:12 +02:00
|
|
|
|
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= edit_story_path(story.short_id) %>">edit</a>
|
2012-07-12 01:28:27 +02:00
|
|
|
|
|
|
|
<% if story.is_gone? && story.is_undeletable_by_user?(@user) %>
|
|
|
|
|
|
2015-01-03 00:02:55 +01:00
|
|
|
<%= link_to "undelete", story_undelete_path(story.short_id),
|
2012-07-12 01:28:27 +02:00
|
|
|
:method => :post, :data => {
|
|
|
|
:confirm => "Are you sure you want to undelete this story?" } %>
|
|
|
|
<% elsif !story.is_gone? %>
|
|
|
|
|
|
2013-01-08 00:20:41 +01:00
|
|
|
<% if story.user_id != @user.try(:id) &&
|
|
|
|
@user.try(:is_moderator?) %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<%= link_to "delete", story_path(story.short_id),
|
2013-01-08 00:20:41 +01:00
|
|
|
:method => :delete, :class => "mod_story_link" %>
|
|
|
|
<% else %>
|
2015-01-03 00:02:55 +01:00
|
|
|
<%= link_to "delete", story_path(story.short_id),
|
2013-01-08 00:20:41 +01:00
|
|
|
:method => :delete, :data => {
|
|
|
|
:confirm => "Are you sure you want to delete this story?" } %>
|
|
|
|
<% end %>
|
2012-07-12 01:28:27 +02:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2014-03-04 00:14:33 +01:00
|
|
|
<% if !story.is_gone? && @user %>
|
2014-07-02 17:04:48 +02:00
|
|
|
<% if @user && @user.can_downvote?(story) %>
|
|
|
|
| <a class="flagger">flag</a>
|
|
|
|
<% end %>
|
2014-03-04 00:14:33 +01:00
|
|
|
<% if story.vote == 0 %>
|
2015-01-03 00:02:55 +01:00
|
|
|
| <%= link_to "unhide", story_unhide_path(story.short_id),
|
2014-03-04 00:14:33 +01:00
|
|
|
:class => "hider" %>
|
|
|
|
<% else %>
|
2015-01-03 00:02:55 +01:00
|
|
|
| <%= link_to "hide", story_hide_path(story.short_id),
|
2014-03-04 00:14:33 +01:00
|
|
|
:class => "hider" %>
|
|
|
|
<% end %>
|
2014-03-13 16:51:12 +01:00
|
|
|
<% if defined?(single_story) && single_story && story.hider_count > 0 %>
|
|
|
|
(hidden by <%= pluralize(story.hider_count, "user") %>)
|
|
|
|
<% end %>
|
2014-03-04 00:14:33 +01:00
|
|
|
<% end %>
|
2014-01-09 05:00:22 +01:00
|
|
|
<% if !story.is_gone? && (@user || story.comments_count > 0) %>
|
2014-02-08 21:28:27 +01:00
|
|
|
<span class="comments_label">
|
|
|
|
|
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= story.comments_path %>"><%= story.comments_count == 0 ?
|
2014-02-08 21:28:27 +01:00
|
|
|
"discuss" : "#{story.comments_count} comment" <<
|
|
|
|
(story.comments_count == 1 ? "" : "s") %></a>
|
|
|
|
</span>
|
2012-06-30 18:18:36 +02:00
|
|
|
<% end %>
|
2014-03-18 06:06:43 +01:00
|
|
|
|
|
|
|
<% if defined?(single_story) && single_story %>
|
|
|
|
<% if story.downvotes > 0 %>
|
|
|
|
| <%= story.vote_summary_for(@user).downcase %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<% end %>
|
2012-12-09 05:38:36 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2014-02-08 21:28:27 +01:00
|
|
|
</div>
|
|
|
|
<div class="mobile_comments <%= story.comments_count == 0 ? "zero" : "" %>"
|
|
|
|
style="display: none;">
|
2015-01-03 00:02:55 +01:00
|
|
|
<a href="<%= story.comments_path %>"><%= story.comments_count %></a>
|
2014-02-08 21:28:27 +01:00
|
|
|
</div>
|
2012-06-17 03:15:46 +02:00
|
|
|
</li>
|