mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 01:21:41 +00:00
Revert "deshabilitar el paginado temporalmente"
This reverts commit 9c4a0a86f3
.
This commit is contained in:
parent
41acc89e37
commit
068bed5c0a
2 changed files with 4 additions and 2 deletions
|
@ -23,7 +23,7 @@ class PostsController < ApplicationController
|
|||
return unless stale?([current_usuarie, site, filter_params])
|
||||
|
||||
# Todos los artículos de este sitio para el idioma actual
|
||||
@posts = site.indexed_posts.where(locale: locale)
|
||||
@posts = site.indexed_posts.where(locale: locale).page(filter_params.delete(:page))
|
||||
# De este tipo
|
||||
@posts = @posts.where(layout: filter_params[:layout]) if filter_params[:layout]
|
||||
# Que estén dentro de la categoría
|
||||
|
@ -154,7 +154,7 @@ class PostsController < ApplicationController
|
|||
#
|
||||
# @return [Hash]
|
||||
def filter_params
|
||||
@filter_params ||= params.permit(:q, :category, :layout).to_hash.select do |_, v|
|
||||
@filter_params ||= params.permit(:q, :category, :layout, :page).to_hash.select do |_, v|
|
||||
v.present?
|
||||
end.transform_keys(&:to_sym)
|
||||
end
|
||||
|
|
|
@ -85,6 +85,8 @@
|
|||
%button.btn{ data: { action: 'reorder#bottom' } }= t('posts.reorder.bottom')
|
||||
|
||||
%div
|
||||
= link_to_prev_page @posts, t('posts.prev'), class: 'btn'
|
||||
= link_to_next_page @posts, t('posts.next'), class: 'btn'
|
||||
%tbody
|
||||
- dir = @site.data.dig(params[:locale], 'dir')
|
||||
- size = @posts.size
|
||||
|
|
Loading…
Reference in a new issue