Sha256: d602fbe9a61b3cecc486b22ca1d334a9e26198483214a246d8d6a008a4dd1ac8

Contents?: true

Size: 784 Bytes

Versions: 35

Compression:

Stored size: 784 Bytes

Contents

- num, size, field = parse_page(page)
- num = num.to_i
- total_nums = total_size.to_i / size.to_i
- total_nums += 1 if total_size.to_i % size.to_i > 0
- start = [1, num - 2].max
- eend = [total_nums, num + 2].min
%ul.table_pagination.pagination
  %li(class="arrow") 
    %a.prev(href="#") «

  %li(class="arrow") 
    %a.next(href="#") »

  %li(class="all") 
    %a.all(href="#") all 

  - if num - 2 > 1
    %li(class="num") 
      %a(href="#") 1

  - if num - 2 > 2
    %li(class="inactive") 
      \...

  - (start..eend).each do |p|
    %li(class="num#{p.to_s == num.to_s ? " active" : "" }") 
      %a(href="#")= p

  - if num + 3 < total_nums
    %li(class="inactive") 
      \...

  - if num + 2 < total_nums
    %li(class="num") 
      %a(href="#")= total_nums



Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rbbt-rest-1.6.2 share/views/partials/table/page.haml
rbbt-rest-1.6.1 share/views/partials/table/page.haml
rbbt-rest-1.6.0 share/views/partials/table/page.haml
rbbt-rest-1.5.0 share/views/partials/table/page.haml
rbbt-rest-1.4.13 share/views/partials/table/page.haml
rbbt-rest-1.4.12 share/views/partials/table/page.haml
rbbt-rest-1.4.11 share/views/partials/table/page.haml
rbbt-rest-1.4.10 share/views/partials/table/page.haml
rbbt-rest-1.4.9 share/views/partials/table/page.haml
rbbt-rest-1.4.8 share/views/partials/table/page.haml
rbbt-rest-1.4.7 share/views/partials/table/page.haml
rbbt-rest-1.4.6 share/views/partials/table/page.haml
rbbt-rest-1.4.5 share/views/partials/table/page.haml
rbbt-rest-1.4.4 share/views/partials/table/page.haml
rbbt-rest-1.4.3 share/views/partials/table/page.haml
rbbt-rest-1.4.2 share/views/partials/table/page.haml
rbbt-rest-1.4.1 share/views/partials/table/page.haml
rbbt-rest-1.4.0 share/views/partials/table/page.haml
rbbt-rest-1.3.32 share/views/partials/table/page.haml
rbbt-rest-1.3.31 share/views/partials/table/page.haml