2016-04-02 18:10:28 +05:30
|
|
|
class Admin::SpamLogsController < Admin::ApplicationController
|
|
|
|
def index
|
|
|
|
@spam_logs = SpamLog.order(id: :desc).page(params[:page])
|
|
|
|
end
|
|
|
|
|
|
|
|
def destroy
|
|
|
|
spam_log = SpamLog.find(params[:id])
|
|
|
|
|
|
|
|
if params[:remove_user]
|
|
|
|
spam_log.remove_user
|
|
|
|
redirect_to admin_spam_logs_path, notice: "User #{spam_log.user.username} was successfully removed."
|
|
|
|
else
|
|
|
|
spam_log.destroy
|
2016-06-02 11:05:42 +05:30
|
|
|
head :ok
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|
|
|
|
end
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
def mark_as_ham
|
|
|
|
spam_log = SpamLog.find(params[:id])
|
|
|
|
|
|
|
|
if HamService.new(spam_log).mark_as_ham!
|
|
|
|
redirect_to admin_spam_logs_path, notice: 'Spam log successfully submitted as ham.'
|
|
|
|
else
|
|
|
|
redirect_to admin_spam_logs_path, alert: 'Error with Akismet. Please check the logs for more info.'
|
|
|
|
end
|
|
|
|
end
|
2016-04-02 18:10:28 +05:30
|
|
|
end
|