Revert "Arrays now paginate correctly."
This reverts commit 25441ff60a
.
This commit is contained in:
parent
25441ff60a
commit
2bb9f5ed05
|
@ -1,5 +0,0 @@
|
||||||
class Array
|
|
||||||
def to_liquid
|
|
||||||
Locomotive::Liquid::Drops::Base.new(self)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -30,23 +30,6 @@ module Locomotive
|
||||||
records
|
records
|
||||||
end
|
end
|
||||||
|
|
||||||
def paginate(options = {})
|
|
||||||
@collection = self.collection.paginate(options)
|
|
||||||
{
|
|
||||||
:collection => @collection,
|
|
||||||
:current_page => @collection.current_page,
|
|
||||||
:previous_page => @collection.previous_page,
|
|
||||||
:next_page => @collection.next_page,
|
|
||||||
:total_entries => @collection.total_entries,
|
|
||||||
:total_pages => @collection.total_pages,
|
|
||||||
:per_page => @collection.per_page
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
def collection
|
|
||||||
@_source
|
|
||||||
end
|
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def liquify(*records, &block)
|
def liquify(*records, &block)
|
||||||
|
|
|
@ -63,6 +63,19 @@ module Locomotive
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
|
def paginate(options = {})
|
||||||
|
@collection = self.collection.paginate(options)
|
||||||
|
{
|
||||||
|
:collection => @collection,
|
||||||
|
:current_page => @collection.current_page,
|
||||||
|
:previous_page => @collection.previous_page,
|
||||||
|
:next_page => @collection.next_page,
|
||||||
|
:total_entries => @collection.total_entries,
|
||||||
|
:total_pages => @collection.total_pages,
|
||||||
|
:per_page => @collection.per_page
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
def collection
|
def collection
|
||||||
@collection ||= @content_type.ordered_contents(@context['with_scope'])
|
@collection ||= @content_type.ordered_contents(@context['with_scope'])
|
||||||
end
|
end
|
||||||
|
|
|
@ -43,7 +43,6 @@ module Locomotive
|
||||||
page_count, current_page = pagination['total_pages'], pagination['current_page']
|
page_count, current_page = pagination['total_pages'], pagination['current_page']
|
||||||
|
|
||||||
path = context.registers[:page].fullpath
|
path = context.registers[:page].fullpath
|
||||||
path = context['path']
|
|
||||||
|
|
||||||
pagination['previous'] = link(I18n.t('pagination.previous'), current_page - 1, path) if pagination['previous_page']
|
pagination['previous'] = link(I18n.t('pagination.previous'), current_page - 1, path) if pagination['previous_page']
|
||||||
pagination['next'] = link(I18n.t('pagination.next'), current_page + 1, path) if pagination['next_page']
|
pagination['next'] = link(I18n.t('pagination.next'), current_page + 1, path) if pagination['next_page']
|
||||||
|
|
|
@ -65,7 +65,6 @@ module Locomotive
|
||||||
'contents' => Locomotive::Liquid::Drops::Contents.new,
|
'contents' => Locomotive::Liquid::Drops::Contents.new,
|
||||||
'current_page' => self.params[:page],
|
'current_page' => self.params[:page],
|
||||||
'params' => self.params,
|
'params' => self.params,
|
||||||
'path' => request.path,
|
|
||||||
'url' => request.url,
|
'url' => request.url,
|
||||||
'now' => Time.now.utc,
|
'now' => Time.now.utc,
|
||||||
'today' => Date.today
|
'today' => Date.today
|
||||||
|
|
Loading…
Reference in New Issue