{{ $paginationResult := pagination }}
{{ if $paginationResult }}
  <nav class="qor-pagination-container">
    {{range $index, $page := $paginationResult.Pages}}
      {{if $page.IsFirst }}
        <a class="qor-pagination-first" href="{{patch_current_url "page" $page.Page}}" title="{{t "qor_admin.pagination.first" "First Page"}}" aria-label="{{t "qor_admin.pagination.first" "First Page"}}">{{t "qor_admin.pagination.first" "First Page"}}</a>
      {{end}}
    {{end}}

    <ul class="qor-pagination">
      {{range $index, $page := $paginationResult.Pages}}
        {{if $page.IsPrevious}}
          <li class="qor-pagination-item qor-pagination-previous">
            <a href="{{patch_current_url "page" $page.Page}}" title="{{t "qor_admin.pagination.previous" "Previous Page"}}" aria-label="{{t "qor_admin.pagination.previous"}}"><i class="material-icons">&#xE408;</i></a>
          </li>
        {{else if $page.IsNext}}
          <li class="qor-pagination-item qor-pagination-next">
            <a href="{{patch_current_url "page" $page.Page}}" title="{{t "qor_admin.pagination.next" "Next Page"}}" aria-label="{{t "qor_admin.pagination.next"}}"><i class="material-icons">&#xE409;</i></a>
          </li>
        {{else if $page.Current}}
          <li class="qor-pagination-item active"><a href="{{patch_current_url "page" $page.Page}}">{{$page.Page}}</a></li>
        {{else if not (or $page.IsFirst $page.IsLast) }}
          <li class="qor-pagination-item"><a href="{{patch_current_url "page" $page.Page}}">{{$page.Page}}</a></li>
        {{end}}
      {{end}}
    </ul>

    {{range $index, $page := $paginationResult.Pages}}
      {{if $page.IsLast }}
        <a class="qor-pagination-last" href="{{patch_current_url "page" $page.Page}}" title="{{t "qor_admin.pagination.page_num" "Page {{.Pages}}" $paginationResult.Pagination  }}" aria-label="{{t "qor_admin.pagination.last" "Last Page"}}">{{t "qor_admin.pagination.last" "Last Page"}}</a>
      {{end}}
    {{end}}

    <div class="qor-actions" data-toggle="qor.filter">
      <select class="qor-action--select" data-toggle="qor.selector" data-position="bottom" data-hover="true" data-clearable="false" name="per_page"
              {{ if eq 20 $paginationResult.Pagination.PerPage }}
                placeholder="{{t "qor_admin.pagination.20_entries" "20 Entries per page" }}"
              {{ else if eq 50 $paginationResult.Pagination.PerPage }}
                placeholder="{{t "qor_admin.pagination.50_entries" "50 Entries per page" }}"
              {{ else if eq 100 $paginationResult.Pagination.PerPage }}
                placeholder="{{t "qor_admin.pagination.100_entries" "100 Entries per page" }}"
              {{ else }}
                placeholder="{{t "qor_admin.pagination.show_all" "Show All Entries"}}"
              {{ end }} >
        <option value="20">{{t "qor_admin.pagination.20_entries" "20 Entries per page" }}</option>
        <option value="50">{{t "qor_admin.pagination.50_entries" "50 Entries per page" }}</option>
        <option value="100">{{t "qor_admin.pagination.100_entries" "100 Entries per page" }}</option>
        <option value="1000">{{t "qor_admin.pagination.1000_entries" "1000 Entries per page" }}</option>
      </select>
    </div>
  </nav>
{{ end }}
