partialize the outer div
This commit is contained in:
parent
7af0d01758
commit
2e406a7bcc
2
TODO.txt
2
TODO.txt
|
@ -1,5 +1,3 @@
|
|||
* partialize the outer div
|
||||
|
||||
* add generator option to copy particular template
|
||||
|
||||
* add Haml generator
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<div class='pagination'>
|
||||
<%= content_for :kaminari_paginator_tags %>
|
||||
</div>
|
|
@ -54,6 +54,9 @@ module Kaminari
|
|||
class TruncatedSpan < Tag
|
||||
end
|
||||
|
||||
class Paginator < Tag
|
||||
end
|
||||
|
||||
class PaginationRenderer
|
||||
attr_reader :options
|
||||
|
||||
|
@ -62,14 +65,6 @@ module Kaminari
|
|||
@left, @window, @right = (options[:left] || options[:outer_window] || 1), (options[:window] || options[:inner_window] || 4), (options[:right] || options[:outer_window] || 1)
|
||||
end
|
||||
|
||||
def to_s
|
||||
suppress_logging_render_partial do
|
||||
@template.content_tag :div, :class => 'pagination' do
|
||||
tagify.join("\n").html_safe
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def tagify
|
||||
num_pages, current_page, left, window, right = @options[:num_pages], @options[:current_page], @left, @window, @right
|
||||
|
||||
|
@ -94,6 +89,13 @@ module Kaminari
|
|||
tags << (num_pages > current_page ? NextLink.new(self) : NextSpan.new(self))
|
||||
end
|
||||
|
||||
def to_s
|
||||
suppress_logging_render_partial do
|
||||
@template.content_for :kaminari_paginator_tags, tagify.join("\n").html_safe
|
||||
Paginator.new(self).to_s
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def method_missing(meth, *args, &blk)
|
||||
@template.send meth, *args, &blk
|
||||
|
|
Loading…
Reference in New Issue