aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-09 18:46:22 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-08-09 18:46:22 +0200
commit2b25aa8f68dccf7001b965fc6c08c3a794ec6b04 (patch)
tree26ccb95906f9beaff6e9a0fb1b066345fea41ee7
parentc81be3c20aab4eb1773a0acd99d4aa5a9e30c4d6 (diff)
Option to hide (or not) feeds/categories with no unread article
https://github.com/marienfressinaud/FreshRSS/issues/430 https://github.com/marienfressinaud/FreshRSS/issues/575
-rwxr-xr-xapp/Controllers/configureController.php1
-rw-r--r--app/Models/Configuration.php4
-rw-r--r--app/i18n/en.php1
-rw-r--r--app/i18n/fr.php1
-rw-r--r--app/layout/aside_flux.phtml2
-rw-r--r--app/views/configure/reading.phtml9
6 files changed, 17 insertions, 1 deletions
diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php
index 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.php
index 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.php
index 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 &amp; 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.php
index 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 &amp; 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.phtml
index 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.phtml
index d56726730..c0525f1ed 100644
--- a/app/views/configure/reading.phtml
+++ b/app/views/configure/reading.phtml
@@ -64,6 +64,15 @@
<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">
<input type="checkbox" name="lazyload" id="lazyload" value="1"<?php echo $this->conf->lazyload ? ' checked="checked"' : ''; ?> />
<?php echo Minz_Translate::t ('img_with_lazyload'); ?>