disable first/last pages for now

pull/1974/head
Ayrat Badykov 6 years ago
parent db0f685536
commit cf3cab61dc
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 6
      apps/block_scout_web/assets/js/lib/async_listing_load.js
  2. 20
      apps/block_scout_web/lib/block_scout_web/templates/common_components/_pagination_container.html.eex
  3. 4
      apps/block_scout_web/lib/block_scout_web/templates/pending_transaction/index.html.eex

@ -99,21 +99,21 @@ export function asyncReducer (state = asyncInitialState, action) {
history.replaceState({}, null, state.nextPagePath) history.replaceState({}, null, state.nextPagePath)
if (state.pagesStack.length === 0) { if (state.pagesStack.length === 0) {
state.pagesStack.push(window.location.href.split('?')[0]) state.pagesStack.push(window.location.href.split('?')[0])
} }
state.pagesStack.push(state.nextPagePath) state.pagesStack.push(state.nextPagePath)
return Object.assign({}, state, { beyondPageOne: true }) return Object.assign({}, state, { beyondPageOne: true })
} }
case 'NAVIGATE_TO_NEWER': { case 'NAVIGATE_TO_NEWER': {
history.replaceState({}, null, state.prevPagePath) history.replaceState({}, null, state.prevPagePath)
state.pagesStack.pop() state.pagesStack.pop()
return Object.assign({}, state, { beyondPageOne: true }) return Object.assign({}, state, { beyondPageOne: true })
} }
default: default:
return state return state
} }
} }

@ -1,5 +1,5 @@
<div class='pagination-container <%= if assigns[:position] == "top" do %>position-top<% end %> <%= if assigns[:position] == "bottom" do %>position-bottom<% end %>'> <div class='pagination-container <%= if assigns[:position] == "top" do %>position-top<% end %> <%= if assigns[:position] == "bottom" do %>position-bottom<% end %>'>
<%= if assigns[:show_pagination_limit] do %> <%= if false do %>
<!-- Pagination limit --> <!-- Pagination limit -->
<div class="pagination-limit"> <div class="pagination-limit">
<%= gettext "Show" %> <%= gettext "Show" %>
@ -14,13 +14,15 @@
<!-- Pagination --> <!-- Pagination -->
<ul class="pagination"> <ul class="pagination">
<!-- First --> <!-- First -->
<li class="page-item"> <%= if assigns[:first_page_path] do %>
<a <li class="page-item">
<%= if !assigns[:first_page_path] do %>disabled<% end %> <a
class="page-link" <%= if !assigns[:first_page_path] do %>disabled<% end %>
href='<%= "#{assigns[:first_page_path]}" %>' class="page-link"
>First</a> href='<%= "#{assigns[:first_page_path]}" %>'
</li> >First</a>
</li>
<% end %>
<!-- Previous --> <!-- Previous -->
<li class="page-item"> <li class="page-item">
<a <a
@ -50,6 +52,7 @@
</a> </a>
</li> </li>
<!-- Last --> <!-- Last -->
<%= if assigns[:last_page_path] do %>
<li class="page-item"> <li class="page-item">
<a <a
<%= if !assigns[:last_page_path] do %>disabled<% end %> <%= if !assigns[:last_page_path] do %>disabled<% end %>
@ -57,5 +60,6 @@
href='<%= "#{assigns[:last_page_path]}" %>' href='<%= "#{assigns[:last_page_path]}" %>'
>Last</a> >Last</a>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>

@ -3,7 +3,7 @@
<div class="card-body" data-async-listing="<%= @current_path %>"> <div class="card-body" data-async-listing="<%= @current_path %>">
<h1 class="card-title"><%= gettext "Pending Transactions" %></h1> <h1 class="card-title"><%= gettext "Pending Transactions" %></h1>
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, prev_next_page_button: true %> <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
<div data-selector="channel-batching-message" style="display:none;"> <div data-selector="channel-batching-message" style="display:none;">
<div data-selector="reload-button" class="alert alert-info"> <div data-selector="reload-button" class="alert alert-info">
@ -32,7 +32,7 @@
<%= gettext("Loading") %>... <%= gettext("Loading") %>...
</div> </div>
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
<div class="button button-secondary button-small float-right mt-4" data-loading-button style="display: none;"> <div class="button button-secondary button-small float-right mt-4" data-loading-button style="display: none;">
<span class="loading-spinner-small mr-2"> <span class="loading-spinner-small mr-2">

Loading…
Cancel
Save