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