reports/uploads: remove upload report page.

This commit is contained in:
evazion
2020-01-13 12:58:20 -06:00
parent 85676ddb74
commit ec8c427ef3
6 changed files with 1 additions and 77 deletions

View File

@@ -1,10 +1,5 @@
class ReportsController < ApplicationController
before_action :member_only, :except => [:upload_tags]
respond_to :html, :xml, :json, only: [:upload_tags]
def uploads
@report = Reports::Uploads.new(params[:min_date], params[:max_date], params[:queries])
end
respond_to :html, :xml, :json
def upload_tags
@user = User.find(params[:user_id])

View File

@@ -1,26 +0,0 @@
module Reports
class Uploads
attr_reader :min_date, :max_date, :queries
def initialize(min_date, max_date, queries)
if min_date.present?
@min_date = min_date
else
@min_date = 30.days.ago.to_date
end
if max_date.present?
@max_date = max_date
else
@max_date = Date.today
end
@queries = queries.to_s.split(/,\s*/).join(",")
end
def generate_sig
verifier = ActiveSupport::MessageVerifier.new(Danbooru.config.reportbooru_key, serializer: JSON, digest: "SHA256")
verifier.generate("#{min_date},#{max_date},#{queries}")
end
end
end

View File

@@ -1,33 +0,0 @@
<div id="c-reports">
<div id="a-uploads">
<h1>Upload Report</h1>
<%= form_tag(reports_uploads_path, :method => :get, :class => "simple_form") do %>
<div class="input">
<label for="queries">Tags</label>
<%= text_field_tag "queries", params[:queries], :placeholder => "Separate with commas" %>
</div>
<div class="input">
<label for="min_date">Start Date</label>
<%= text_field_tag "min_date", params[:min_date], :placeholder => "YYYY-MM-DD" %>
</div>
<div class="input">
<label for="max_date">End Date</label>
<%= text_field_tag "max_date", params[:max_date], :placeholder => "YYYY-MM-DD" %>
</div>
<%= submit_tag "Search" %>
<% end %>
<% if params[:queries] %>
<%= content_tag("iframe", "Loading...", :src => "#{Danbooru.config.reportbooru_server}/reports/uploads?min=#{@report.min_date}&max=#{@report.max_date}&tags=#{u(@report.queries)}&sig=#{@report.generate_sig}", :height => "700", :width => "1200", :style => "border: none;") %>
<% end %>
</div>
</div>
<% content_for(:page_title) do %>
Upload Report - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -73,7 +73,6 @@
</ul>
<ul>
<li><h1>Reports</h1></li>
<li><%= link_to("Uploads", reports_uploads_path) %></li>
<li><%= link_to("Performance Reports", "https://isshiki.donmai.us/user-reports") %></li>
<% if Danbooru.config.reportbooru_server %>
<li><%= link_to("Top Searches", searches_explore_posts_path) %></li>

View File

@@ -17,10 +17,6 @@ get '/reports/user_similarity' do
# todo
end
get '/reports/uploads' do
# todo
end
post '/post_views' do
# todo
end

View File

@@ -10,13 +10,6 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
end
end
context "uploads action" do
should "render" do
get_auth reports_uploads_path, @mod
assert_response :success
end
end
context "upload_tags action" do
should "render" do
get reports_upload_tags_path(user_id: @users.first)