newsletters.phtml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <nav class="navbar navbar-filter">
  2. <div class="navbar-left">
  3. <a class="btn btn-default pull-left spacing-right"
  4. href="<?php echo $this->url(array('action' => 'add-newsletter')); ?>">
  5. <?php echo $this->_('Create Newsletter'); ?>
  6. </a>
  7. </div>
  8. <form class="navbar-form navbar-right"
  9. action="<?php echo $this->url(null, null, true, array('title', 'submit')); ?>"
  10. method="get">
  11. <div class="form-group">
  12. <?php echo $this->formElement('text', 'title', $this->title)
  13. ->setAttributes(array('placeholder' => $this->_('Newsletter Title'), 'class' => 'form-control input-default'))
  14. ->render();
  15. ?>
  16. </div>
  17. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  18. ->setAttributes(array('class' => 'btn btn-default'))
  19. ->render();
  20. ?>
  21. </form>
  22. </nav>
  23. <div class="table-responsive">
  24. <table class="table table-striped table-hover">
  25. <caption>
  26. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('newsletters found.'); ?>
  27. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  28. <?php echo $this->_('Showing results'); ?>
  29. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  30. <?php echo $this->_('to'); ?>
  31. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  32. <?php } ?>
  33. </caption>
  34. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  35. <thead>
  36. <tr>
  37. <th><?php echo $this->_('Title'); ?></th>
  38. <th class="size-large"><?php echo $this->_('Send To'); ?></th>
  39. <th class="size-mini"><?php echo $this->_('Date'); ?></th>
  40. <th class="size-mini"><?php echo $this->_('Options'); ?></th>
  41. </tr>
  42. </thead>
  43. <?php } ?>
  44. <tbody>
  45. <?php
  46. /** @var \Cube\Db\Table\Row $newsletter */
  47. foreach ($this->paginator as $newsletter) {
  48. ?>
  49. <tr>
  50. <td>
  51. <?php echo $newsletter['title']; ?>
  52. </td>
  53. <td>
  54. <?php if ($newsletter['updated_at']) { ?>
  55. <small class="text-success">
  56. <?php echo $this->_('Sent on'); ?> <?php echo $this->date($newsletter['updated_at']); ?>
  57. </small>
  58. <?php
  59. }
  60. else if ($newsletter['recipients']) {
  61. ?>
  62. <small class="text-primary">
  63. <?php echo $this->_('Sending in progress'); ?> <br>
  64. <?php echo $newsletter['recipients']; ?> <?php echo $this->_('recipients remaining'); ?>
  65. </small>
  66. <?php
  67. }
  68. else {
  69. ?>
  70. <div class="btn-group">
  71. <button class="btn btn-default"><?php echo $this->_('Select Recipients'); ?></button>
  72. <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
  73. <span class="caret"></span>
  74. </button>
  75. <ul class="dropdown-menu">
  76. <?php foreach ($recipients as $key => $recipient) { ?>
  77. <li>
  78. <a href="<?php echo $this->url(array('send' => $key, 'id' => $newsletter['id']), null, true); ?>">
  79. <?php echo $recipient['name']; ?>
  80. </a>
  81. </li>
  82. <?php } ?>
  83. </ul>
  84. </div>
  85. <?php } ?>
  86. </td>
  87. <td>
  88. <?php echo $this->date(max(array($newsletter['created_at'], $newsletter['updated_at'])),
  89. true); ?>
  90. </td>
  91. <td>
  92. <div class="btn-group">
  93. <a class="btn btn-default btn-sm"
  94. href="<?php echo $this->url(array('action' => 'edit-newsletter', 'id' => $newsletter['id'])); ?>"
  95. title="<?php echo $this->_('Edit Newsletter'); ?>">
  96. <i class="fa fa-folder-open"></i>
  97. </a>
  98. <a class="btn btn-danger btn-sm confirm-box"
  99. href="<?php echo $this->url(array('action' => 'delete-newsletter', 'id' => $newsletter['id']),
  100. null, true); ?>"
  101. title="<?php echo $this->_('Delete Newsletter'); ?>"
  102. data-message="<?php echo $this->_('Are you sure you want to delete this newsletter?'); ?>">
  103. <i class="fa fa-times"></i>
  104. </a>
  105. </div>
  106. </td>
  107. </tr>
  108. <?php } ?>
  109. </tbody>
  110. </table>
  111. </div>
  112. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>