Merge pull request #3701 from evazion/fix-3579

Fix #3579: Add post approval index
This commit is contained in:
Albert Yi
2018-05-07 17:36:41 -07:00
committed by GitHub
11 changed files with 147 additions and 31 deletions

View File

@@ -0,0 +1,42 @@
<div id="c-post-approvals">
<div id="a-index">
<h1>Approvals</h1>
<%= render "posts/partials/common/inline_blacklist" %>
<%= simple_form_for(:search, url: post_approvals_path, method: :get, defaults: { required: false }, html: { class: "inline-form" }) do |f| %>
<%= f.input :user_name, label: "Approver", input_html: { value: params[:search][:user_name] } %>
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
<%= f.submit "Search" %>
<% end %>
<table width="100%" class="striped">
<thead>
<tr>
<th width="1%">Post</th>
<th width="15%">Approver</th>
</tr>
</thead>
<tbody>
<% @post_approvals.each do |post_approval| %>
<tr>
<td>
<%= PostPresenter.preview(post_approval.post, :tags => "status:any") %>
</td>
<td>
<%= link_to_user post_approval.user %>
<%= link_to "»", post_approvals_path(search: params[:search].merge(user_name: post_approval.user.name)) %>
<br><%= time_ago_in_words_tagged post_approval.created_at %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= numbered_paginator(@post_approvals) %>
</div>
</div>
<% content_for(:page_title) do %>
Approvals - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -1,15 +1,14 @@
<div id="c-post-events">
<div id="a-index">
<h1>Flags &amp; Appeals</h1>
<h1>Post Events</h1>
<table width="100%" class="striped">
<table width="100%" class="striped autofit">
<thead>
<tr>
<th width="5%">Type</th>
<th width="10%">Creator</th>
<th>Reason</th>
<th width="5%">Resolved?</th>
<th width="15%">Date</th>
<th>Type</th>
<th>User</th>
<th>Description</th>
<th>Resolved?</th>
</tr>
</thead>
<tbody>
@@ -22,16 +21,10 @@
<% else %>
<i>hidden</i>
<% end %>
<br><%= time_ago_in_words_tagged event.created_at %>
</td>
<td><%= format_text event.reason %></td>
<td>
<% if event.is_resolved %>
yes
<% else %>
no
<% end %>
</td>
<td><%= compact_time event.created_at %></td>
<td class="col-expand"><%= format_text event.reason %></td>
<td><%= event.is_resolved %></td>
</tr>
<% end %>
</tbody>

View File

@@ -6,12 +6,8 @@
<li><h1>Posts</h1></li>
<li><%= link_to("Help", wiki_pages_path(:title => "help:posts")) %></li>
<li><%= link_to("Listing", posts_path) %></li>
<li><%= link_to("Changes", post_versions_path) %></li>
<li><%= link_to("Upload", new_upload_path) %></li>
<li><%= link_to("Upload Listing", uploads_path) %></li>
<li><%= link_to("Appeals", post_appeals_path) %></li>
<li><%= link_to("Flags", post_flags_path) %></li>
<li><%= link_to("Replacements", post_replacements_path) %></li>
<li><%= link_to("Popular", popular_explore_posts_path) %></li>
<li><%= link_to("Most Viewed", viewed_explore_posts_path) %></li>
<% if CurrentUser.can_approve_posts? %>
@@ -21,6 +17,14 @@
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
<% end %>
</ul>
<ul>
<li><h1>Post Events</h1></li>
<li><%= link_to("Changes", post_versions_path) %></li>
<li><%= link_to("Approvals", post_approvals_path) %></li>
<li><%= link_to("Appeals", post_appeals_path) %></li>
<li><%= link_to("Flags", post_flags_path) %></li>
<li><%= link_to("Replacements", post_replacements_path) %></li>
</ul>
<ul>
<li><h1>Tools</h1></li>
<li><%= link_to("Source Code", Danbooru.config.source_code_url) %></li>