From 4d333fccad76a9a3e855f9f73e21b47615f27c71 Mon Sep 17 00:00:00 2001 From: Gabriel Rodriguez Alsina Date: Mon, 13 May 2019 18:54:11 -0300 Subject: [PATCH] (update) all pagination buttons in all sections --- apps/block_scout_web/assets/css/_helpers.scss | 10 ++- .../css/components/_pagination_container.scss | 4 + .../assets/js/lib/async_listing_load.js | 9 ++- .../templates/address/index.html.eex | 11 +-- .../address_coin_balance/index.html.eex | 6 ++ .../index.html.eex | 80 +++++++++++-------- .../templates/address_token/index.html.eex | 45 +++++++---- .../address_token_transfer/index.html.eex | 12 +++ .../address_transaction/index.html.eex | 79 ++++++++++-------- .../address_validation/index.html.eex | 9 +++ .../templates/block/index.html.eex | 4 +- .../block_transaction/index.html.eex | 19 +++++ .../_pagination_container.html.eex | 14 +++- .../pending_transaction/index.html.eex | 11 +-- .../templates/tokens/transfer/index.html.eex | 15 +++- .../templates/transaction/_tabs.html.eex | 2 +- .../templates/transaction/index.html.eex | 11 +-- .../index.html.eex | 19 +++++ .../templates/transaction_log/index.html.eex | 19 +++++ .../transaction_raw_trace/index.html.eex | 9 +-- .../transaction_token_transfer/index.html.eex | 44 +++++++--- 21 files changed, 292 insertions(+), 140 deletions(-) diff --git a/apps/block_scout_web/assets/css/_helpers.scss b/apps/block_scout_web/assets/css/_helpers.scss index a7068b0b63..c26b5c5b22 100644 --- a/apps/block_scout_web/assets/css/_helpers.scss +++ b/apps/block_scout_web/assets/css/_helpers.scss @@ -20,4 +20,12 @@ @include media-breakpoint-down(md) { margin-right: 0; } -} \ No newline at end of file +} + +.clearfix:after { + clear: both; + content: " "; /* Older browser do not support empty content */ + display: block; + height: 0; + visibility: hidden; +} diff --git a/apps/block_scout_web/assets/css/components/_pagination_container.scss b/apps/block_scout_web/assets/css/components/_pagination_container.scss index a97b338c29..d9ae827df6 100644 --- a/apps/block_scout_web/assets/css/components/_pagination_container.scss +++ b/apps/block_scout_web/assets/css/components/_pagination_container.scss @@ -50,6 +50,10 @@ $pagination-page-link-color-active: #fff !default; margin: 0 0 0 auto; padding: 0; + @include media-breakpoint-down(sm) { + margin: 0 auto; + } + .page-item { margin: 0 5px 0 0; diff --git a/apps/block_scout_web/assets/js/lib/async_listing_load.js b/apps/block_scout_web/assets/js/lib/async_listing_load.js index 2e9e4e371b..99c5b0eaf2 100644 --- a/apps/block_scout_web/assets/js/lib/async_listing_load.js +++ b/apps/block_scout_web/assets/js/lib/async_listing_load.js @@ -145,11 +145,12 @@ export const elements = { }, '[data-async-listing] [data-next-page-button]': { render ($el, state) { - if (state.requestError) return $el.hide() - if (!state.nextPagePath) return $el.hide() - if (state.loading) return $el.hide() + if ((state.requestError) || (!state.nextPagePath) || (state.loading)) { + $el.attr('disabled', 'disabled') + return + } - $el.show() + // $el.show() $el.attr('href', state.nextPagePath) } }, diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex index 080102d2c9..91697de0c9 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex @@ -1,16 +1,7 @@
-

<%= gettext "Addresses" %>

-

- <%= gettext "Showing " %> - <%= Cldr.Number.to_string!(@page_address_count, format: "#,###") %> - <%= gettext " addresses of" %> - <%= Cldr.Number.to_string!(@address_count, format: "#,###") %> - <%= gettext "total addresses with a balance" %> - <%= gettext " (page" %> - <%= Cldr.Number.to_string!(@cur_page_number, format: "#,###)") %> -

+

<%= gettext "Addresses" %>

<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", prev_page_path: @prev_page_path, next_page_path: @next_page_path, cur_page_number: @cur_page_number, show_pagination_limit: true %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex index a41a641fad..ed45e918ce 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_coin_balance/index.html.eex @@ -13,6 +13,8 @@

<%= gettext "Balances" %>

+ <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> +
@@ -48,9 +50,13 @@
+ <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> + +
-
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/index.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/index.html.eex index 389dd2aefb..33f29839bb 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/index.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/index.html.eex @@ -8,6 +8,9 @@

<%= gettext "Tokens" %> / <%= token_name(@token) %>

+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> +
@@ -15,18 +18,27 @@ <%= gettext("Loading...") %>
+ + +
+ + <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> + + + -