Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ChihuahUI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
ChihuahUI
Merge requests
!2
Add Pagination Styles
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Add Pagination Styles
add-pagination
into
master
Overview
5
Commits
5
Pipelines
11
Changes
1
All threads resolved!
Thread options
Hide all comments
Merged
Add Pagination Styles
Timur Oberhuber
requested to merge
add-pagination
into
master
Jun 11, 2023
Overview
5
Commits
5
Pipelines
11
Changes
1
All threads resolved!
Thread options
Hide all comments
Adds necessary pagination styles (copied (mostly) from Queue).
1
0
Merge request reports
Viewing commit
0bf6fd7f
Prev
Next
Show latest version
1 file
+
91
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
0bf6fd7f
Add pagination example to docs
· 0bf6fd7f
Timur Oberhuber
authored
Jun 25, 2023
docs/index.html
+
91
−
0
View file @ 0bf6fd7f
Edit in single-file editor
Open in Web IDE
Show full file
@@ -341,6 +341,97 @@
</div>
</div>
<div
class=
"flex vertical gap-3"
>
<h2
class=
"font-500"
>
Pagination
</h2>
<nav
aria-label=
"Page navigation"
class=
"pagination"
data-page=
"1"
th:data-page-size=
"25"
>
<ul
role=
"list"
>
<!-- Only show if more than 1 page -->
<li
data-disabled=
"true"
class=
"page__item"
>
<span
class=
"page__link"
>
«
</span>
</li>
<!-- More pages than "spots" in the pagination -->
<block>
<block>
<block>
<li
data-active=
"true"
class=
"page__item"
>
<span
class=
"page__link"
>
1
</span>
</li>
<li
data-active=
"false"
class=
"page__item"
>
<button
data-page=
"2"
class=
"page__link"
>
2
</button>
</li>
<li
data-active=
"false"
class=
"page__item"
>
<button
data-page=
"3"
class=
"page__link"
>
3
</button>
</li>
</block>
</block>
<block>
<li
class=
"page__item"
><a
href=
"#"
class=
"page__link"
>
...
</a></li>
</block>
</block>
</ul>
</nav>
<nav
aria-label=
"Page navigation"
class=
"pagination"
data-page=
"4"
data-page-size=
"25"
>
<ul
role=
"list"
>
<block>
<!-- Display if current page > number of "spots" in pagination -->
<li
class=
"page__item"
><a
href=
"#"
class=
"page__link"
>
...
</a></li>
</block>
<!-- Fewer pages than "spots" in the pagination -->
<block>
<block>
<li
data-active=
"false"
class=
"page__item"
>
<button
data-page=
"2"
class=
"page__link"
>
2
</button>
</li>
<li
data-active=
"false"
class=
"page__item"
>
<button
data-page=
"3"
class=
"page__link"
>
3
</button>
</li>
<li
data-active=
"true"
class=
"page__item"
>
<span
class=
"page__link"
>
4
</span>
</li>
</block>
</block>
<!-- If this is the last page -->
<li
data-disabled=
"true"
class=
"page__item"
>
<span
class=
"page__link"
>
»
</span>
</li>
</ul>
</nav>
<code>
<!-- JS to change the page query parameter -->
<script>
$
(()
=>
{
$
(
"
.pagination button.page__link
"
).
click
(
function
()
{
let
url
=
new
URL
(
window
.
location
);
url
.
searchParams
.
set
(
"
page
"
,
$
(
this
).
data
(
"
page
"
));
window
.
location
=
url
.
href
;
});
});
</script>
</code>
</div>
</main>
<script>
Loading