Просмотр файла htmly-2.9.8/system/admin/views/posts-list.html.php

Размер файла: 2.96Kb
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <h2 class="post-index"><?php echo $heading ?></h2>
  3. <br>
  4. <a class="btn btn-primary right" href="<?php echo site_url();?>admin/content"><?php echo i18n('Add_new_post');?></a>
  5. <br><br>
  6. <?php if (!empty($posts)) { ?>
  7. <table class="table post-list">
  8. <thead>
  9. <tr class="head">
  10. <th><?php echo i18n('Title');?></th>
  11. <th><?php echo i18n('Published');?></th><?php if (config("views.counter") == "true"): ?>
  12. <th><?php echo i18n('Views');?></th><?php endif; ?>
  13. <th><?php echo i18n('Author');?></th>
  14. <th><?php echo i18n('Category');?></th>
  15. <th><?php echo i18n('Tags');?></th>
  16. <th><?php echo i18n('Operations');?></th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <?php foreach ($posts as $p): ?>
  21. <tr>
  22. <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
  23. <td><?php echo format_date($p->date) ?></td>
  24. <?php if (config("views.counter") == "true"): ?>
  25. <td><?php echo $p->views ?></td><?php endif; ?>
  26. <td><a target="_blank" href="<?php echo $p->authorUrl ?>"><?php echo $p->author ?></a></td>
  27. <td><a href="<?php echo str_replace('category', 'admin/categories', $p->categoryUrl); ?>"><?php echo strip_tags($p->category);?></a></td>
  28. <td><?php echo str_replace('rel="tag"', 'rel="tag" class="badge badge-light text-primary font-weight-normal"', $p->tag); ?></td>
  29. <td><a class="btn btn-primary btn-xs" href="<?php echo $p->url ?>/edit?destination=admin/posts"><?php echo i18n('Edit');?></a> <a
  30. class="btn btn-danger btn-xs" href="<?php echo $p->url ?>/delete?destination=admin/posts"><?php echo i18n('Delete');?></a></td>
  31. </tr>
  32. <?php endforeach; ?>
  33. </tbody>
  34. </table>
  35. <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
  36. <br>
  37. <div class="pager">
  38. <ul class="pagination">
  39. <?php if (!empty($pagination['prev'])) { ?>
  40. <li class="newer page-item"><a class="page-link" href="?page=<?php echo $page - 1 ?>" rel="prev">&#8592; <?php echo i18n('Newer');?></a></li>
  41. <?php } else { ?>
  42. <li class="page-item disabled" ><span class="page-link">&#8592; <?php echo i18n('Newer');?></span></li>
  43. <?php } ?>
  44. <li class="page-number page-item disabled"><span class="page-link"><?php echo $pagination['pagenum'];?></span></li>
  45. <?php if (!empty($pagination['next'])) { ?>
  46. <li class="older page-item" ><a class="page-link" href="?page=<?php echo $page + 1 ?>" rel="next"><?php echo i18n('Older');?> &#8594;</a></li>
  47. <?php } else { ?>
  48. <li class="page-item disabled" ><span class="page-link"><?php echo i18n('Older');?> &#8594;</span></li>
  49. <?php } ?>
  50. </ul>
  51. </div>
  52. <?php endif; ?>
  53. <?php } else {
  54. echo i18n('No_posts_found') . '!';
  55. } ?>