Sha256: 2dbecda4f89ad51bf5fc63434edc21a1e5150ff0bdd5564eacfad063cb814d50

Contents?: true

Size: 1.84 KB

Versions: 62

Compression:

Stored size: 1.84 KB

Contents

- number_of_pages = collection.total_pages
- current_page = collection.current_page

%ul.sitemap-pagination
  %li.sitemap-pagination__node
    - if collection.first_page?
      %span.sitemap-pagination__navigation.sitemap-pagination__navigation--disabled= t('workarea.storefront.sitemaps.pagination.prev')
    - else
      = link_to t('workarea.storefront.sitemaps.pagination.prev'), pagination_path_for(page: current_page - 1), class: 'sitemap-pagination__navigation'
  - max_page = [current_page + 1, 3].max
  - start = [1, current_page - 1].max
  - if start > number_of_pages - 3 && start >= 2
    - start = number_of_pages - 2
  - stop = [max_page, number_of_pages].min
  - if start > 1
    %li.sitemap-pagination__node= link_to 1, pagination_path_for(page: 1), class: 'sitemap-pagination__link'
    - if start == 3
      %li.sitemap-pagination__node= link_to 2, pagination_path_for(page: 2), class: 'sitemap-pagination__link'
    - if start >= 4
      %li.sitemap-pagination__node
        %span …
  - Range.new(start, stop).each do |page|
    - if page == current_page
      %li.sitemap-pagination__node
        %strong= page
    - else
      %li.sitemap-pagination__node= link_to page, pagination_path_for(page: page), class: 'sitemap-pagination__link'
  - if stop < number_of_pages
    - if (stop + 1) != number_of_pages
      %li.sitemap-pagination__node
        %span …
    %li.sitemap-pagination__node= link_to number_of_pages, pagination_path_for(page: number_of_pages), class: 'sitemap-pagination__link'
  %li.sitemap-pagination__node
    - if collection.last_page?
      %span.sitemap-pagination__navigation.sitemap-pagination__navigation--disabled= t('workarea.storefront.sitemaps.pagination.next')
    - else
      = link_to t('workarea.storefront.sitemaps.pagination.next'), pagination_path_for(page: current_page + 1), class: 'sitemap-pagination__navigation'

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-storefront-3.4.27 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.4 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.26 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.3 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.25 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.2 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.24 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.1 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.23 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.22 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.0 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.21 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.5.0.beta.1 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.20 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.19 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.18 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.17 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.16 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.15 app/views/workarea/storefront/sitemaps/_pagination.html.haml
workarea-storefront-3.4.14 app/views/workarea/storefront/sitemaps/_pagination.html.haml