impress/app/controllers/broken_image_reports_controller.rb

23 lines
689 B
Ruby
Raw Normal View History

2011-08-07 15:23:44 -07:00
class BrokenImageReportsController < ApplicationController
def new
2015-05-03 14:57:42 -07:00
@swf_assets = SwfAsset.from_wardrobe_link_params(params[:asset_ids]).where(:has_image => true)
2011-08-07 15:23:44 -07:00
end
def create
swf_asset = SwfAsset.where(:type => params[:swf_asset_type]).
find_by_remote_id(params[:swf_asset_remote_id])
2011-08-07 15:23:44 -07:00
if swf_asset.image_manual?
flash[:warning] = t('broken_image_reports.create.manual')
2011-08-07 15:23:44 -07:00
else
# If the asset is already reported as broken, no need to shout about it.
# Just don't enqueue it, thank the user, and move on.
swf_asset.report_broken
flash[:success] = t('broken_image_reports.create.success')
2011-08-07 15:23:44 -07:00
end
redirect_to :back
end
end