aboutsummaryrefslogtreecommitdiff
path: root/app/layout
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2024-12-15 12:34:18 +0100
committerGravatar GitHub <noreply@github.com> 2024-12-15 12:34:18 +0100
commit6b14a743ccfe5c14e15acac858c0906f4fccdf67 (patch)
tree0a464e2cd74e2ca6a2cdcb0161a2c100c596acbc /app/layout
parent066d92be3216cd5d3427072cbc410c19bf53f400 (diff)
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>
Diffstat (limited to 'app/layout')
-rw-r--r--app/layout/aside_feed.phtml8
-rw-r--r--app/layout/nav_menu.phtml7
2 files changed, 9 insertions, 6 deletions
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;
?>
<a id="toggle-<?= $state_str ?>"
class="btn <?= $state_enabled ? 'active' : '' ?>"
@@ -153,7 +155,8 @@
$mark_before_today['params']['idMax'] = $today . '000000';
$mark_before_one_week = $mark_read_url;
$mark_before_one_week['params']['idMax'] = ($today - 604800) . '000000';
- $mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) or !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ);
+ $mark_unread_enabled = FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ) ||
+ (!FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) && !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_OR_NOT_READ));
?>
<li class="item separator">
<button class="as-link <?= $confirm ?>"