Make it easier to view more pages

This commit is contained in:
Kyle Drake 2013-06-23 12:00:14 -07:00
parent c68cbeb5a4
commit 2a680c5dc6
2 changed files with 8 additions and 6 deletions

2
app.rb
View file

@ -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

View file

@ -3,17 +3,19 @@
h1 Web Sites on NeoCities
p If you like a site, don't forget to bookmark it!<br>Visitor counts are updated hourly.<br>Want to make your own site? <a href="/new">Click here</a>!
- 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<br>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