categorize.phtml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php $this->partial('aside_feed'); ?>
  2. <div class="post">
  3. <a href="<?php echo _url('index', 'index'); ?>"><?php echo _t('back_to_rss_feeds'); ?></a>
  4. <h2><?php echo _t('categories_management'); ?></h2>
  5. <p class="alert alert-warn">
  6. <?php echo _t('feeds_moved_category_deleted', $this->defaultCategory->name()); ?>
  7. </p>
  8. <div class="box">
  9. <div class="box-title"><label for="new-category"><?php echo _t('add_category'); ?></label></div>
  10. <ul class="box-content box-content-centered">
  11. <form action="<?php echo _url('category', 'create'); ?>" method="post">
  12. <li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?php echo _t('new_category'); ?>" /></li>
  13. <li class="item"><button class="btn btn-important" type="submit"><?php echo _t('submit'); ?></button></li>
  14. </form>
  15. </ul>
  16. </div>
  17. <form id="controller-category" method="post" style="display: none;"></form>
  18. <?php
  19. foreach ($this->categories as $cat) {
  20. $feeds = $cat->feeds();
  21. ?>
  22. <div class="box">
  23. <div class="box-title">
  24. <form action="<?php echo _url('category', 'update', 'id', $cat->id()); ?>" method="post">
  25. <input type="text" name="name" value="<?php echo $cat->name(); ?>" />
  26. <div class="dropdown">
  27. <div id="dropdown-cat-<?php echo $cat->id(); ?>" class="dropdown-target"></div>
  28. <a class="dropdown-toggle btn" href="#dropdown-cat-<?php echo $cat->id(); ?>"><?php echo _i('down'); ?></a>
  29. <ul class="dropdown-menu">
  30. <li class="dropdown-close"><a href="#close">❌</a></li>
  31. <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo _t('filter'); ?></a></li>
  32. <li class="separator"></li>
  33. <?php if (!empty($feeds)) { ?>
  34. <li class="item">
  35. <button class="as-link confirm"
  36. data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>"
  37. type="submit"
  38. form="controller-category"
  39. formaction="<?php echo _url('category', 'empty', 'id', $cat->id()); ?>">
  40. <?php echo _t('ask_empty'); ?></button>
  41. </li>
  42. <?php } ?>
  43. <li class="item">
  44. <button class="as-link confirm"
  45. data-str-confirm="<?php echo _t('confirm_action_feed_cat'); ?>"
  46. type="submit"
  47. form="controller-category"
  48. formaction="<?php echo _url('category', 'delete', 'id', $cat->id()); ?>">
  49. <?php echo _t('delete'); ?></button>
  50. </li>
  51. </ul>
  52. </div>
  53. </form>
  54. </div>
  55. <ul class="box-content">
  56. <?php if (!empty($feeds)) { ?>
  57. <?php
  58. foreach ($feeds as $feed) {
  59. $error = $feed->inError() ? ' error' : '';
  60. $empty = $feed->nbEntries() == 0 ? ' empty' : '';
  61. ?>
  62. <li class="item<?php echo $error, $empty; ?>">
  63. <a class="configure open-slider" href="<?php echo _url('configure', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a>
  64. <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?>
  65. </li>
  66. <?php }
  67. } else {
  68. ?>
  69. <li class="item"><?php echo _t('category_empty'); ?></li>
  70. <?php } ?>
  71. </ul>
  72. </div>
  73. <?php } ?>
  74. </div>
  75. <div id="slider">
  76. </div>