browse.phtml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <?php
  2. /**
  3. * @version 7.7
  4. */
  5. /** @var string $filter */
  6. ?>
  7. <nav class="navbar navbar-filter">
  8. <div class="navbar-left">
  9. <?php
  10. switch ($filter) {
  11. case 'open':
  12. $filterLabel = $this->_('Selling Open Filter');
  13. break;
  14. case 'closed':
  15. $filterLabel = $this->_('Selling Closed Filter');
  16. break;
  17. default:
  18. $filterLabel = null;
  19. break;
  20. }
  21. if ($filterLabel !== null) {
  22. $container = $this->navigation()->getContainer();
  23. echo $this->navigation()
  24. ->setContainer($container->findOneBy('label', $filterLabel))
  25. ->setPartial('navigation/browse-filter.phtml', array('key' => 'show'))
  26. ->menu();
  27. $this->navigation()->setContainer($container);
  28. } ?>
  29. <?php
  30. $sortOptions = array(
  31. 'relevance' => $this->_('Relevance'),
  32. 'price_asc' => $this->_('Price Low to High'),
  33. 'price_desc' => $this->_('Price High to Low'),
  34. 'started_desc' => $this->_('Recently Listed'),
  35. 'ending_asc' => $this->_('Ending Soon')
  36. );
  37. $sort = (isset($params['sort'])) ? $params['sort'] : 'relevance';
  38. ?>
  39. <div class="btn-group">
  40. <button
  41. class="btn btn-default"><?php echo (array_key_exists($sort, $sortOptions)) ? $sortOptions[$sort] : $this->_('Sort By'); ?></button>
  42. <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  43. <span class="caret"></span>
  44. </button>
  45. <ul class="dropdown-menu">
  46. <?php foreach ($sortOptions as $key => $value) { ?>
  47. <li>
  48. <a href="<?php echo $this->url(array('sort' => $key), null, true, array('page')); ?>"><?php echo $value; ?></a>
  49. </li>
  50. <?php } ?>
  51. </ul>
  52. </div>
  53. </div>
  54. <form class="navbar-form navbar-right" action="" method="get">
  55. <div class="form-group">
  56. <?php echo $this->formElement('text', 'keywords', $this->keywords)
  57. ->setAttributes(array('placeholder' => $this->_('Listing Title'), 'class' => 'form-control input-default'))
  58. ->render();
  59. ?>
  60. <?php echo $this->formElement('text', 'listing_id', $this->listingId)
  61. ->setAttributes(array('placeholder' => $this->_('Listing ID'), 'class' => 'form-control input-default'))
  62. ->render();
  63. ?>
  64. </div>
  65. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  66. ->setAttributes(array('class' => 'btn btn-default'))
  67. ->render();
  68. ?>
  69. </form>
  70. </nav>
  71. <form action="" method="post">
  72. <?php echo $this->formElement('hidden', 'option', '')->render(); ?>
  73. <div class="table-responsive">
  74. <table class="table table-striped table-hover">
  75. <caption>
  76. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('listings found.'); ?>
  77. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  78. <?php echo $this->_('Showing results'); ?>
  79. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  80. <?php echo $this->_('to'); ?>
  81. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  82. <?php } ?>
  83. </caption>
  84. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  85. <thead>
  86. <tr>
  87. <th class="size-tiny">
  88. <?php echo $this->formElement('checkbox', 'selectAll')
  89. ->setMultiOptions(array(1 => null))
  90. ->render();
  91. ?>
  92. </th>
  93. <th><?php echo $this->_('Listing'); ?></th>
  94. <th class="size-mini"><?php echo $this->_('Status'); ?></th>
  95. <th class="size-tiny"></th>
  96. </tr>
  97. </thead>
  98. <?php } ?>
  99. <tbody>
  100. <?php
  101. /** @var \Ppb\Db\Table\Row\Listing $listing */
  102. foreach ($this->paginator as $listing) {
  103. ?>
  104. <tr>
  105. <td>
  106. <?php echo $this->formElement('checkbox', 'id')
  107. ->setMultiOptions(array($listing['id'] => null))
  108. ->setAttributes(array('class' => 'select-all'))
  109. ->setMultiple()
  110. ->render();
  111. ?>
  112. </td>
  113. <td>
  114. <?php echo $this->partial('partials/listing-box.phtml',
  115. array(
  116. 'listing' => $listing,
  117. 'seller' => true,
  118. 'enhanced' => true));
  119. ?>
  120. </td>
  121. <td>
  122. <?php echo $this->listingDetails($listing)->status(); ?>
  123. <?php if ($listing->countDependentRowset('\Ppb\Db\Table\Offers')) { ?>
  124. <div>
  125. <a class="btn btn-sm btn-default"
  126. href="<?php echo $this->url(array('module' => 'members', 'controller' => 'offers', 'action' => 'browse', 'type' => 'selling', 'listing_id' => $listing['id'])); ?>">
  127. <?php echo $this->_('View Offers'); ?></a>
  128. </div>
  129. <?php } ?>
  130. </td>
  131. <td>
  132. <div class="btn-group-vertical">
  133. <?php if ($listing->canEdit()) { ?>
  134. <a class="btn btn-sm btn-default"
  135. href="<?php echo $this->url(array('id' => $listing['id']), 'listings-edit'); ?>"
  136. title="<?php echo $this->_('Edit Listing'); ?>">
  137. <i class="fa fa-folder-open"></i>
  138. </a>
  139. <?php } ?>
  140. <?php if ($listing['active'] == 0) { ?>
  141. <a class="btn btn-sm btn-success"
  142. href="<?php echo $this->url(array('module' => 'app', 'controller' => 'payment', 'action' => 'listing-setup', 'id' => $listing['id'])); ?>"
  143. title="<?php echo $this->_('Make Listing Setup Fee Payment'); ?>">
  144. <i class="fa fa-money"></i>
  145. </a>
  146. <?php } ?>
  147. <?php if ($filter != 'drafts') { ?>
  148. <a class="btn btn-sm btn-default"
  149. href="<?php echo $this->url(array('id' => $listing['id']), 'listings-create-similar'); ?>"
  150. title="<?php echo $this->_('Create Similar Listing'); ?>">
  151. <i class="fa fa-barcode"></i>
  152. </a>
  153. <?php if ($listing->canClose()) { ?>
  154. <a class="btn btn-sm btn-default confirm-box"
  155. href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'listing', 'action' => 'close', 'id' => $listing['id']),
  156. null, true); ?>"
  157. title="<?php echo $this->_('Close Listing'); ?>"
  158. data-message="<?php echo $this->_('Are you sure you want to close this listing?'); ?>">
  159. <i class="fa fa-ban"></i>
  160. </a>
  161. <?php } ?>
  162. <?php
  163. }
  164. else {
  165. ?>
  166. <a class="btn btn-sm btn-success"
  167. href="<?php echo $this->url(array('id' => $listing['id']), 'listings-list-draft'); ?>"
  168. title="<?php echo $this->_('List Draft'); ?>">
  169. <i class="fa fa-share-alt"></i>
  170. </a>
  171. <?php } ?>
  172. <?php if ($listing->canDelete()) { ?>
  173. <a class="btn btn-sm btn-danger confirm-box"
  174. href="<?php echo $this->url(array('module' => 'listings', 'controller' => 'listing', 'action' => 'delete', 'id' => $listing['id']),
  175. null, true); ?>"
  176. title="<?php echo $this->_('Delete Listing'); ?>"
  177. data-message="<?php echo $this->_('Are you sure you want to delete this listing?'); ?>">
  178. <i class="fa fa-times"></i>
  179. </a>
  180. <?php } ?>
  181. </div>
  182. </td>
  183. </tr>
  184. <?php } ?>
  185. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  186. <tr>
  187. <td colspan="6">
  188. <div class="btn-group">
  189. <?php if (in_array($this->filter, array('open'))) { ?>
  190. <button class="btn btn-default confirm-form" value="close"
  191. data-message="<?php echo $this->_('Are you sure you want to close the listings you have selected?'); ?>">
  192. <?php echo $this->_('Close'); ?>
  193. </button>
  194. <?php } ?>
  195. <?php if (in_array($this->filter, array('scheduled'))) { ?>
  196. <button class="btn btn-default confirm-form" value="open"
  197. data-message="<?php echo $this->_('Are you sure you want to open the listings you have selected?'); ?>">
  198. <?php echo $this->_('Open'); ?>
  199. </button>
  200. <?php } ?>
  201. <?php if (in_array($this->filter, array('closed'))) { ?>
  202. <button class="btn btn-default confirm-form" value="relist"
  203. data-message="<?php echo $this->_('Are you sure you want to relist the listings you have selected?'); ?>">
  204. <?php echo $this->_('Relist'); ?>
  205. </button>
  206. <?php } ?>
  207. <?php if (in_array($this->filter, array('drafts'))) { ?>
  208. <button class="btn btn-default confirm-form" value="draftsList"
  209. data-message="<?php echo $this->_('Are you sure you want to list the selected drafts?'); ?>">
  210. <?php echo $this->_('List Items'); ?>
  211. </button>
  212. <?php } ?>
  213. <button class="btn btn-default confirm-form" value="delete"
  214. data-message="<?php echo $this->_('Are you sure you want to delete the listings you have selected?'); ?>">
  215. <?php echo $this->_('Delete'); ?>
  216. </button>
  217. </div>
  218. </td>
  219. </tr>
  220. <?php } ?>
  221. </tbody>
  222. </table>
  223. </div>
  224. </form>
  225. <div class="clearfix"></div>
  226. <?php if ($this->paginator->getPages()->totalItemCount) {
  227. ?>
  228. <div class="pull-left">
  229. <?php echo $this->partial('partials/items-per-page.phtml', array('itemsPerPage' => $itemsPerPage)); ?>
  230. </div>
  231. <?php } ?>
  232. <div class="pull-right">
  233. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>
  234. </div>