A free, self-hostable news aggregator…
Option to hide (or not) feeds/categories with no unread article
Alexandre Alapetite2b25aa8f68dc
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex 79f40b30b..0bf58880f 100755--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -184,6 +184,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {$this->view->conf->_default_view((int)Minz_Request::param('default_view', FreshRSS_Entry::STATE_ALL));$this->view->conf->_auto_load_more(Minz_Request::param('auto_load_more', false));$this->view->conf->_display_posts(Minz_Request::param('display_posts', false));+ $this->view->conf->_hide_read_feeds(Minz_Request::param('hide_read_feeds', false));$this->view->conf->_onread_jump_next(Minz_Request::param('onread_jump_next', false));$this->view->conf->_lazyload(Minz_Request::param('lazyload', false));$this->view->conf->_sticky_post(Minz_Request::param('sticky_post', false));diff --git a/app/Models/Configuration.php b/app/Models/Configuration.phpindex 7596c54cd..2f47312c0 100644--- a/app/Models/Configuration.php+++ b/app/Models/Configuration.php@@ -17,6 +17,7 @@ class FreshRSS_Configuration {'default_view' => FreshRSS_Entry::STATE_NOT_READ,'auto_load_more' => true,'display_posts' => false,+ 'hide_read_feeds' => true,'onread_jump_next' => true,'lazyload' => true,'sticky_post' => true,@@ -141,6 +142,9 @@ class FreshRSS_Configuration {public function _display_posts ($value) {$this->data['display_posts'] = ((bool)$value) && $value !== 'no';}+ public function _hide_read_feeds($value) {+ $this->data['hide_read_feeds'] = (bool)$value;+ }public function _onread_jump_next ($value) {$this->data['onread_jump_next'] = ((bool)$value) && $value !== 'no';}diff --git a/app/i18n/en.php b/app/i18n/en.phpindex 532327e4a..d80299b10 100644--- a/app/i18n/en.php+++ b/app/i18n/en.php@@ -262,6 +262,7 @@ return array ('sort_order' => 'Sort order','auto_load_more' => 'Load next articles at the page bottom','display_articles_unfolded' => 'Show articles unfolded by default',+ 'hide_read_feeds' => 'Hide categories & feeds with no unread article (only in “unread articles” display mode)','after_onread' => 'After “mark all as read”,','jump_next' => 'jump to next unread sibling (feed or category)','article_icons' => 'Article icons',diff --git a/app/i18n/fr.php b/app/i18n/fr.phpindex 0705d80b2..4be028ac3 100644--- a/app/i18n/fr.php+++ b/app/i18n/fr.php@@ -262,6 +262,7 @@ return array ('sort_order' => 'Ordre de tri','auto_load_more' => 'Charger les articles suivants en bas de page','display_articles_unfolded' => 'Afficher les articles dépliés par défaut',+ 'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (uniquement en affichage “articles non lus”)','after_onread' => 'Après “marquer tout comme lu”,','jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)','article_icons' => 'Icônes d’article',diff --git a/app/layout/aside_flux.phtml b/app/layout/aside_flux.phtmlindex cc04e757c..aee8f8754 100644--- a/app/layout/aside_flux.phtml+++ b/app/layout/aside_flux.phtml@@ -1,4 +1,4 @@-<div class="aside aside_flux<?php if (($this->state & FreshRSS_Entry::STATE_NOT_READ) && !($this->state & FreshRSS_Entry::STATE_READ)) echo ' state_unread'; ?>" id="aside_flux">+<div class="aside aside_flux<?php if ($this->conf->hide_read_feeds && ($this->state & FreshRSS_Entry::STATE_NOT_READ) && !($this->state & FreshRSS_Entry::STATE_READ)) echo ' state_unread'; ?>" id="aside_flux"><a class="toggle_aside" href="#close"><?php echo FreshRSS_Themes::icon('close'); ?></a><ul class="categories">diff --git a/app/views/configure/reading.phtml b/app/views/configure/reading.phtmlindex d56726730..c0525f1ed 100644--- a/app/views/configure/reading.phtml+++ b/app/views/configure/reading.phtml@@ -62,6 +62,15 @@</div></div>+ <div class="form-group">+ <div class="group-controls">+ <label class="checkbox" for="hide_read_feeds">+ <input type="checkbox" name="hide_read_feeds" id="hide_read_feeds" value="1"<?php echo $this->conf->hide_read_feeds ? ' checked="checked"' : ''; ?> />+ <?php echo Minz_Translate::t('hide_read_feeds'); ?>+ </label>+ </div>+ </div>+<div class="form-group"><div class="group-controls"><label class="checkbox" for="lazyload">