mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
get pagination back online
This commit is contained in:
parent
841ad3e44d
commit
f112146257
3 changed files with 18 additions and 1 deletions
2
app.rb
2
app.rb
|
@ -36,7 +36,7 @@ end
|
|||
get '/browse' do
|
||||
@current_page = params[:current_page] || 1
|
||||
@current_page = @current_page.to_i
|
||||
site_dataset = Site.order(:updated_at.desc, :hits.desc).filter(is_banned: false).filter(site_changed: true).paginate(@current_page, 201)
|
||||
site_dataset = Site.order(:updated_at.desc, :hits.desc).filter(is_banned: false).filter(site_changed: true).paginate(@current_page, 400)
|
||||
|
||||
site_dataset.filter! is_nsfw: (!params[:is_nsfw].nil? ? true : false)
|
||||
|
||||
|
|
|
@ -8,4 +8,20 @@
|
|||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<% if @page_count > 1 %>
|
||||
<div style="font-size: 30pt">
|
||||
<% if @current_page != 1 %>
|
||||
<a href="/browse?current_page=<%= @current_page - 1 %>"><i class="icon-arrow-left" style="text-decoration: none"></i></a>
|
||||
<% end %>
|
||||
|
||||
<% 1.upto(@page_count) do |num| %>
|
||||
<a href="/browse?current_page=<%= num %>" style="<%= "text-decoration: none" if num == @current_page %>"><%= num %></a>
|
||||
<% end %>
|
||||
|
||||
<% if @current_page != @page_count %>
|
||||
<a href="/browse?current_page=<%= @current_page + 1 %>"><i class="icon-arrow-right" style="text-decoration: none"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div> <!-- end .content -->
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
<!-- Styles -->
|
||||
<link href="assets/css/neo.min.css" rel="stylesheet" type="text/css" media="all"/>
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all"/>
|
||||
<!-- If exists, brings over style blocks from child pages -->
|
||||
|
||||
<link rel="shortcut icon" type="image/ico" href="#favicon.ico" />
|
||||
|
|
Loading…
Add table
Reference in a new issue