Change post votes to work the same way as comment votes: * Make the upvote arrow blue if you've upvoted the post, or grey if you haven't. Likewise for the downvote arrow. * Make it so you can click the upvote or downvote arrows to undo the vote. * Don't show any notices when you vote on a post. Also fix it so that votes work the same way on the posts page, the comments page, and in the modqueue. Before it wasn't possible to undo votes on the comments page or in the modqueue.
75 lines
2.1 KiB
Plaintext
75 lines
2.1 KiB
Plaintext
<%= tag.div id: "post-#{post.id}", **PostPreviewComponent.new(post: post).article_attrs("post mod-queue-preview column-container") do %>
|
|
<aside class="column column-shrink">
|
|
<%= post_preview(post, size: true, show_deleted: true) %>
|
|
</aside>
|
|
|
|
<section class="column column-expand">
|
|
<div class="row quick-mod-row">
|
|
<%= render "modqueue/quick_mod", post: post %>
|
|
<%= render "post_disapprovals/compact_counts", disapprovals: post.disapprovals, post: post %>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<span class="info">
|
|
<strong>Date</strong>
|
|
<%= compact_time(post.created_at) %>
|
|
</span>
|
|
|
|
<span class="info">
|
|
<strong>User</strong>
|
|
<%= link_to_user(post.uploader) %>
|
|
<%= link_to "»", modqueue_index_path(search: { tags: "user:#{post.uploader.name}" }) %>
|
|
</span>
|
|
|
|
<span class="info">
|
|
<strong>Rating</strong>
|
|
<%= post.pretty_rating %>
|
|
</span>
|
|
|
|
<span class="info">
|
|
<strong>Score</strong>
|
|
<%= render_post_votes post, current_user: CurrentUser.user %>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<span class="info">
|
|
<strong>Source</strong>
|
|
<%= post_source_tag(post.source, post.normalized_source) %>
|
|
</span>
|
|
</div>
|
|
|
|
<% if post.has_active_pools? %>
|
|
<div class="row">
|
|
<span class="info">
|
|
<strong>Pools</strong>
|
|
<%= render "pools/inline_list", pools: post.pools.undeleted %>
|
|
</span>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="row list-of-tags">
|
|
<span class="info">
|
|
<strong>Tags</strong>
|
|
<%= post.presenter.inline_tag_list_html %>
|
|
</span>
|
|
</div>
|
|
|
|
<div class="row post-flags-row">
|
|
<% if post.is_flagged? %>
|
|
<span class="info">
|
|
<strong>Flagged</strong>
|
|
<%= render "post_flags/reasons", flag: post.flags.select(&:pending?).last %>
|
|
</span>
|
|
<% end %>
|
|
|
|
<% if post.is_appealed? %>
|
|
<span class="info">
|
|
<strong>Appeals</strong>
|
|
<%= render "post_appeals/reasons", appeal: post.appeals.select(&:pending?).last %>
|
|
</span>
|
|
<% end %>
|
|
</div>
|
|
</section>
|
|
<% end %>
|