File tree Expand file tree Collapse file tree
lib/tiny_admin/views/components Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments