polish for browsing, add hit counter

This commit is contained in:
Kyle Drake 2013-06-20 19:52:14 -07:00
parent e2d19d35ae
commit d535bee286
5 changed files with 18 additions and 6 deletions

6
app.rb
View file

@ -35,7 +35,7 @@ get '/?' do
end
get '/browse' do
@sites = Site.order(:id.desc).filter(initial_index_changed: true).all
@sites = Site.order(:id.desc).filter(~{updated_at: nil}).all
slim :browse
end
@ -150,7 +150,7 @@ post '/site_files/upload' do
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
current_site.update initial_index_changed: true if current_site.initial_index_changed == false
current_site.update updated_at: Time.now
flash[:success] = "Successfully uploaded file #{sanitized_filename}."
redirect '/dashboard'
@ -212,7 +212,7 @@ post '/site_files/save/:filename' do |filename|
Backburner.enqueue(ScreenshotJob, current_site.username) if sanitized_filename =~ /index\.html/
current_site.update initial_index_changed: true if current_site.initial_index_changed == false
current_site.update updated_at: Time.now
'ok'
end