From ba1d2d7bde9f261cc031a2ea7a491b0942086136 Mon Sep 17 00:00:00 2001 From: George Stephanis Date: Fri, 7 Aug 2015 16:36:50 -0400 Subject: [PATCH] Add in and populate pagination template. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buttons don’t actually do anything yet, but it outputs accurately and inherits core styles. --- .../admin/settings-views-html-settings-tax.js | 6 ++++ .../settings/views/html-settings-tax.php | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/assets/js/admin/settings-views-html-settings-tax.js b/assets/js/admin/settings-views-html-settings-tax.js index 37cadf96ed0..fb6ce55039a 100644 --- a/assets/js/admin/settings-views-html-settings-tax.js +++ b/assets/js/admin/settings-views-html-settings-tax.js @@ -7,6 +7,7 @@ $(function() { var rowTemplate = wp.template( 'wc-tax-table-row' ), + paginationTemplate = wp.template( 'wc-tax-table-pagination' ), $tbody = $('#rates'); /** @@ -52,6 +53,11 @@ renderTableContents( data.rates.slice( first_index, last_index ) ); // We've now displayed our initial page, time to render the pagination box. + $('#rates-pagination' ).html( paginationTemplate( { + qty_rates : data.rates.length, + current_page : data.page, + qty_pages : Math.ceil( data.rates.length / data.limit ) + } ) ); } $('.wc_tax_rates .remove_tax_rates').click(function() { diff --git a/includes/admin/settings/views/html-settings-tax.php b/includes/admin/settings/views/html-settings-tax.php index fb2ed3ca79c..5957595e307 100644 --- a/includes/admin/settings/views/html-settings-tax.php +++ b/includes/admin/settings/views/html-settings-tax.php @@ -166,3 +166,39 @@ wp_enqueue_script( 'wc-settings-tax' ); + + \ No newline at end of file