Admin member index: Update pagination layout & styles (#16995)

* pagination theme for new admin view

* align pagination widget correctly in desktop view

* remove bottom pagination

* re-add pagination to the bottom

* use block styling for the links
This commit is contained in:
Suzanne Aitchison 2022-03-25 07:50:50 +00:00 committed by GitHub
parent 706ec6a388
commit c5ffa8be92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 4 deletions

View file

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" transform="scale(-1 1)">
<path d="m13.172 12-4.95-4.95 1.414-1.414L16 12l-6.364 6.364-1.414-1.414 4.95-4.95Z"/>
</svg>

After

Width:  |  Height:  |  Size: 206 B

View file

@ -22,6 +22,18 @@ label {
padding: 8px;
}
}
// New pagination styles as added in Admin Member Index view. As we roll out these styles to other admin views, the above CSS will eventually be removed.
.admin-pagination {
color: var(--link-color-secondary);
&--link {
padding: var(--su-1);
}
&--inactive {
color: var(--base-30);
}
}
.bg-featured {
background: #bbffd2;

View file

@ -4,9 +4,10 @@
<%= render "admin/users/index/tabs" %>
</header>
<%= render "admin/users/index/controls" %>
<%= paginate @users, theme: "internal" %>
<div class="flex justify-between">
<%= render "admin/users/index/controls" %>
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users" %>
</div>
<table class="crayons-table" width="100%">
<thead>
@ -26,5 +27,7 @@
</tbody>
</table>
<%= paginate @users, theme: "internal" %>
<div class="flex justify-end">
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users" %>
</div>
</div>

View file

@ -0,0 +1,4 @@
<li class="flex items-center">
<%= link_to_unless current_page.last?, crayons_icon_tag("chevron-right", aria_hidden: true, class: ("admin-pagination--inactive mx-1" if current_page.last?).to_s), url, rel: "next", remote: remote, class: "admin-pagination--link c-link c-link--icon-alone c-link--block",
aria: { label: t("views.pagination.aria_next"), describedby: "pagination-description" } %>
</li>

View file

@ -0,0 +1,12 @@
<%= paginator.render do %>
<nav aria-label="<%= label %>" class="admin-pagination flex fs-s items-center">
<span id="pagination-description">
<span class="screen-reader-only">Currently showing: </span>
<%= page_entries_info scope %>
</span>
<ul class="flex">
<%= prev_page_tag %>
<%= next_page_tag %>
</ul>
</nav>
<% end %>

View file

@ -0,0 +1,4 @@
<li class="flex items-center">
<%= link_to_unless current_page.first?, crayons_icon_tag("chevron-left", aria_hidden: true, class: ("admin-pagination--inactive mx-1" if current_page.first?).to_s), url, rel: "prev", remote: remote, class: "admin-pagination--link c-link c-link--icon-alone c-link--block",
aria: { label: t("views.pagination.aria_previous"), describedby: "pagination-description" } %>
</li>

View file

@ -0,0 +1,10 @@
---
en:
views:
pagination:
aria_next: "Next page"
aria_previous: "Previous page"
helpers:
page_entries_info:
more_pages:
display_entries: "%{first}&nbsp;-&nbsp;%{last} of %{total}"

View file

@ -2,8 +2,14 @@
fr:
views:
pagination:
aria_next: "Next page"
aria_previous: "Previous page"
first: "&laquo; Premier"
last: Dernier &raquo;
next: Suivant &rsaquo;
previous: "&lsaquo; Précédent"
truncate: "&hellip;"
helpers:
page_entries_info:
more_pages:
display_entries: "%{first}&nbsp;-&nbsp;%{last} of %{total}"