Quellcode durchsuchen

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
Alexandre Alapetite vor 11 Jahren
Ursprung
Commit
2b25aa8f68

+ 1 - 0
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));

+ 4 - 0
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';
 	}

+ 1 - 0
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',

+ 1 - 0
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',

+ 1 - 1
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">

+ 9 - 0
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">