- for_context ||= context - if for_context.pages > 1 .text-center ul.pagination - if for_context.page == 1 li.disabled: a href="#": i.fa.fa-angle-double-left li.disabled: a href="#": i.fa.fa-angle-left - else li: a href="#{url_for(page: 'first')}": i.fa.fa-angle-double-left li: a href="#{url_for(page: 'prev')}": i.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.fa.fa-angle-right li.disabled: a href="#": i.fa.fa-angle-double-right - else li: a href="#{url_for(page: 'next')}": i.fa.fa-angle-right li: a href="#{url_for(page: 'last')}": i.fa.fa-angle-double-right