Sha256: 3561fe20af2342638077ef84f68a5b870d0f129e8c6a48fa93d1a62b2f293bfe

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 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)

nav.pagy-nav-foundation role="navigation" aria-label="Pagination"

  ul.pagination

    - if pagy.prev
      li.prev == link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous"')
    - else
      li.prev.disabled
        == 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 == link.call(item)

      - elsif item.is_a?(String)                 # current page
        li.current
          = item

      - elsif item == :gap                       # page gap
        li.ellipsis.gap aria-hidden="true"

    - if pagy.next
      li.next == link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next"')
    - else
      li.next.disabled
        == pagy_t('pagy.nav.next')

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pagy-1.1.0 lib/templates/nav_foundation.html.slim
pagy-1.0.0 lib/templates/nav_foundation.html.slim
pagy-0.23.1 lib/templates/nav_foundation.html.slim
pagy-0.23.0 lib/templates/nav_foundation.html.slim
pagy-0.22.0 lib/templates/nav_foundation.html.slim
pagy-0.21.0 lib/templates/nav_foundation.html.slim
pagy-0.20.0 lib/templates/nav_foundation.html.slim