add support for post version queries

This commit is contained in:
r888888888
2016-06-21 13:14:27 -07:00
parent 145229c49f
commit 2ce86ecb8b
9 changed files with 87 additions and 1 deletions

View File

@@ -18,7 +18,7 @@
</thead>
<tbody>
<% post_versions.each do |post_version| %>
<tr id="post-version-<%= post_version.id %>">
<tr id="post-version-<%= post_version.id %>" <% if params[:hilite].to_i == post_version.id %>class="hilite"<% end %>>
<td><%= link_to("#{post_version.post_id}.#{post_version.id}", post_path(post_version.post_id)) %></td>
<td><%= compact_time(post_version.updated_at) %></td>
<td>

View File

@@ -0,0 +1,27 @@
<div id="c-reports">
<div id="a-post-versions">
<h1>Post Changes Report</h1>
<p>You can search all post changes to find when and where a tag was added or removed. Because these queries can take a long time to generate the results will be emailed to you. Only the 1,000 most recent changes will be returned.</p>
<%= form_tag(reports_post_versions_create_path, :method => :post, :class => "simple_form") do %>
<div class="input">
<label for="tag">Tag</label>
<%= text_field_tag "tag" %>
<%= select_tag "type", options_for_select(%w(added removed)) %>
</div>
<div class="input">
<label for="Email">Email</label>
<%= text_field_tag "email", CurrentUser.user.email %>
</div>
<%= submit_tag "Submit" %>
<% end %>
</div>
</div>
<% content_for(:page_title) do %>
Post Changes Report - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -64,6 +64,7 @@
<% if Danbooru.config.report_server %>
<li><%= link_to("Top Searches", searches_explore_posts_path) %></li>
<li><%= link_to("Missed Searches", missed_searches_explore_posts_path) %></li>
<li><%= link_to("Post Changes", reports_post_versions_path) %></li>
<% end %>
</ul>
</section>