Sha256: 63348eabf02a7e69bb1619e6ac10167c1cfa51365333690b4e0e9f3f3491e086

Contents?: true

Size: 1.47 KB

Versions: 12

Compression:

Stored size: 1.47 KB

Contents

- for_context ||= context

- if for_context.pages > 1
  div class="text-center"
    ul class="pagination"
      - if for_context.page == 1
        li.disabled: a href="#"
          i class="fa fa-angle-double-left"
        li.disabled: a href="#"
          i class="fa fa-angle-left"
      - else
        li: a href="#{url_for(page: 'first')}"
          i class="fa fa-angle-double-left"
        li: a href="#{url_for(page: 'prev')}"
          i class="fa fa-angle-left"
      - start = 1
      - if for_context.pages > 10
        - start = for_context.page - 5 if for_context.page > 5
        - if for_context.page > 6
          li.disabled: a href="#" ...
      - start = for_context.pages - 10 if start > for_context.pages - 10
      - start.upto(start + 10).each do |page|
        - break if page > for_context.pages
        - next if page < 1
        - if page == for_context.page
          li.active: a href="#" = page
        - else
          li: a href="#{url_for(page: page)}" = page
      - if for_context.pages > 10 && \
           for_context.page < for_context.pages - 5
        li.disabled: a href="#" ...
      - if for_context.page == for_context.pages
        li.disabled: a href="#"
          i class="fa fa-angle-right"
        li.disabled: a href="#"
          i class="fa fa-angle-double-right"
      - else
        li: a href="#{url_for(page: 'next')}"
          i class="fa fa-angle-right"
        li: a href="#{url_for(page: 'last')}"
          i class="fa fa-angle-double-right"

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
admin_it-1.1.0 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.11 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.10 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.9 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.8 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.7 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.6 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.5 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.4 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.3 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.2 app/views/admin_it/shared/_pagination.html.slim
admin_it-1.0.1 app/views/admin_it/shared/_pagination.html.slim