mod actions: add options to filter /mod_actions by subject.

This commit is contained in:
evazion
2022-09-25 22:48:23 -05:00
parent 3dc765ca9d
commit 17c6a2d77b
8 changed files with 61 additions and 12 deletions

View File

@@ -21,6 +21,14 @@ class IpBansController < ApplicationController
respond_with(@ip_bans)
end
def show
@ip_ban = authorize IpBan.find(params[:id])
respond_with(@ip_ban) do |format|
format.html { redirect_to ip_bans_path(search: { id: @ip_ban.id }) }
end
end
def update
@ip_ban = authorize IpBan.find(params[:id])
@ip_ban.update(permitted_attributes(@ip_ban))

View File

@@ -5,7 +5,11 @@ class ModActionsController < ApplicationController
def index
@mod_actions = ModAction.visible(CurrentUser.user).paginated_search(params)
@mod_actions = @mod_actions.includes(:creator) if request.format.html?
if request.format.html?
@mod_actions = @mod_actions.includes(:creator, :subject)
@dtext_data = DText.preprocess(@mod_actions.map(&:description))
end
respond_with(@mod_actions)
end