[OCaml] Mobile-friendly clone of cgit.
refactor move pagination outside toolbar, render above and below commit-list
- Change pagination element from span to nav with aria-label - Remove pagination from toolbar div (toolbar now only holds filters) - Render pagination nav both above and below #commit-list - Right-align pagination controls with justify-content: flex-end - Slightly increase pagination button size (2.5em, font-size 1.1em) - Add margin-top: 1em to pagination nav matching commit-list spacing - Remove summary-layout grid (desktop) and flex (mobile) so README always stacks below the commit activity graph
Changed files
lib/static/styles.css
@@ -31,7 +31,7 @@
31
31
32
32
/* Parent-highlight on hover — the wrapping element gets a subtle glow */
33
33
li:has(> a:hover),
34
Removed:
span:has(> a:hover):not(.toolbar-pagination),
34
Added:
span:has(> a:hover),
35
35
dd:has(> a:hover) {
36
36
background-color: #252525;
37
37
border-radius: 0.25rem;
@@ -610,19 +610,20 @@
610
610
.toolbar-pagination {
611
611
display: flex;
612
612
align-items: center;
613
Added:
justify-content: flex-end;
613
614
gap: 0.5em;
614
Removed:
flex-shrink: 0;
615
Added:
margin-top: 1em;
615
616
}
616
617
617
618
.pagination-btn {
618
619
display: inline-flex;
619
620
align-items: center;
620
621
justify-content: center;
621
Removed:
min-width: 2em;
622
Removed:
min-height: 2em;
623
Removed:
padding: 0.25em 0.5em;
622
Added:
min-width: 2.5em;
623
Added:
min-height: 2.5em;
624
Added:
padding: 0.35em 0.6em;
624
625
border-radius: 0.25rem;
625
Removed:
font-size: 1em;
626
Added:
font-size: 1.1em;
626
627
font-weight: 600;
627
628
color: white;
628
629
background-color: #2a2a2a;
@@ -1047,10 +1048,6 @@
1047
1048
1048
1049
.diff-lines {
1049
1050
font-size: 0.85em;
1050
Removed:
}
1051
Removed:
1052
Removed:
.toolbar-pagination {
1053
Removed:
margin-left: auto;
1054
1051
}
1055
1052
}
1056
1053
lib/views/repo.ml
@@ -620,8 +620,8 @@
620
620
if not show_pagination then HTML.null []
621
621
else
622
622
HTML.(
623
Removed:
span
624
Removed:
[ class_ "toolbar-pagination" ]
623
Added:
nav
624
Added:
[ class_ "toolbar-pagination"; Aria.label "Pagination" ]
625
625
[
626
626
(if has_prev then
627
627
a
@@ -659,18 +659,20 @@
659
659
let tb =
660
660
HTML.(
661
661
div
662
Removed:
[ class_ "toolbar"; role `toolbar; Aria.label "Filters and pagination" ]
663
Removed:
[ filters_span; pagination_span ])
662
Added:
[ class_ "toolbar"; role `toolbar; Aria.label "Filters" ]
663
Added:
[ filters_span ])
664
664
in
665
665
render_page context ~active:Commits ~toolbar:[ tb ]
666
666
HTML.
667
667
[
668
Added:
pagination_span;
668
669
ul
669
670
[ id "commit-list" ]
670
671
(List.map
671
672
(li_of_commit ~hide_pill ?filter_type ?author ?committer
672
673
context.repo)
673
674
commits);
675
Added:
pagination_span;
674
676
]
675
677
676
678
let breadcrumb_pill repo (trail : (string * string) list) =