1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers/broken_image_reports_controller.rb

29 lines
878 B
Ruby
Raw Normal View History

2011-08-07 15:23:44 -07:00
class BrokenImageReportsController < ApplicationController
def new
ids = params[:asset_ids]
assets = SwfAsset.arel_table
@swf_assets = SwfAsset.where(:has_image => true).where((
assets[:remote_id].in(ids[:biology]).and(assets[:type].eq('biology'))
2011-08-07 15:23:44 -07:00
).or(
assets[:remote_id].in(ids[:object]).and(assets[:type].eq('object'))
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.report_broken
flash[:success] = "Thanks! This image will be reconverted soon. If it " +
"looks the same after conversion, please consider sending a bug report."
else
flash[:alert] = "This image is already in line for reconversion. We'll " +
"get to it soon, don't worry."
end
redirect_to :back
end
end