Allow admins to remove votes on posts. This is for fixing vote abuse. Votes can be removed by going to the vote list on the /post_votes page, or by clicking on a post's score, then using the "Remove" option in the "..." dropdown menu next to the vote. Votes are soft-deleted - they're marked as deleted in the database, but not fully deleted. Removed votes are only visible to admins, not to regular users. When a vote is removed by an admin, it leaves a mod action. Technically it's possible to undelete votes, but there's no UI for it.
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
<%= render "posts/partials/common/secondary_links" %>
|
|
|
|
<div id="c-post-votes">
|
|
<div id="a-index">
|
|
<%= render "search" %>
|
|
|
|
<%= table_for @post_votes, class: "striped autofit" do |t| %>
|
|
<% t.column "Score" do |vote| %>
|
|
<%= link_to sprintf("%+d", vote.score), post_votes_path(search: { score: vote.score }) %>
|
|
|
|
<% if vote.is_deleted? %>
|
|
(deleted)
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% t.column "Voter" do |vote| %>
|
|
<%= link_to_user vote.user %>
|
|
<%= link_to "»", post_votes_path(search: { user_name: vote.user.name }) %>
|
|
<% end %>
|
|
|
|
<% t.column "Created" do |vote| %>
|
|
<%= time_ago_in_words_tagged(vote.created_at) %>
|
|
<% end %>
|
|
|
|
<% t.column column: "control" do |vote| %>
|
|
<% if !vote.is_deleted? && policy(vote).destroy? %>
|
|
<%= render PopupMenuComponent.new do |menu| %>
|
|
<% menu.item do %>
|
|
<%= link_to "Remove", post_vote_path(vote.id, variant: "listing"), method: :delete, remote: true %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= numbered_paginator(@post_votes) %>
|
|
</div>
|
|
</div>
|