initial stab at screenshots

This commit is contained in:
Kyle Drake 2013-06-19 13:19:04 -07:00
parent 5164914c4e
commit 87c733c932
8 changed files with 65 additions and 8 deletions

5
app.rb
View file

@ -142,6 +142,8 @@ post '/site_files/upload' do
dest_path = File.join(site_base_path(current_site.username), sanitized_filename)
FileUtils.mv params[:newfile][:tempfile].path, dest_path
File.chmod(0640, dest_path) if self.class.production?
Backburner.enqueue ScreenshotJob, current_site.username
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
redirect '/dashboard'
@ -200,6 +202,9 @@ 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
'ok'
end