aboutsummaryrefslogtreecommitdiff
path: root/app/layout/aside_feed.phtml
diff options
context:
space:
mode:
authorGravatar Prashant Tholia <65695939+prashanttholia@users.noreply.github.com> 2020-11-02 16:33:16 +0530
committerGravatar GitHub <noreply@github.com> 2020-11-02 12:03:16 +0100
commit6f23999c7b3de1a69fea4dea056aed2548c4a32d (patch)
tree48b8fc12bb20159dad9fbb6f94b68f604e150b69 /app/layout/aside_feed.phtml
parentc2e3bc7caba668e34dffe7555e3406a4435c3c36 (diff)
Remember open categories (#3185)
* feature(normal) - Remember opened categories in the left menu Session storage based implementation to remember opened categories in left menu Issue Ref: #2248 * lib_phpQuery updates * Updates covering feedback points and functionality fixes * Feedback updates * Revert "lib_phpQuery updates" This reverts commit dcd23b9418405a2d14ee03c1fcadf90c04b267e1. * First review Change variable name to "remember" instead of "open". Start using localStorage instead of sessionStorage. Simplify code. * Simplify remember categories init function Replace 'session' with 'local' in function names and comment Set open categories CSS as same as when category is opened in 'active' unfold mode * Remove URLSearchParams check in remember categories init function * Delete open categories on login and logout * JSHint check fix * Second review * Make new mode the default for new users * Always open active category * Reduce / simplify code * i18n French * Revert default value Wait a bit more for this decision / change Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/layout/aside_feed.phtml')
-rw-r--r--app/layout/aside_feed.phtml8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml
index fcc93c6a8..1b413ac86 100644
--- a/app/layout/aside_feed.phtml
+++ b/app/layout/aside_feed.phtml
@@ -46,9 +46,9 @@
<?php
$t_active = FreshRSS_Context::isCurrentGet('T');
- $t_show = ($t_active && FreshRSS_Context::$user_conf->display_categories === 'active') || FreshRSS_Context::$user_conf->display_categories === 'all';
+ $t_show = ($t_active && in_array(FreshRSS_Context::$user_conf->display_categories, [ 'active', 'remember' ])) || FreshRSS_Context::$user_conf->display_categories === 'all';
?>
- <li class="tree-folder category tags<?= $t_active ? ' active' : '' ?>">
+ <li id="tags" class="tree-folder category tags<?= $t_active ? ' active' : '' ?>">
<div class="tree-folder-title">
<a class="dropdown-toggle" href="#"><?= _i($t_active ? 'up' : 'down') ?></a>
<a class="title" data-unread="<?= format_number($this->nbUnreadTags) ?>" href="<?= _url('index', $actual_view, 'get', 'T') ?>"><?= _t('index.menu.tags') ?></a>
@@ -75,9 +75,9 @@
$position = $cat->attributes('position');
if (!empty($feeds)) {
$c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id());
- $c_show = ($c_active && FreshRSS_Context::$user_conf->display_categories === 'active') || FreshRSS_Context::$user_conf->display_categories === 'all';
+ $c_show = ($c_active && in_array(FreshRSS_Context::$user_conf->display_categories, [ 'active', 'remember' ])) || FreshRSS_Context::$user_conf->display_categories === 'all';
?>
- <li class="tree-folder category<?= $c_active ? ' active' : '' ?>"<?= null === $position ? '' : "data-position='$position'" ?> data-unread="<?= $cat->nbNotRead() ?>">
+ <li id="c_<?= $cat->id() ?>" class="tree-folder category<?= $c_active ? ' active' : '' ?>"<?= null === $position ? '' : "data-position='$position'" ?> data-unread="<?= $cat->nbNotRead() ?>">
<div class="tree-folder-title">
<a class="dropdown-toggle" href="#"><?= _i($c_show ? 'up' : 'down') ?></a>
<a class="title<?= $cat->hasFeedsWithError() ? ' error' : '' ?>" data-unread="<?= format_number($cat->nbNotRead()) ?>" href="<?= _url('index', $actual_view, 'get', 'c_' . $cat->id()) ?>"><?= $cat->name() ?></a>