Explorar o código

Option to hide nav_entries (#1764)

* put nav_entries in a div so they can be hidden, add config option, no labels yet

* add English text for hide_nav_entries, choose better name

* Update conf.php

add comma to last item

* hide nav_entries by optionally not rendering in normal.phtml

* fix logic, remove containing div

* apply phpcbf to ConfigurationSetter.php

* Make navigation buttons options positive

And add TODOs for i18n, and add default config.
Matt DeMoss %!s(int64=8) %!d(string=hai) anos
pai
achega
0936a6cdb2

+ 1 - 0
app/Controllers/configureController.php

@@ -55,6 +55,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {
 			FreshRSS_Context::$user_conf->bottomline_date = Minz_Request::param('bottomline_date', false);
 			FreshRSS_Context::$user_conf->bottomline_link = Minz_Request::param('bottomline_link', false);
 			FreshRSS_Context::$user_conf->html5_notif_timeout = Minz_Request::param('html5_notif_timeout', 0);
+			FreshRSS_Context::$user_conf->show_nav_buttons = Minz_Request::param('show_nav_buttons', false);
 			FreshRSS_Context::$user_conf->save();
 
 			Minz_Session::_param('language', FreshRSS_Context::$user_conf->language);

+ 4 - 0
app/Models/ConfigurationSetter.php

@@ -184,6 +184,10 @@ class FreshRSS_ConfigurationSetter {
 		$data['mark_updated_article_unread'] = $this->handleBool($value);
 	}
 
+	private function _show_nav_buttons(&$data, $value) {
+		$data['show_nav_buttons'] = $this->handleBool($value);
+	}
+
 	private function _display_categories(&$data, $value) {
 		$data['display_categories'] = $this->handleBool($value);
 	}

+ 1 - 0
app/i18n/cz/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Bez limitu',
 			'thin' => 'Tenká',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Uživatelské dotazy',

+ 1 - 0
app/i18n/de/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Keine Begrenzung',
 			'thin' => 'Klein',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Benutzerabfragen',

+ 1 - 0
app/i18n/en/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'No limit',
 			'thin' => 'Thin',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',
 	),
 	'query' => array(
 		'_' => 'User queries',

+ 1 - 0
app/i18n/es/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Sin límite',
 			'thin' => 'Estrecho',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Consultas de usuario',

+ 1 - 0
app/i18n/fr/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Pas de limite',
 			'thin' => 'Fine',
 		),
+		'show_nav_buttons' => 'Afficher les boutons de navigation',
 	),
 	'query' => array(
 		'_' => 'Filtres utilisateurs',

+ 1 - 0
app/i18n/he/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'ללא הגבלה',
 			'thin' => 'צר',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'שאילתות',

+ 1 - 0
app/i18n/it/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Nessun limite',
 			'thin' => 'Stretto',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Ricerche personali',

+ 1 - 0
app/i18n/kr/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => '제한 없음',
 			'thin' => '얇음',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => '사용자 쿼리',

+ 1 - 0
app/i18n/nl/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Geen limiet',
 			'thin' => 'Smal',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Gebruikers queries (informatie aanvragen)',

+ 1 - 0
app/i18n/pt-br/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Sem lmite',
 			'thin' => 'Fino',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Queries do usuário',

+ 1 - 0
app/i18n/ru/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'No limit',
 			'thin' => 'Thin',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'User queries',

+ 1 - 0
app/i18n/tr/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => 'Sınırsız',
 			'thin' => 'Zayıf',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => 'Kullanıcı sorguları',

+ 1 - 0
app/i18n/zh-cn/conf.php

@@ -37,6 +37,7 @@ return array(
 			'no_limit' => '无限制',
 			'thin' => '小',
 		),
+		'show_nav_buttons' => 'Show the navigation buttons',	//TODO
 	),
 	'query' => array(
 		'_' => '自定义查询',

+ 10 - 1
app/views/configure/display.phtml

@@ -106,7 +106,7 @@
 				</tbody>
 			</table><br />
 		</div>
-		
+
 		<div class="form-group">
 			<label class="group-name" for="html5_notif_timeout"><?php echo _t('conf.display.notif_html5.timeout'); ?></label>
 			<div class="group-controls">
@@ -114,6 +114,15 @@
 			</div>
 		</div>
 
+		<div class="form-group">
+			<div class="group-controls">
+				<label class="checkbox" for="show_nav_buttons">
+					<input type="checkbox" name="show_nav_buttons" id="show_nav_buttons" value="1"<?php echo FreshRSS_Context::$user_conf->show_nav_buttons ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->show_nav_buttons; ?>"/>
+					<?php echo _t('conf.display.show_nav_buttons'); ?>
+				</label>
+			</div>
+		</div>
+
 		<div class="form-group form-actions">
 			<div class="group-controls">
 				<button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>

+ 1 - 1
app/views/index/normal.phtml

@@ -83,7 +83,7 @@ if (!empty($this->entries)) {
 	$this->renderHelper('pagination');
 ?></div>
 
-<?php $this->partial('nav_entries'); ?>
+<?php if (FreshRSS_Context::$user_conf->show_nav_buttons) $this->partial('nav_entries'); ?>
 
 <?php } else { ?>
 <div id="stream" class="prompt alert alert-warn normal">

+ 1 - 0
config-user.default.php

@@ -76,5 +76,6 @@ return array (
 	'queries' => array (
 	),
 	'html5_notif_timeout' => 0,
+	'show_nav_buttons' => true,
 	'extensions_enabled' => array(),
 );