diff --git a/Gemfile b/Gemfile
index e74edb1f..08910671 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,6 +13,7 @@ gem 'rack-recaptcha', require: 'rack/recaptcha'
gem 'rmagick', require: nil
gem 'selenium-webdriver', require: nil
gem 'backburner'
+gem 'ago'
platform :mri do
gem 'magic' # sudo apt-get install file, For OSX: brew install libmagic
diff --git a/Gemfile.lock b/Gemfile.lock
index d147bd16..effd8622 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -2,6 +2,8 @@ GEM
remote: https://rubygems.org/
specs:
addressable (2.3.4)
+ ago (0.1.5)
+ hoe (>= 1.12.2)
ansi (1.4.3)
backburner (0.3.4)
beaneater (~> 0.3.0)
@@ -27,6 +29,8 @@ GEM
ffi (1.4.0)
hashie (2.0.5)
hiredis (0.4.5)
+ hoe (3.6.3)
+ rake (>= 0.8, < 11.0)
i18n (0.6.4)
json (1.8.0)
kgio (2.8.0)
@@ -114,6 +118,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ ago
backburner
bcrypt-ruby
fabrication
diff --git a/app.rb b/app.rb
index 0124c72b..94c354d8 100644
--- a/app.rb
+++ b/app.rb
@@ -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
diff --git a/views/browse.slim b/views/browse.slim
index 3ef68460..8d200394 100644
--- a/views/browse.slim
+++ b/views/browse.slim
@@ -1,12 +1,17 @@
.row
.span12.text-center
h1 Home Pages on NeoCities
- p Want to make your own? Click here!
+ p If you like a site, don't forget to bookmark it!
Want to make your own? Click here!
- @sites.each_with_index do |site,i|
- if i.even? && i != 0
.row
- .span6.text-center
- h3: a href="http://#{site.username}.neocities.org" target="_blank" #{site.username}
+ .span6 style="background-color: #F8F8F8; margin-bottom: 30px"
+
+ .row
+ .span3
+ h3 style="margin-left: 20px": a href="http://#{site.username}.neocities.org" target="_blank" #{site.username}
+ .span3.text-right
+ p style="margin-right: 20px; margin-top: 10px" #{site.hits} hits
last updated #{site.updated_at.ago}
a href="http://#{site.username}.neocities.org" target="_blank": img src="/site_screenshots/#{ENV['RACK_ENV'] == 'development' ? 'victoria' : site.username}.jpg"
diff --git a/views/layout.slim b/views/layout.slim
index 50c3d700..ad65905d 100644
--- a/views/layout.slim
+++ b/views/layout.slim
@@ -21,6 +21,7 @@ html
.navbar-inner
a.brand href="/" NeoCities
ul.nav.pull-right
+ li: a href="/browse" Browse
- if signed_in?
li.navbar-text: strong style="color: #7AB800" #{current_site.username}
li: a href="/signout" style="color: #B94A48" Signout