Sha256: 5f354ddadd3ff1ee295d920884a1c149dd598dc313153d4be30ee0e959b094cb

Contents?: true

Size: 399 Bytes

Versions: 1

Compression:

Stored size: 399 Bytes

Contents

.pages
  - page = params[:page].to_i
  - nums = (1..5).to_a
  - nums |= ((page-3)..(page+3)).to_a
  - nums |= ((@result.pages-5)..@result.pages).to_a
  - nums = nums.sort.find_all{|i| (1..@result.pages).include?(i)}
  - last_i = 0
  - nums.each do |i|
    - if i > last_i + 1
      …
    - last_i = i
    - unless i == page
      %a{:href=> merge_params("page" => i)}= i
    - else
      = i

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_db_browser-0.0.9 views/pages.haml