diff --git a/app.rb b/app.rb index bab9fbf4..fe6c7941 100644 --- a/app.rb +++ b/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) diff --git a/views/browse.erb b/views/browse.erb index e1c3f2fc..48feb870 100644 --- a/views/browse.erb +++ b/views/browse.erb @@ -8,4 +8,20 @@ <% end %> + + <% if @page_count > 1 %> +
+ <% if @current_page != 1 %> +   + <% end %> + + <% 1.upto(@page_count) do |num| %> + "><%= num %>  + <% end %> + + <% if @current_page != @page_count %> + + <% end %> +
+ <% end %> \ No newline at end of file diff --git a/views/layout.erb b/views/layout.erb index cb85881c..3a60f418 100644 --- a/views/layout.erb +++ b/views/layout.erb @@ -24,6 +24,7 @@ +