tailwind.blade.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. @if ($paginator->hasPages())
  2. <nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="flex items-center justify-between">
  3. <div class="flex justify-between flex-1 sm:hidden">
  4. @if ($paginator->onFirstPage())
  5. <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
  6. {!! __('pagination.previous') !!}
  7. </span>
  8. @else
  9. <a href="{{ $paginator->previousPageUrl() }}" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
  10. {!! __('pagination.previous') !!}
  11. </a>
  12. @endif
  13. @if ($paginator->hasMorePages())
  14. <a href="{{ $paginator->nextPageUrl() }}" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
  15. {!! __('pagination.next') !!}
  16. </a>
  17. @else
  18. <span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
  19. {!! __('pagination.next') !!}
  20. </span>
  21. @endif
  22. </div>
  23. <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
  24. <div>
  25. <p class="text-sm text-gray-700 leading-5">
  26. {!! __('Showing') !!}
  27. <span class="font-medium">{{ $paginator->firstItem() }}</span>
  28. {!! __('to') !!}
  29. <span class="font-medium">{{ $paginator->lastItem() }}</span>
  30. {!! __('of') !!}
  31. <span class="font-medium">{{ $paginator->total() }}</span>
  32. {!! __('results') !!}
  33. </p>
  34. </div>
  35. <div>
  36. <span class="relative z-0 inline-flex shadow-sm rounded-md">
  37. {{-- Previous Page Link --}}
  38. @if ($paginator->onFirstPage())
  39. <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
  40. <span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5" aria-hidden="true">
  41. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  42. <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
  43. </svg>
  44. </span>
  45. </span>
  46. @else
  47. <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.previous') }}">
  48. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  49. <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
  50. </svg>
  51. </a>
  52. @endif
  53. {{-- Pagination Elements --}}
  54. @foreach ($elements as $element)
  55. {{-- "Three Dots" Separator --}}
  56. @if (is_string($element))
  57. <span aria-disabled="true">
  58. <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5">{{ $element }}</span>
  59. </span>
  60. @endif
  61. {{-- Array Of Links --}}
  62. @if (is_array($element))
  63. @foreach ($element as $page => $url)
  64. @if ($page == $paginator->currentPage())
  65. <span aria-current="page">
  66. <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
  67. </span>
  68. @else
  69. <a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
  70. {{ $page }}
  71. </a>
  72. @endif
  73. @endforeach
  74. @endif
  75. @endforeach
  76. {{-- Next Page Link --}}
  77. @if ($paginator->hasMorePages())
  78. <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150" aria-label="{{ __('pagination.next') }}">
  79. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  80. <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
  81. </svg>
  82. </a>
  83. @else
  84. <span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
  85. <span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5" aria-hidden="true">
  86. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  87. <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" />
  88. </svg>
  89. </span>
  90. </span>
  91. @endif
  92. </span>
  93. </div>
  94. </div>
  95. </nav>
  96. @endif