-offset = filters.nil? ? 0 : filters.to_i -pages = (total.to_f / filters.to_f).ceil -position = offset % 5

.card#form.no-print.m-b-10

.card-body.card-padding
  .row
    .col-sm-12
      == multiple_select_input({ :name => "user_id", :elements => notifications.collect { |notification| { :value => notification.creator.id, :text => notification.creator.full_name } }.uniq, :placeholder => "Empleados", :selected_elements => filters[:user_id] })
    .col-md-12
      == multiple_select_input({ :name => "label", :elements => Notification.labels.collect { |notification| { :value => notification.label, :text => notification.label.upcase } }, :placeholder => "Etiquetas", :selected_elements => filters[:label] })
    .col-md-12
      == multiple_select_input({ :name => "status", :elements => Notification.labels.collect { |notification| { :value => notification.label, :text => notification.label.upcase } }, :placeholder => "Etiquetas", :selected_elements => filters[:label] })
.pm-body.clearfix
  ul.tab-nav.tn-justified role="tablist"
    li.waves-effect.active role="presentation"
      a onclick="advance_search();"
        span Buscar

-if pages > 1

.row
  .col-sm-12
    .text-center
      ul.pagination.no-margin style="vertical-align:middle"
        li.page-first
          a href="#" onclick="advance_search(0);" «
        -if offset > 0
          li.page-pre
            a href="#" onclick="advance_search(#{offset - 1});" ‹
      input.form-control.text-center name="offset" type="number" max="#{pages}" min="1" value="#{offset+1}" style="vertical-align:middle;display:inline-block;width:100px"
      ul.pagination.no-margin style="vertical-align:middle"
        -if offset < pages -1
          li.page-next
            a href="#" onclick="advance_search(#{offset + 1});"  ›
          li.page-last
            a onclick="advance_search(#{pages-1});"  »

javascript:

function advance_search(offset) {
  filter_map = buildFilterMap(offset);
  window.location.href = "/notifications?" + encodeQueryData(filter_map);
};