category-list.html.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <h2 class="post-index"><?php echo $category->title ?></h2>
  3. <div><?php echo $category->body;?></div>
  4. <br>
  5. <?php if ($category->url !== site_url() . 'category/uncategorized'):?><a class="btn btn-primary right" href="<?php echo $category->url;?>/edit?destination=admin/categories"><?php echo i18n("Edit_category");?></a><?php endif;?>
  6. <br><br>
  7. <?php if (!empty($posts)) { ?>
  8. <table class="table post-list">
  9. <thead>
  10. <tr class="head">
  11. <th><?php echo i18n('Title');?></th>
  12. <th><?php echo i18n('Published');?></th>
  13. <th><?php echo i18n('Operations');?></th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php foreach ($posts as $p): ?>
  18. <tr>
  19. <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
  20. <td><?php echo format_date($p->date) ?></td>
  21. <?php if ($category->url !== site_url() . 'category/uncategorized') {?>
  22. <td><a class="btn btn-primary btn-xs" href="<?php echo $p->url ?>/edit?destination=admin/categories/<?php echo $category->slug;?>"><?php echo i18n('Edit');?></a> <a
  23. class="btn btn-danger btn-xs" href="<?php echo $p->url ?>/delete?destination=admin/categories/<?php echo $category->slug;?>"><?php echo i18n('Delete');?></a></td>
  24. <?php } else {?>
  25. <td><a class="btn btn-primary btn-xs" href="<?php echo $p->url ?>/edit?destination=admin/categories/uncategorized"><?php echo i18n('Edit');?></a> <a
  26. class="btn btn-danger btn-xs" href="<?php echo $p->url ?>/delete?destination=admin/categories/uncategorized"><?php echo i18n('Delete');?></a></td>
  27. <?php } ?>
  28. </tr>
  29. <?php endforeach; ?>
  30. </tbody>
  31. </table>
  32. <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
  33. <br>
  34. <div class="pager">
  35. <ul class="pagination">
  36. <?php if (!empty($pagination['prev'])) { ?>
  37. <li class="newer page-item"><a class="page-link" href="?page=<?php echo $page - 1 ?>" rel="prev">&#8592; <?php echo i18n('Newer');?></a></li>
  38. <?php } else { ?>
  39. <li class="page-item disabled" ><span class="page-link">&#8592; <?php echo i18n('Newer');?></span></li>
  40. <?php } ?>
  41. <li class="page-number page-item disabled"><span class="page-link"><?php echo $pagination['pagenum'];?></span></li>
  42. <?php if (!empty($pagination['next'])) { ?>
  43. <li class="older page-item" ><a class="page-link" href="?page=<?php echo $page + 1 ?>" rel="next"><?php echo i18n('Older');?> &#8594;</a></li>
  44. <?php } else { ?>
  45. <li class="page-item disabled" ><span class="page-link"><?php echo i18n('Older');?> &#8594;</span></li>
  46. <?php } ?>
  47. </ul>
  48. </div>
  49. <?php endif; ?>
  50. <?php } else {
  51. echo i18n('No_posts_found') . '!';
  52. } ?>