Class: Kadmin::Pager::Presenter
- Inherits:
-
Kadmin::Presenter
- Object
- SimpleDelegator
- Kadmin::Presenter
- Kadmin::Pager::Presenter
- Defined in:
- app/components/kadmin/pager/presenter.rb
Overview
Generates HTML code to present the given pager
Constant Summary collapse
- FIRST_PAGE_SYMBOL =
Returns HTML glyph representing ‘navigate to first page’.
'«'
- PREVIOUS_PAGE_SYMBOL =
Returns HTML glyph representing ‘navigate to previous page’.
'‹'
- LAST_PAGE_SYMBOL =
Returns HTML glyph representing ‘navigate to last page’.
'»'
- NEXT_PAGE_SYMBOL =
Returns HTML glyph representing ‘navigate to next page’.
'›'
- SEPARATOR_SYMBOL =
Returns HTML glyph used to indicate skipped page numbers.
'…'
- DEFAULT_SIZES =
Returns default page size controls.
[50, 100, 500, 1000].freeze
Instance Method Summary collapse
-
#generate(captured, page_sizes: DEFAULT_SIZES) ⇒ ActiveSupport::SafeBuffer
Generates HTML controls to change page, and pager behaviour.
Methods inherited from Kadmin::Presenter
#initialize, #present, #render
Constructor Details
This class inherits a constructor from Kadmin::Presenter
Instance Method Details
#generate(captured, page_sizes: DEFAULT_SIZES) ⇒ ActiveSupport::SafeBuffer
Generates HTML controls to change page, and pager behaviour.
28 29 30 31 32 33 34 35 |
# File 'app/components/kadmin/pager/presenter.rb', line 28 def generate(captured, page_sizes: DEFAULT_SIZES, **) = page_list controls = size_list(page_sizes) contents = + controls contents << captured unless captured.nil? return "<div class='btn-toolbar'>#{contents}</div>".html_safe end |