From 6b14a743ccfe5c14e15acac858c0906f4fccdf67 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2024 12:34:18 +0100 Subject: New state: favorite or unread (#7088) * New state: favorite or unread https://github.com/FreshRSS/FreshRSS/discussions/7078#discussioncomment-11526292 * Experiment using this state by default * Rework state * Allow ANDS for typos * Revert change unrelated to this PR * Revert change of default state * Add option *unread_or_favorite* * Fix hide_read_feeds * i18n: it Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> * Update app/i18n/pl/conf.php Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com> * Update app/i18n/pl/conf.php Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com> * Fix i18n * Fix auto_remove_article * Fix mark_unread_enabled --------- Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com> Co-authored-by: Zic <55097497+ZicPL@users.noreply.github.com> --- app/layout/aside_feed.phtml | 8 ++++---- app/layout/nav_menu.phtml | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'app/layout') diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index 7ca3bd3db..18a1a9939 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -3,11 +3,11 @@ /** @var FreshRSS_View $this */ $actual_view = Minz_Request::actionName(); $class = ''; - if (FreshRSS_Context::userConf()->hide_read_feeds && - FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && + if (FreshRSS_Context::userConf()->hide_read_feeds && + (FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) || FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ)) && !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) { - $class = ' state_unread'; - } + $class = ' state_unread'; + } $state_filter_manual = Minz_Request::paramString('state'); if ($state_filter_manual !== '') { diff --git a/app/layout/nav_menu.phtml b/app/layout/nav_menu.phtml index c4aff5c55..c45c5e70a 100644 --- a/app/layout/nav_menu.phtml +++ b/app/layout/nav_menu.phtml @@ -22,7 +22,9 @@ foreach ($states as $state_str => $state) { $state_enabled = FreshRSS_Context::isStateEnabled($state); $url_state = Minz_Request::currentRequest(); - $url_state['params']['state'] = FreshRSS_Context::getRevertState($state); + $reverted_state = FreshRSS_Context::getRevertState($state); + $reverted_state &= FreshRSS_Entry::STATE_ANDS; // Keep only the AND states + $url_state['params']['state'] = $reverted_state; ?>