Skip to content

Commit bd402b3

Browse files
committed
chore(views): small internal changes to pagination
1 parent 9d414e5 commit bd402b3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/tiny_admin/views/components/pagination.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def view_template
1818
if pages <= 10
1919
pages_range(1..pages)
2020
elsif current <= 4 || current >= pages - 3
21-
pages_range(1..(current <= 4 ? current + 2 : 4), with_dots: true)
22-
pages_range((current > pages - 4 ? current - 2 : pages - 2)..pages)
21+
pages_range(1..(current <= 4 ? (current + 2) : 4), with_dots: true)
22+
pages_range((current > pages - 4 ? (current - 2) : (pages - 2))..pages)
2323
else
2424
pages_range(1..1, with_dots: true)
2525
pages_range((current - 2)..(current + 2), with_dots: true)
@@ -39,7 +39,7 @@ def pages_range(range, with_dots: false)
3939
range.each do |page|
4040
li(class: page == current ? "page-item active" : "page-item") {
4141
href = query_string.empty? ? "?p=#{page}" : "?#{query_string}&p=#{page}"
42-
a(class: "page-link", href: href) { page }
42+
a(class: "page-link", href: href) { page.to_s }
4343
}
4444
end
4545
dots if with_dots

0 commit comments

Comments
 (0)