mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fix ordering for site browsing
This commit is contained in:
parent
e336ab9f35
commit
e643fd2eca
2 changed files with 2 additions and 2 deletions
2
app.rb
2
app.rb
|
@ -37,7 +37,7 @@ end
|
||||||
get '/browse' do
|
get '/browse' do
|
||||||
@current_page = params[:current_page] || 1
|
@current_page = params[:current_page] || 1
|
||||||
@current_page = @current_page.to_i
|
@current_page = @current_page.to_i
|
||||||
site_dataset = Site.order(:id.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
|
site_dataset = Site.order(:hits.desc, :updated_at.desc).filter(~{updated_at: nil}).paginate(@current_page, 100)
|
||||||
@page_count = site_dataset.page_count || 1
|
@page_count = site_dataset.page_count || 1
|
||||||
@sites = site_dataset.all
|
@sites = site_dataset.all
|
||||||
slim :browse
|
slim :browse
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.row
|
.row
|
||||||
.span12.text-center
|
.span12.text-center
|
||||||
h1 Home Pages on NeoCities
|
h1 Home Pages on NeoCities
|
||||||
p If you like a site, don't forget to bookmark it!<br>Hit counts are updated daily.<br>Want to make your own site? <a href="/new">Click here</a>!
|
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>!
|
||||||
|
|
||||||
- @sites.each_with_index do |site,i|
|
- @sites.each_with_index do |site,i|
|
||||||
- if i.even? && i != 0
|
- if i.even? && i != 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue