browse.phtml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?php
  2. /**
  3. * @version 7.9 [rev.7.9.01]
  4. */
  5. ?>
  6. <nav class="navbar navbar-filter">
  7. <div class="navbar-left">
  8. <?php
  9. /** @var \Cube\Navigation\Page\AbstractPage $container */
  10. $container = $this->navigation()->getContainer();
  11. echo $this->navigation()
  12. ->setContainer($container->findOneBy('label', $this->_('Filter Auctions Products')))
  13. ->setPartial('navigation/browse-filter.phtml')
  14. ->menu();
  15. $this->navigation()->setContainer($container);
  16. ?>
  17. <?php
  18. $sortOptions = array(
  19. 'relevance' => $this->_('Relevance'),
  20. 'price_asc' => $this->_('Price Low to High'),
  21. 'price_desc' => $this->_('Price High to Low'),
  22. 'started_desc' => $this->_('Recently Listed'),
  23. 'ending_asc' => $this->_('Ending Soon')
  24. );
  25. $sort = (isset($params['sort'])) ? $params['sort'] : 'relevance';
  26. ?>
  27. <div class="btn-group">
  28. <button
  29. class="btn btn-default"><?php echo (array_key_exists($sort, $sortOptions)) ? $sortOptions[$sort] : $this->_('Sort By'); ?></button>
  30. <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  31. <span class="caret"></span>
  32. </button>
  33. <ul class="dropdown-menu">
  34. <?php foreach ($sortOptions as $key => $value) { ?>
  35. <li>
  36. <a href="<?php echo $this->url(array('sort' => $key), null, true, array('page')); ?>"><?php echo $value; ?></a>
  37. </li>
  38. <?php } ?>
  39. </ul>
  40. </div>
  41. </div>
  42. <form class="navbar-form navbar-right"
  43. action="<?php echo $this->url(null, null, true, array('listing_id', 'keywords', 'option', 'page', 'submit')); ?>"
  44. method="get">
  45. <div class="form-group">
  46. <?php echo $this->formElement('text', 'listing_id', $this->listingId)
  47. ->setAttributes(array('placeholder' => $this->_('Listing ID'), 'class' => 'form-control input-small'))
  48. ->render();
  49. ?>
  50. <?php echo $this->formElement('text', 'keywords', $this->keywords)
  51. ->setAttributes(array('placeholder' => $this->_('Listing Title'), 'class' => 'form-control input-medium'))
  52. ->render();
  53. ?>
  54. </div>
  55. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  56. ->setAttributes(array('class' => 'btn btn-default'))
  57. ->render();
  58. ?>
  59. </form>
  60. </nav>
  61. <form action="" method="post">
  62. <?php echo $this->formElement('hidden', 'option', '')->render(); ?>
  63. <div class="table-responsive">
  64. <table class="table table-striped table-hover">
  65. <caption>
  66. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('listings found.'); ?>
  67. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  68. <?php echo $this->_('Showing results'); ?>
  69. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  70. <?php echo $this->_('to'); ?>
  71. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  72. <?php } ?>
  73. </caption>
  74. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  75. <thead>
  76. <tr>
  77. <th class="size-tiny">
  78. <?php echo $this->formElement('checkbox', 'selectAll')
  79. ->setMultiOptions(array(1 => null))
  80. ->render();
  81. ?>
  82. </th>
  83. <th><?php echo $this->_('Listing Details'); ?></th>
  84. <th class="size-mini"><?php echo $this->_('Status'); ?></th>
  85. <th class="size-tiny"></th>
  86. </tr>
  87. </thead>
  88. <?php } ?>
  89. <tbody>
  90. <?php
  91. /** @var \Ppb\Db\Table\Row\Listing $listing */
  92. foreach ($this->paginator as $listing) {
  93. /** @var \Ppb\Db\Table\Row\User $owner */
  94. $owner = $listing->findParentRow('\Ppb\Db\Table\Users');
  95. ?>
  96. <tr>
  97. <td>
  98. <?php echo $this->formElement('checkbox', 'id')
  99. ->setMultiOptions(array($listing['id'] => null))
  100. ->setAttributes(array('class' => 'select-all'))
  101. ->setMultiple()
  102. ->render();
  103. ?>
  104. </td>
  105. <td>
  106. <?php echo $this->partial('partials/listing-box.phtml',
  107. array(
  108. 'listing' => $listing,
  109. 'seller' => true,
  110. 'enhanced' => true));
  111. ?>
  112. </td>
  113. <td>
  114. <?php echo $this->listingDetails($listing)->status(); ?>
  115. </td>
  116. <td>
  117. <div class="btn-group-vertical">
  118. <a class="btn btn-default btn-sm"
  119. href="<?php echo $this->url(array('controller' => 'listings', 'action' => 'edit', 'id' => $listing['id'])); ?>"
  120. title="<?php echo $this->_('Edit Listing'); ?>">
  121. <i class="fa fa-folder-open"></i>
  122. </a>
  123. <a class="btn btn-danger btn-sm confirm-box"
  124. href="<?php echo $this->url(array('controller' => 'listings', 'action' => 'delete', 'id' => $listing['id']), null, true); ?>"
  125. title="<?php echo $this->_('Delete Listing'); ?>"
  126. data-message="<?php echo $this->_('Are you sure that you want to delete this listing?'); ?>">
  127. <i class="fa fa-times"></i>
  128. </a>
  129. </div>
  130. </td>
  131. </tr>
  132. <?php } ?>
  133. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  134. <tr>
  135. <td colspan="5">
  136. <div class="btn-group">
  137. <?php if (in_array($this->filter, array('open'))) { ?>
  138. <button class="btn btn-default confirm-form" value="close"
  139. data-message="<?php echo $this->_('Are you sure you want to close the listings you have selected?'); ?>"><?php echo $this->_('Close'); ?></button>
  140. <?php } ?>
  141. <?php if (in_array($this->filter, array('scheduled'))) { ?>
  142. <button class="btn btn-default confirm-form" value="open"
  143. data-message="<?php echo $this->_('Are you sure you want to open the listings you have selected?'); ?>"><?php echo $this->_('Open'); ?></button>
  144. <?php } ?>
  145. <?php if (in_array($this->filter, array('closed'))) { ?>
  146. <button class="btn btn-default confirm-form" value="relist"
  147. data-message="<?php echo $this->_('Are you sure you want to relist the listings you have selected?'); ?>"><?php echo $this->_('Relist'); ?></button>
  148. <?php } ?>
  149. <?php if (in_array($this->filter, array('open', 'scheduled', 'closed'))) { ?>
  150. <button class="btn btn-default confirm-form" value="suspend"
  151. data-message="<?php echo $this->_('Are you sure you want to suspend the listings you have selected?'); ?>"><?php echo $this->_('Suspend'); ?></button>
  152. <?php } ?>
  153. <?php if (in_array($this->filter, array('awaiting_approval'))) { ?>
  154. <button class="btn btn-default confirm-form" value="approve"
  155. data-message="<?php echo $this->_('Are you sure you want to approve the listings you have selected?'); ?>"><?php echo $this->_('Approve'); ?></button>
  156. <?php } ?>
  157. <?php if (in_array($this->filter, array('suspended'))) { ?>
  158. <button class="btn btn-default confirm-form" value="activate"
  159. data-message="<?php echo $this->_('Are you sure you want to activate the listings you have selected?'); ?>"><?php echo $this->_('Activate'); ?></button>
  160. <?php } ?>
  161. <?php if (in_array($this->filter, array('deleted'))) { ?>
  162. <button class="btn btn-default confirm-form" value="undelete"
  163. data-message="<?php echo $this->_('Are you sure you want to undelete the listings you have selected?'); ?>"><?php echo $this->_('Undelete'); ?></button>
  164. <?php } ?>
  165. <button class="btn btn-default confirm-form" value="delete"
  166. data-message="<?php echo $this->_('Are you sure you want to delete the listings you have selected?'); ?>"><?php echo $this->_('Delete'); ?></button>
  167. </div>
  168. </td>
  169. </tr>
  170. <?php } ?>
  171. </tbody>
  172. </table>
  173. </div>
  174. </form>
  175. <div class="clearfix"></div>
  176. <?php if ($this->paginator->getPages()->totalItemCount) {
  177. ?>
  178. <div class="pull-left">
  179. <?php echo $this->partial('partials/items-per-page.phtml', array('itemsPerPage' => $itemsPerPage)); ?>
  180. </div>
  181. <?php } ?>
  182. <div class="pull-right">
  183. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>
  184. </div>