mods: remove ability to manually perform mass edits.
Remove the ability for mods to manually perform mass edits without going through the forum.
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
module Moderator
|
|
||||||
class TagsController < ApplicationController
|
|
||||||
before_action :moderator_only
|
|
||||||
|
|
||||||
def edit
|
|
||||||
end
|
|
||||||
|
|
||||||
def update
|
|
||||||
TagBatchChangeJob.perform_later(params[:tag][:antecedent], params[:tag][:consequent], CurrentUser.user, 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
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<% page_title "Mass Edit" %>
|
|
||||||
|
|
||||||
<div id="c-moderator-tags">
|
|
||||||
<div id="a-edit">
|
|
||||||
<h1>Mass Edit</h1>
|
|
||||||
|
|
||||||
<%= edit_form_for(:tag, url: moderator_tag_path, method: :put) do |f| %>
|
|
||||||
<%= f.input :antecedent, input_html: { value: params[:antecedent], "data-autocomplete": "tag-query" } %>
|
|
||||||
<%= f.input :consequent, input_html: { value: params[:consequent], "data-autocomplete": "tag-edit" } %>
|
|
||||||
<%= f.submit "Submit" %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -16,9 +16,6 @@
|
|||||||
<% if CurrentUser.can_approve_posts? %>
|
<% if CurrentUser.can_approve_posts? %>
|
||||||
<li><%= link_to("Moderate", moderator_post_queue_path) %></li>
|
<li><%= link_to("Moderate", moderator_post_queue_path) %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if CurrentUser.is_moderator? %>
|
|
||||||
<li><%= link_to("Mass Edit", edit_moderator_tag_path) %></li>
|
|
||||||
<% end %>
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><h1>Post Events</h1></li>
|
<li><h1>Post Events</h1></li>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ Rails.application.routes.draw do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :invitations, :only => [:new, :create, :index]
|
resources :invitations, :only => [:new, :create, :index]
|
||||||
resource :tag, :only => [:edit, :update]
|
|
||||||
namespace :post do
|
namespace :post do
|
||||||
resource :queue, :only => [:show] do
|
resource :queue, :only => [:show] do
|
||||||
member do
|
member do
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user