pager.phtml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. ?>
  8. <?php
  9. /**
  10. * Pager template
  11. *
  12. * @see \Magento\Theme\Block\Html\Pager
  13. */
  14. ?>
  15. <?php if ($block->getCollection()->getSize()): ?>
  16. <?php if ($block->getUseContainer()): ?>
  17. <div class="pager">
  18. <?php endif ?>
  19. <?php if ($block->getShowAmounts()): ?>
  20. <p class="toolbar-amount">
  21. <span class="toolbar-number">
  22. <?php if ($block->getLastPageNum()>1): ?>
  23. <?= /* @escapeNotVerified */ __('Items %1 to %2 of %3 total', $block->getFirstNum(), $block->getLastNum(), $block->getTotalNum()) ?>
  24. <?php elseif ($block->getTotalNum() == 1): ?>
  25. <?= /* @escapeNotVerified */ __('%1 Item', $block->getTotalNum()) ?>
  26. <?php else: ?>
  27. <?= /* @escapeNotVerified */ __('%1 Item(s)', $block->getTotalNum()) ?>
  28. <?php endif; ?>
  29. </span>
  30. </p>
  31. <?php endif ?>
  32. <?php if ($block->getLastPageNum()>1): ?>
  33. <div class="pages">
  34. <strong class="label pages-label" id="paging-label"><?= /* @escapeNotVerified */ __('Page') ?></strong>
  35. <ul class="items pages-items" aria-labelledby="paging-label">
  36. <?php if (!$block->isFirstPage()): ?>
  37. <li class="item pages-item-previous">
  38. <?php $text = $block->getAnchorTextForPrevious() ? $block->getAnchorTextForPrevious() : '';?>
  39. <a class="<?= /* @escapeNotVerified */ $text ? 'link ' : 'action ' ?> previous" href="<?= /* @escapeNotVerified */ $block->getPreviousPageUrl() ?>" title="<?= /* @escapeNotVerified */ $text ? $text : __('Previous') ?>">
  40. <span class="label"><?= /* @escapeNotVerified */ __('Page') ?></span>
  41. <span><?= /* @escapeNotVerified */ $text ? $text : __('Previous') ?></span>
  42. </a>
  43. </li>
  44. <?php endif;?>
  45. <?php if ($block->canShowFirst()): ?>
  46. <li class="item">
  47. <a class="page first" href="<?= /* @escapeNotVerified */ $block->getFirstPageUrl() ?>">
  48. <span class="label"><?= /* @escapeNotVerified */ __('Page') ?></span>
  49. <span>1</span>
  50. </a>
  51. </li>
  52. <?php endif;?>
  53. <?php if ($block->canShowPreviousJump()): ?>
  54. <li class="item">
  55. <a class="page previous jump" title="" href="<?= /* @escapeNotVerified */ $block->getPreviousJumpUrl() ?>">
  56. <span>...</span>
  57. </a>
  58. </li>
  59. <?php endif;?>
  60. <?php foreach ($block->getFramePages() as $_page): ?>
  61. <?php if ($block->isPageCurrent($_page)): ?>
  62. <li class="item current">
  63. <strong class="page">
  64. <span class="label"><?= /* @escapeNotVerified */ __('You\'re currently reading page') ?></span>
  65. <span><?= /* @escapeNotVerified */ $_page ?></span>
  66. </strong>
  67. </li>
  68. <?php else: ?>
  69. <li class="item">
  70. <a href="<?= /* @escapeNotVerified */ $block->getPageUrl($_page) ?>" class="page">
  71. <span class="label"><?= /* @escapeNotVerified */ __('Page') ?></span>
  72. <span><?= /* @escapeNotVerified */ $_page ?></span>
  73. </a>
  74. </li>
  75. <?php endif;?>
  76. <?php endforeach;?>
  77. <?php if ($block->canShowNextJump()): ?>
  78. <li class="item">
  79. <a class="page next jump" title="" href="<?= /* @escapeNotVerified */ $block->getNextJumpUrl() ?>">
  80. <span>...</span>
  81. </a>
  82. </li>
  83. <?php endif;?>
  84. <?php if ($block->canShowLast()): ?>
  85. <li class="item">
  86. <a class="page last" href="<?= /* @escapeNotVerified */ $block->getLastPageUrl() ?>">
  87. <span class="label"><?= /* @escapeNotVerified */ __('Page') ?></span>
  88. <span><?= /* @escapeNotVerified */ $block->getLastPageNum() ?></span>
  89. </a>
  90. </li>
  91. <?php endif;?>
  92. <?php if (!$block->isLastPage()): ?>
  93. <li class="item pages-item-next">
  94. <?php $text = $block->getAnchorTextForNext() ? $block->getAnchorTextForNext() : '';?>
  95. <a class="<?= /* @escapeNotVerified */ $text ? 'link ' : 'action ' ?> next" href="<?= /* @escapeNotVerified */ $block->getNextPageUrl() ?>" title="<?= /* @escapeNotVerified */ $text ? $text : __('Next') ?>">
  96. <span class="label"><?= /* @escapeNotVerified */ __('Page') ?></span>
  97. <span><?= /* @escapeNotVerified */ $text ? $text : __('Next') ?></span>
  98. </a>
  99. </li>
  100. <?php endif;?>
  101. </ul>
  102. </div>
  103. <?php endif; ?>
  104. <?php if ($block->isShowPerPage()): ?>
  105. <div class="limiter">
  106. <strong class="limiter-label"><?= /* @escapeNotVerified */ __('Show') ?></strong>
  107. <select id="limiter" data-mage-init='{"redirectUrl": {"event":"change"}}' class="limiter-options">
  108. <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?>
  109. <option value="<?= /* @escapeNotVerified */ $block->getLimitUrl($_key) ?>"<?php if ($block->isLimitCurrent($_key)): ?>
  110. selected="selected"<?php endif ?>>
  111. <?= /* @escapeNotVerified */ $_limit ?>
  112. </option>
  113. <?php endforeach; ?>
  114. </select>
  115. <span class="limiter-text"><?= /* @escapeNotVerified */ __('per page') ?></span>
  116. </div>
  117. <?php endif ?>
  118. <?php if ($block->getUseContainer()): ?>
  119. </div>
  120. <?php endif ?>
  121. <?php endif ?>