index.phtml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $this->partial('aside_subscription');
  4. ?>
  5. <main class="post">
  6. <div class="link-back-wrapper">
  7. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  8. </div>
  9. <h1><?= _t('sub.title') ?></h1>
  10. <?php if ($this->onlyFeedsWithError): ?>
  11. <div class="link-showAllFeeds-wrapper">
  12. <a href="<?= _url('subscription', 'index') ?>">← <?= _t('sub.feed.show.all') ?></a>
  13. </div>
  14. <p class="alert alert-warn">
  15. <?= _t('sub.feed.showing.error') ?>
  16. </p>
  17. <?php endif; ?>
  18. <?php if (!$this->onlyFeedsWithError && $this->signalError){ ?>
  19. <div>
  20. <a class="btn" href="<?= _url('subscription', 'index', 'error', '1') ?>"><?= _i('look') ?> <?= _t('sub.feed.show.error') ?></a>
  21. </div>
  22. <?php } ?>
  23. <div class="drop-section">
  24. <?php
  25. $signalError = false;
  26. foreach ($this->categories as $cat) {
  27. $feeds = $cat->feeds();
  28. ?>
  29. <div class="box">
  30. <div class="box-title">
  31. <a class="configure open-slider" href="<?= _url('subscription', 'category', 'id', $cat->id()) ?>" data-cat-position="<?= $cat->attributes('position') ?>"><?= _i('configure') ?></a>
  32. <h2><?= $cat->name() ?><?php if ($cat->kind() == FreshRSS_Category::KIND_DYNAMIC_OPML) { echo " " . _i('opml-dyn'); } ?></h2>
  33. </div>
  34. <ul class="box-content drop-zone scrollbar-thin" dropzone="move" data-cat-id="<?= $cat->id() ?>">
  35. <?php
  36. if (!empty($feeds)) {
  37. foreach ($feeds as $feed) {
  38. if ($this->onlyFeedsWithError && !$feed->inError()) {
  39. continue;
  40. }
  41. $error_class = '';
  42. $error_title = '';
  43. if ($feed->inError()) {
  44. $error_class = ' error';
  45. $error_title = _t('sub.feed.error');
  46. }
  47. $empty_class = '';
  48. $empty_title = '';
  49. if ($feed->nbEntries() == 0) {
  50. $empty_class = ' empty';
  51. $empty_title = _t('sub.feed.empty');
  52. }
  53. $mute_class = $feed->mute() ? ' mute' : '';
  54. ?>
  55. <li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $error_title, $empty_title ?>"
  56. draggable="true" data-feed-id="<?= $feed->id() ?>">
  57. <a class="configure open-slider" href="<?= _url('subscription', 'feed', 'id', $feed->id()) ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a>
  58. <?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
  59. <span class="item-title"><?= $feed->name() ?></span>
  60. </li>
  61. <?php
  62. }
  63. } else {
  64. ?>
  65. <li class="item feed disabled"><div class="alert-warn"><?= _t('sub.category.empty') ?></div></li>
  66. <?php } ?>
  67. <?php if ($cat->kind() != FreshRSS_Category::KIND_DYNAMIC_OPML): ?>
  68. <li class="item feed">✚ <a href="<?= _url('subscription', 'add', 'cat_id', $cat->id()) ?>"><?= _t('sub.feed.add') ?></a></li>
  69. <?php endif; ?>
  70. </ul>
  71. </div>
  72. <?php } ?>
  73. <div class="box visible-semi">
  74. <div class="box-title">
  75. ✚ <a href="<?= _url('subscription', 'add') ?>"><h2><?= _t('sub.category.add') ?></h2></a>
  76. </div>
  77. <div class="box-content">
  78. </div>
  79. </div>
  80. </div>
  81. </main>
  82. <?php $class = isset($this->feed) || isset($this->category) ? ' active' : ''; ?>
  83. <aside id="slider" class="<?= $class ?>">
  84. <a class="toggle_aside" href="#close"><img class="icon" src="../themes/icons/close.svg" loading="lazy" alt="❌"></a>
  85. <div id="slider-content">
  86. <?php
  87. if (isset($this->feed)) {
  88. $this->renderHelper('feed/update');
  89. } elseif (isset($this->category)) {
  90. $this->renderHelper('category/update');
  91. }
  92. ?>
  93. </div>
  94. </aside>
  95. <a href="#" id="close-slider">
  96. <?= _i('close') ?>
  97. </a>