only take screenshot for index change

This commit is contained in:
Kyle Drake 2013-06-19 13:49:06 -07:00
parent 87c733c932
commit f54332e5f4

4
app.rb
View file

@ -143,7 +143,7 @@ post '/site_files/upload' do
FileUtils.mv params[:newfile][:tempfile].path, dest_path
File.chmod(0640, dest_path) if self.class.production?
Backburner.enqueue ScreenshotJob, current_site.username
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
redirect '/dashboard'
@ -203,7 +203,7 @@ post '/site_files/save/:filename' do |filename|
FileUtils.mv tmpfile.path, dest_path
File.chmod(0640, dest_path) if self.class.production?
Backburner.enqueue ScreenshotJob, current_site.username
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
'ok'
end