Files
danbooru/app/views/post_approvals/index.html.erb
evazion 1b30b71a07 posts: refactor post previews to use ViewComponent.
Refactor the post preview html to use the ViewComponent framework. This
lets us encapsulate all the HTML, CSS, and helper methods for a UI
component in a single place.

See https://viewcomponent.org.
2021-01-14 21:17:57 -06:00

26 lines
1.1 KiB
Plaintext

<div id="c-post-approvals">
<div id="a-index">
<h1>Approvals</h1>
<%= render "posts/partials/common/inline_blacklist" %>
<%= search_form_for(post_approvals_path) do |f| %>
<%= f.input :user_name, label: "Approver", input_html: { value: params[:search][:user_name], data: { autocomplete: "user" } } %>
<%= f.input :post_tags_match, label: "Tags", input_html: { value: params[:search][:post_tags_match], data: { autocomplete: "tag-query" } } %>
<%= f.submit "Search" %>
<% end %>
<%= table_for @post_approvals, width: "100%" do |t| %>
<% t.column "Post", width: "1%" do |post_approval| %>
<%= post_preview(post_approval.post, show_deleted: true) %>
<% end %>
<% t.column "Approver", width: "15%" do |post_approval| %>
<%= 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 %>
<% end %>
<% end %>
<%= numbered_paginator(@post_approvals) %>
</div>
</div>