bulk update requests: allow admins to edit forum topic/post ids (#3554).
This commit is contained in:
@@ -60,6 +60,7 @@ class BulkUpdateRequestsController < ApplicationController
|
|||||||
def bur_params(context)
|
def bur_params(context)
|
||||||
permitted_params = %i[script skip_secondary_validations]
|
permitted_params = %i[script skip_secondary_validations]
|
||||||
permitted_params += %i[title reason forum_topic_id] if context == :create
|
permitted_params += %i[title reason forum_topic_id] if context == :create
|
||||||
|
permitted_params += %i[forum_topic_id forum_post_id] if context == :update && CurrentUser.is_admin?
|
||||||
|
|
||||||
params.require(:bulk_update_request).permit(permitted_params)
|
params.require(:bulk_update_request).permit(permitted_params)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -37,7 +37,11 @@ category tag_name -> category_name
|
|||||||
|
|
||||||
<% if @bulk_update_request.new_record? %>
|
<% if @bulk_update_request.new_record? %>
|
||||||
<%= f.input :forum_topic_id, :hint => " (optional)" %>
|
<%= f.input :forum_topic_id, :hint => " (optional)" %>
|
||||||
|
<% elsif @bulk_update_request.persisted? && CurrentUser.is_admin? %>
|
||||||
|
<%= f.input :forum_topic_id %>
|
||||||
|
<%= f.input :forum_post_id %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= f.button :submit, :value => "Submit", :data => { :disable_with => "Submitting..." } %>
|
<%= f.button :submit, :value => "Submit", :data => { :disable_with => "Submitting..." } %>
|
||||||
<%= dtext_preview_button "bulk_update_request", "reason" %>
|
<%= dtext_preview_button "bulk_update_request", "reason" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user