Sha256: d8566fe198697ef5a354eff5c271a7e2938bba4cec531fab0e3937b0b6816b0f

Contents?: true

Size: 1.37 KB

Versions: 40

Compression:

Stored size: 1.37 KB

Contents

-# This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
-# calls with the actual strings ("‹ Prev", "Next ›", "…").

-# The link variable is set to a proc that returns the link tag.
-# Usage: link.call( page_number [, text [, extra_attributes_string ]])

- link = pagy_link_proc(pagy, 'class="page-link"')

%nav.pagy-nav-bootstrap.pagination{"aria-label" => "pager", :role => "navigation"}

  %ul.pagination

    - if pagy.prev
      %li.page-item.prev!= link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
    - else
      %li.page-item.prev.disabled
        %a.page-link{:href => '#'}!= pagy_t('pagy.nav.prev')

    - pagy.series.each do |item|                      # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
      - if item.is_a?(Integer)                        # page link
        %li.page-item!= link.call(item)

      - elsif item.is_a?(String)                      # current page
        %li.page-item.active!= link.call(item)

      - elsif item == :gap                            # page gap
        %li.page-item.disabled.gap
          %a.page-link{:href => "#"}!= pagy_t('pagy.nav.gap')

    - if pagy.next
      %li.page-item.next!= link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
    - else
      %li.page-item.next.disabled
        %a.page-link{:href => '#'}!= pagy_t('pagy.nav.next')

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
pagy-1.1.0 lib/templates/nav_bootstrap.html.haml
pagy-1.0.0 lib/templates/nav_bootstrap.html.haml
pagy-0.23.1 lib/templates/nav_bootstrap.html.haml
pagy-0.23.0 lib/templates/nav_bootstrap.html.haml
pagy-0.22.0 lib/templates/nav_bootstrap.html.haml
pagy-0.21.0 lib/templates/nav_bootstrap.html.haml
pagy-0.20.0 lib/templates/nav_bootstrap.html.haml
pagy-0.19.4 lib/templates/nav_bootstrap.html.haml
pagy-0.19.3 lib/templates/nav_bootstrap.html.haml
pagy-0.19.2 lib/templates/nav_bootstrap.html.haml
pagy-0.19.1 lib/templates/nav_bootstrap.html.haml
pagy-0.19.0 lib/templates/nav_bootstrap.html.haml
pagy-0.18.0 lib/templates/nav_bootstrap.html.haml
pagy-0.17.0 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.16.0 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.15.1 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.15.0 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.14.0 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.13.1 lib/pagy/extras/templates/nav_bootstrap.html.haml
pagy-0.13.0 lib/pagy/extras/templates/nav_bootstrap.html.haml