Files
danbooru/app/views/comment_votes/index.html.erb
2021-01-22 04:26:55 -06:00

39 lines
1.5 KiB
Plaintext

<%= render "comments/secondary_links" %>
<div id="c-comment-votes">
<div id="a-index">
<%= render "search" %>
<%= table_for @comment_votes, class: "striped autofit" do |t| %>
<% t.column "Post" do |vote| %>
<%= post_preview(vote.comment.post, show_deleted: true) %>
<% end %>
<% t.column "Comment", td: {class: "col-expand"} do |vote| %>
<div class="prose">
<%= format_text(vote.comment.body) %>
</div>
<% end %>
<% t.column "Score" do |vote| %>
<%= link_to sprintf("%+d", vote.score), comment_votes_path(search: { score: vote.score }) %>
<% end %>
<% t.column "Commenter" do |vote| %>
<%= link_to_user vote.comment.creator %>
<%= link_to "»", comment_votes_path(search: { comment: { creator_name: vote.comment.creator.name }}) %>
<div><%= time_ago_in_words_tagged(vote.comment.created_at) %></div>
<% end %>
<% t.column "Voter" do |vote| %>
<%= link_to_user vote.user %>
<%= link_to "»", comment_votes_path(search: { user_name: vote.user.name }) %>
<div><%= time_ago_in_words_tagged(vote.created_at) %></div>
<% end %>
<% t.column column: "control" do |vote| %>
<% if vote.user == CurrentUser.user %>
<%= link_to "unvote", comment_comment_votes_path(vote.comment), remote: true, method: :delete %>
<% end %>
<% end %>
<% end %>
<%= numbered_paginator(@comment_votes) %>
</div>
</div>