index.phtml 3.6 KB

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