Files
danbooru/app/views/comments/partials/index/_header.html.haml
2010-10-27 13:40:50 -04:00

43 lines
1.8 KiB
Plaintext

%div{:class => "header"}
%div{:class => "row"}
%span{:class => "info"}
%time Date
= compact_time(post.created_at)
%span{:class => "info"}
%strong User
= link_to(post.uploader_name, user_path(post.uploader_id))
%span{:class => "info"}
%strong Rating
= post.rating
%span{:class => "info"}
%strong Score
%span{:id => "score-for-post-#{post.id}"}
= post.score
<div class="header">
<div>
<span class="info"><strong>Date</strong> <%= compact_time(post.created_at) %></span>
<span class="info"><strong>User</strong> <%= fast_link_to h(post.author), :controller => "user", :action => "show", :id => post.user_id %></span>
<span class="info"><strong>Rating</strong> <%= post.pretty_rating %></span>
<span class="info">
<strong>Score</strong> <span id="post-score-<%= post.id %>"><%= post.score %></span>
<% if @current_user.is_privileged_or_higher? %>
(vote <%= link_to_function "up", "Post.vote(1, #{post.id})" %>/<%= link_to_function "down", "Post.vote(-1, #{post.id})" %>)
<% end %>
</span>
</div>
<div class="tags">
<strong>Tags</strong>
<% post.cached_tags.split(/ /).each do |name| %>
<span class="tag-type-<%= Tag.type_name(name) %>">
<%= fast_link_to h(name.tr("_", " ")), :controller => "post", :action => "index", :tags => name %>
</span>
<% end %>
</div>
<div style="margin-top: 1em;">
<% if post.comments.count > 6 %>
<span class="info" id="hidden-comments-notice-for-<%= post.id %>"><%= link_to_remote "#{pluralize post.comments.size - 6, 'comment'} hidden", :url => {:controller => "comment", :action => "index_hidden", :post_id => post.id} %>.</span>
<% end %>
<%= render :partial => "threshold_notice", :locals => {:post => post} %>