mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
Fixes for surf mode pagination conversion
This commit is contained in:
parent
acb6449e77
commit
17610787ee
3 changed files with 3 additions and 2 deletions
2
app.rb
2
app.rb
|
@ -429,7 +429,7 @@ end
|
|||
get '/browse/?' do
|
||||
params.delete 'tag' if params[:tag].nil? || params[:tag].empty?
|
||||
site_dataset = browse_sites_dataset
|
||||
site_dataset = site_dataset.paginate @current_page, 300
|
||||
site_dataset = site_dataset.paginate @current_page, Site::BROWSE_PAGINATION_LENGTH
|
||||
@page_count = site_dataset.page_count || 1
|
||||
@sites = site_dataset.all
|
||||
erb :browse
|
||||
|
|
|
@ -123,6 +123,7 @@ class Site < Sequel::Model
|
|||
plan_five: 5
|
||||
}
|
||||
|
||||
BROWSE_PAGINATION_LENGTH = 300
|
||||
|
||||
many_to_many :tags
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
<ul class="row website-Gallery content int-Gall">
|
||||
<% @sites.each_with_index do |site,i| %>
|
||||
<li>
|
||||
<a href="" class="neo-Screen-Shot" title="<%= site.title %>" onclick="surf(<%= i+1 %>); return false">
|
||||
<a href="" class="neo-Screen-Shot" title="<%= site.title %>" onclick="surf(<%= ((@current_page-1)*Site::BROWSE_PAGINATION_LENGTH)+i+1 %>); return false">
|
||||
<span class="img-Holder" style="background:url(<%= site.screenshot_url('index.html', '540x405') %>) no-repeat;">
|
||||
<img src="/img/placeholder.png" alt="<%= site.title %>" />
|
||||
</span>
|
||||
|
|
Loading…
Add table
Reference in a new issue