Sha256: 35eaba7ac400c0d55215457d52f959105f71cf364a8ca93aa3056f49f33b79ac

Contents?: true

Size: 963 Bytes

Versions: 18

Compression:

Stored size: 963 Bytes

Contents

%script{type: 'text/javascript', src:'/javascripts/pagination.js'}

:javascript
  const PAGE_NUMBER = #{page_number};
  const PAGE_SIZE = #{page_size};
  const TOTAL_NUMBER = #{pagination_record_count}
  const CURRENT_PAGE_SIZE = #{current_page_size}

  $(document).ready(function(){
    function createPageLink(pageNumber, pageSize) {
      const url = new URL(window.location)
      url.searchParams.set('page', pageNumber)
      url.searchParams.set('pageSize', pageSize)
      return url.toString()
    }

    function createFooter(currentPage, totalPage, totalNumber) {
      return `<div class='nav-footer'>${CURRENT_PAGE_SIZE} of ${totalNumber} pacts</div>`
    }

    $('div.pagination').pagination({
        dataSource: [],
        totalNumber: TOTAL_NUMBER,
        pageNumber: PAGE_NUMBER,
        pageSize: PAGE_SIZE,
        pageRange: 2,
        pageLink: createPageLink,
        ulClassName: 'pagination',
        footer: createFooter
    })
  });

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
pact_broker-2.54.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.53.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.52.2 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.52.1 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.52.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.51.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.50.1 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.50.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.49.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.48.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.47.1 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.47.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.46.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.45.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.44.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.43.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.42.0 lib/pact_broker/ui/views/index/_pagination.haml
pact_broker-2.41.0 lib/pact_broker/ui/views/index/_pagination.haml