[Cleanup] Remove tag "Mass Update"

Make a BUR instead.
This commit is contained in:
Earlopain 2022-12-27 22:02:42 +01:00
parent 76f54e32b9
commit af13018639
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
5 changed files with 0 additions and 75 deletions

View File

@ -1,17 +0,0 @@
module Moderator
class TagsController < ApplicationController
before_action :moderator_only
def edit
end
def update
TagBatchJob.perform_later(params[:tag][:antecedent], params[:tag][:consequent], CurrentUser.user.id, CurrentUser.ip_addr)
redirect_to edit_moderator_tag_path, :notice => "Post changes queued"
end
def error
redirect_to edit_moderator_tag_path, :notice => "Error"
end
end
end

View File

@ -1,25 +0,0 @@
<div id="c-moderator-tags">
<div id="a-edit">
<h1>Mass Edit</h1>
<%= form_tag(moderator_tag_path, :method => :put, :class => "simple_form") do %>
<div class="input">
<label>Antecedent</label>
<%= text_field :tag, :antecedent, :value => params[:antecedent], :data => { :autocomplete => "tag-query" } %>
</div>
<div class="input">
<label>Consequent</label>
<%= text_field :tag, :consequent, :value => params[:consequent], :data => { :autocomplete => "tag-edit" } %>
</div>
<div class="input">
<%= submit_tag "Submit" %>
</div>
<% end %>
</div>
</div>
<% content_for(:page_title) do %>
Mass Edit
<% end %>

View File

@ -9,9 +9,6 @@
<li><%= link_to("Upload Listing", uploads_path) %></li>
<% end %>
<li><%= link_to("Popular", popular_index_path) %></li>
<% if CurrentUser.is_moderator? %>
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
<% end %>
<li><%= link_to("Similar Images Search", iqdb_queries_path) %></li>
<% if CurrentUser.can_approve_posts? %>
<li><%= link_to("Disapprovals", moderator_post_disapprovals_path) %></li>

View File

@ -35,7 +35,6 @@ Rails.application.routes.draw do
get :export
end
end
resource :tag, :only => [:edit, :update]
namespace :post do
resource :approval, :only => [:create, :destroy]
resources :disapprovals, :only => [:create, :index]

View File

@ -1,29 +0,0 @@
require 'test_helper'
module Moderator
class TagsControllerTest < ActionDispatch::IntegrationTest
context "The tags controller" do
setup do
@user = create(:moderator_user)
as(@user) do
@post = create(:post)
end
end
should "render the edit action" do
get_auth edit_moderator_tag_path, @user
assert_response :success
end
should "execute the update action" do
put_auth moderator_tag_path, @user, params: {:tag => {:predicate => "aaa", :consequent => "bbb"}}
assert_redirected_to edit_moderator_tag_path
end
should "fail gracefully if the update action fails" do
put_auth moderator_tag_path, @user, params: {:tag => {:predicate => "", :consequent => "bbb"}}
assert_redirected_to edit_moderator_tag_path
end
end
end
end