post approvals: add index page + search options (fix #3579).
This commit is contained in:
42
app/views/post_approvals/index.html.erb
Normal file
42
app/views/post_approvals/index.html.erb
Normal 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 %>
|
||||
Reference in New Issue
Block a user