diff options
| author | 2022-05-15 13:47:31 +0200 | |
|---|---|---|
| committer | 2022-05-15 13:47:31 +0200 | |
| commit | 0cde4e898f94a10b5da7a221d5ddab904e0f2b1d (patch) | |
| tree | 86b3b5cf424f654948ff1189b77907cf9f4bcf7c /app/layout | |
| parent | 5736ec67c4bffecd735ae5ed3070dd01eb6e7413 (diff) | |
Automatic simplification of layout for many feeds (#4357)
* Refactor OPML export categories
Simplify code to comply with types hints.
And renamed a property to plural.
* Automatic simplification of layout for many feeds
New advanced property to automatically simplify the layout when there are many (1k+) feeds so that FreshRSS works out of the box with 20k+ feeds scenarios https://github.com/FreshRSS/FreshRSS/pull/4347
Merge https://github.com/FreshRSS/FreshRSS/pull/4356 first.
Diffstat (limited to 'app/layout')
| -rw-r--r-- | app/layout/aside_feed.phtml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 39804b8f4..62cb85df9 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -71,6 +71,11 @@ </li> <?php + $nbFeedsTotal = 0; + foreach ($this->categories as $cat) { + $nbFeedsTotal += $cat->nbFeeds(); + } + foreach ($this->categories as $cat): $feeds = $cat->feeds(); $position = $cat->attributes('position'); @@ -95,12 +100,14 @@ ?> <li id="f_<?= $feed->id() ?>" class="item feed<?= $f_active ? ' active' : '', $feed->mute() ? ' mute' : '' ?><?= $feed->inError() ? ' error' : '' ?><?= $feed->nbEntries() <= 0 ? ' empty' : '' - ?>" data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>"> - <div class="dropdown no-mobile"> + ?>" data-unread="<?= $feed->nbNotRead() ?>" data-priority="<?= $feed->priority() ?>"><?php + if ($f_active || $nbFeedsTotal < FreshRSS_Context::$user_conf->simplify_over_n_feeds): + ?><div class="dropdown no-mobile"> <div class="dropdown-target"></div><a class="dropdown-toggle" data-fweb="<?= $feed->website() ?>"><?= _i('configure') ?></a><?php /* feed_config_template */ ?> </div> <?php - if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; + if (FreshRSS_Context::$user_conf->show_favicons) { ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php } + endif; ?><a class="item-title" data-unread="<?= format_number($feed->nbNotRead()) ?>" href="<?= _url('index', $actual_view, 'get', 'f_' . $feed->id()) . $state_filter_manual ?>"><?= $feed->name() ?></a></li> <?php |
