mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
pagination for site profile
This commit is contained in:
parent
17119d369c
commit
351b2d7178
1 changed files with 10 additions and 1 deletions
11
app.rb
11
app.rb
|
@ -89,7 +89,16 @@ get '/site/:username' do |username|
|
||||||
end
|
end
|
||||||
|
|
||||||
@title = site.title
|
@title = site.title
|
||||||
@latest_events = site.latest_events
|
|
||||||
|
@current_page = params[:current_page]
|
||||||
|
@current_page = @current_page.to_i
|
||||||
|
@current_page = 1 if @current_page == 0
|
||||||
|
|
||||||
|
latest_events_dataset = site.latest_events(@current_page, 10)
|
||||||
|
|
||||||
|
@page_count = latest_events_dataset.page_count || 1
|
||||||
|
@latest_events = latest_events_dataset.all
|
||||||
|
|
||||||
erb :'site', locals: {site: site, is_current_site: site == current_site}
|
erb :'site', locals: {site: site, is_current_site: site == current_site}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue