Newer
Older
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
class ReportController < ApplicationController
before_filter :authenticate_user!
before_filter :redirect_unless_admin, :except => [:create]
use_bootstrap_for :index
if report = Report.where(id: params[:id]).first
report.mark_as_reviewed
if (report = Report.where(id: params[:id]).first) && report.destroy_reported_item
flash[:notice] = I18n.t 'report.status.destroyed'
report = current_user.reports.new(report_params)
if report.save
render :nothing => true, :status => 409
params.require(:report).permit(:item_id, :item_type, :text)