From 2a680c5dc6d5d77358ac17cca5eef07fde235555 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 23 Jun 2013 12:00:14 -0700 Subject: [PATCH] Make it easier to view more pages --- app.rb | 2 +- views/browse.slim | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app.rb b/app.rb index ebd4969b..2623176a 100644 --- a/app.rb +++ b/app.rb @@ -20,7 +20,7 @@ end get '/browse' do @current_page = params[:current_page] || 1 @current_page = @current_page.to_i - site_dataset = Site.order(:hits.desc, :updated_at.desc).filter(is_banned: false).filter(~{updated_at: nil}).paginate(@current_page, 100) + site_dataset = Site.order(:hits.desc, :updated_at.desc).filter(is_banned: false).filter(~{updated_at: nil}).paginate(@current_page, 200) @page_count = site_dataset.page_count || 1 @sites = site_dataset.all slim :browse diff --git a/views/browse.slim b/views/browse.slim index 540ec751..dec84896 100644 --- a/views/browse.slim +++ b/views/browse.slim @@ -3,17 +3,19 @@ h1 Web Sites on NeoCities p If you like a site, don't forget to bookmark it!
Visitor counts are updated hourly.
Want to make your own site? Click here! + - count = 0 - @sites.each_with_index do |site,i| - - if i.even? && i != 0 + - if count == 0 .row + - count = 0 if (count += 1) == 3 - .span6 style="background-color: #F8F8F8; margin-bottom: 30px" + .span4 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} + .span1 + h5: b 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} visits
last updated #{site.updated_at.ago} + p style="margin-right: 20px; margin-top: 10px; font-size: 10pt" #{site.hits} visits, 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" - if @page_count > 1