2012-06-30 18:18:36 +02:00
|
|
|
<li id="story_<%= story.short_id %>" data-shortid="<%= story.short_id %>"
|
|
|
|
class="story <%= story.vote == 1 ? "upvoted" : (story.vote == -1 ?
|
|
|
|
"downvoted" : "") %> <%= story.is_expired? ? "expired" : "" %>">
|
2012-06-17 03:15:46 +02:00
|
|
|
<div class="voters">
|
|
|
|
<% if @user %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<a class="upvoter"></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% else %>
|
|
|
|
<%= link_to "", login_url, :class => "upvoter" %>
|
|
|
|
<% end %>
|
|
|
|
<div class="score">
|
2012-06-30 18:18:36 +02:00
|
|
|
<%= story.upvotes - story.downvotes %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
<% if @user %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<a class="downvoter"></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% else %>
|
|
|
|
<%= link_to "", login_url, :class => "downvoter" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<div class="details">
|
|
|
|
<span class="link">
|
2012-06-30 18:18:36 +02:00
|
|
|
<a href="<%= story.url_or_comments_url %>"><%= story.title %></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
</span>
|
|
|
|
<span class="tags">
|
|
|
|
<% story.taggings.each do |tagging| %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<a href="<%= tag_url(tagging.tag.tag) %>" class="tag tag_<%=
|
|
|
|
tagging.tag.tag %>"><%= tagging.tag.tag %></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
<span class="domain">
|
|
|
|
<%= story.domain %>
|
|
|
|
</span>
|
|
|
|
<div class="byline">
|
2012-06-30 18:18:36 +02:00
|
|
|
by <a href="/u/<%= story.user.username %>"><%= story.user.username %></a>
|
2012-06-17 03:15:46 +02:00
|
|
|
<%= time_ago_in_words(story.created_at).gsub(/^about /, "") %> ago
|
|
|
|
|
|
|
|
<% if story.is_editable_by_user? @user %>
|
|
|
|
|
|
2012-06-30 18:18:36 +02:00
|
|
|
<a href="<%= edit_story_url(story.short_id) %>">edit</a>
|
2012-06-17 03:15:46 +02:00
|
|
|
|
|
2012-06-30 18:18:36 +02:00
|
|
|
<% if story.is_expired? %>
|
|
|
|
<%= link_to "undelete", story_undelete_url(story.short_id),
|
|
|
|
:method => :post,
|
|
|
|
:confirm => "Are you sure you want to undelete this story?" %>
|
|
|
|
<% else %>
|
|
|
|
<%= link_to "delete", story_url(story.short_id), :method => :delete,
|
|
|
|
:confirm => "Are you sure you want to delete this story?" %>
|
|
|
|
<% end %>
|
2012-06-17 03:15:46 +02:00
|
|
|
<% end %>
|
2012-06-30 18:18:36 +02:00
|
|
|
<% if !story.is_expired? %>
|
|
|
|
|
|
|
|
|
<a href="<%= story.comments_url %>"><%=
|
|
|
|
(c = story.comment_count) == 0 ? "discuss" :
|
|
|
|
"#{c} comment#{c == 1 ? "" : "s"}" %></a>
|
|
|
|
<% end %>
|
2012-06-17 03:15:46 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|