Skip to content

Commit 2f36c08

Browse files
committed
Fixed pagination of web frontend
1 parent 52e2b33 commit 2f36c08

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

web_frontend/src/Views/Records/index.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@
9797
}
9898
} else {
9999
if( $page <= 4 ) {
100-
for( $i = 3; $i <= 5; $i++ ) {
100+
for( $i = 3; $i <= ( $page_count > 6 ? 5 : $page_count - 2 ); $i++ ) {
101101
echo "<div class='pagination-button" . ( $page == $i ? " pagination-button-active" : "" ) . "' data-page='$i' data-unique='$unique'>$i</div>";
102102
}
103-
}
104-
105-
if( $page >= $page_count - 3 ) {
106-
for( $i = $page_count - 4; $i <= $page_count - 2; $i++ ) {
103+
} else if( $page >= $page_count - 3 ) {
104+
for( $i = ( $page_count > 6 ? $page_count - 4 : 3 ); $i <= $page_count - 2; $i++ ) {
107105
echo "<div class='pagination-button" . ( $page == $i ? " pagination-button-active" : "" ) . "' data-page='$i' data-unique='$unique'>$i</div>";
108106
}
109107
}

0 commit comments

Comments
 (0)