index.phtml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 btn-icon-text" 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()) ?>" title="<?= _t('gen.action.manage') ?>" 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. $title = $error_title !== '' ? '⚠ ' . $error_title . '&#13;' : '';
  56. $title .= $empty_title !== '' ? $empty_title . '&#13;' : '';
  57. $title .= $feed->mute() ? '🔇 ' . _t('sub.feed.mute.state_is_muted') : '';
  58. ?>
  59. <li class="item feed<?= $error_class, $empty_class, $mute_class ?>" title="<?= $title ?>"
  60. draggable="true" data-feed-id="<?= $feed->id() ?>" data-priority="<?= $feed->priority() ?>">
  61. <a class="configure open-slider" href="<?= _url('subscription', 'feed', 'id', $feed->id()) ?>" title="<?= _t('gen.action.manage') ?>"><?= _i('configure') ?></a><?php
  62. if (FreshRSS_Context::userConf()->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php
  63. endif; ?><span class="item-title"><?= $feed->name() ?></span>
  64. </li>
  65. <?php
  66. }
  67. } else {
  68. ?>
  69. <li class="item feed disabled emptyCategory"><div class="alert-warn"><?= _t('sub.category.empty') ?></div></li>
  70. <?php } ?>
  71. <?php if ($cat->kind() != FreshRSS_Category::KIND_DYNAMIC_OPML): ?>
  72. <li class="item feed"><a href="<?= _url('subscription', 'add', 'cat_id', $cat->id()) ?>"><?= _i('add') ?><?= _t('sub.feed.add') ?></a></li>
  73. <?php endif; ?>
  74. </ul>
  75. </div>
  76. <?php } ?>
  77. <div class="box visible-semi">
  78. <div class="box-title">
  79. <a href="<?= _url('subscription', 'add') ?>"><?= _i('add') ?> <h2><?= _t('sub.category.add') ?></h2></a>
  80. </div>
  81. <div class="box-content">
  82. </div>
  83. </div>
  84. </div>
  85. </main>
  86. <?php $class = isset($this->feed) || isset($this->category) ? ' active' : ''; ?>
  87. <aside id="slider" class="<?= $class ?>">
  88. <a class="toggle_aside" href="#close"><img class="icon" src="../themes/icons/close.svg" loading="lazy" alt="❌"></a>
  89. <div id="slider-content">
  90. <?php
  91. if (isset($this->feed)) {
  92. $this->renderHelper('feed/update');
  93. } elseif (isset($this->category)) {
  94. $this->renderHelper('category/update');
  95. }
  96. ?>
  97. </div>
  98. </aside>
  99. <a href="#" id="close-slider">
  100. <?= _i('close') ?>
  101. </a>