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:
parent
706ec6a388
commit
c5ffa8be92
8 changed files with 58 additions and 4 deletions
3
app/assets/images/chevron-left.svg
Normal file
3
app/assets/images/chevron-left.svg
Normal 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 |
|
|
@ -22,6 +22,18 @@ label {
|
||||||
padding: 8px;
|
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 {
|
.bg-featured {
|
||||||
background: #bbffd2;
|
background: #bbffd2;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@
|
||||||
<%= render "admin/users/index/tabs" %>
|
<%= render "admin/users/index/tabs" %>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<%= render "admin/users/index/controls" %>
|
<div class="flex justify-between">
|
||||||
|
<%= render "admin/users/index/controls" %>
|
||||||
<%= paginate @users, theme: "internal" %>
|
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users" %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<table class="crayons-table" width="100%">
|
<table class="crayons-table" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -26,5 +27,7 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<%= paginate @users, theme: "internal" %>
|
<div class="flex justify-end">
|
||||||
|
<%= paginate @users, theme: "admin", scope: @users, label: "Paginate users" %>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
4
app/views/kaminari/admin/_next_page.html.erb
Normal file
4
app/views/kaminari/admin/_next_page.html.erb
Normal 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>
|
||||||
12
app/views/kaminari/admin/_paginator.html.erb
Normal file
12
app/views/kaminari/admin/_paginator.html.erb
Normal 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 %>
|
||||||
4
app/views/kaminari/admin/_prev_page.html.erb
Normal file
4
app/views/kaminari/admin/_prev_page.html.erb
Normal 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>
|
||||||
10
config/locales/kaminari.en.yml
Normal file
10
config/locales/kaminari.en.yml
Normal 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} - %{last} of %{total}"
|
||||||
|
|
@ -2,8 +2,14 @@
|
||||||
fr:
|
fr:
|
||||||
views:
|
views:
|
||||||
pagination:
|
pagination:
|
||||||
|
aria_next: "Next page"
|
||||||
|
aria_previous: "Previous page"
|
||||||
first: "« Premier"
|
first: "« Premier"
|
||||||
last: Dernier »
|
last: Dernier »
|
||||||
next: Suivant ›
|
next: Suivant ›
|
||||||
previous: "‹ Précédent"
|
previous: "‹ Précédent"
|
||||||
truncate: "…"
|
truncate: "…"
|
||||||
|
helpers:
|
||||||
|
page_entries_info:
|
||||||
|
more_pages:
|
||||||
|
display_entries: "%{first} - %{last} of %{total}"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue