Parcourir la source

Montre toggle_aside seulement pour le mode normal

Corrige https://github.com/marienfressinaud/FreshRSS/issues/373
Au passage, introduit une classe au niveau `body` avec le nom de la vue
en cours (pas utilisé pour l'instant)
Alexandre Alapetite il y a 12 ans
Parent
commit
f121df42ee
4 fichiers modifiés avec 11 ajouts et 6 suppressions
  1. 2 2
      app/FreshRSS.php
  2. 1 1
      app/layout/layout.phtml
  3. 6 3
      app/layout/nav_menu.phtml
  4. 2 0
      app/views/index/index.phtml

+ 2 - 2
app/FreshRSS.php

@@ -106,8 +106,8 @@ class FreshRSS extends Minz_FrontController {
 	private function loadParamsView () {
 		Minz_Session::_param ('language', $this->conf->language);
 		Minz_Translate::init();
-		$output = Minz_Request::param ('output');
-		if (!$output) {
+		$output = Minz_Request::param ('output', '');
+		if (($output === '') || ($output !== 'normal' && $output !== 'rss' && $output !== 'reader' && $output !== 'global')) {
 			$output = $this->conf->view_mode;
 			Minz_Request::_param ('output', $output);
 		}

+ 1 - 1
app/layout/layout.phtml

@@ -28,7 +28,7 @@
 		<meta name="msapplication-TileColor" content="#FFF" />
 		<meta name="robots" content="noindex,nofollow" />
 	</head>
-	<body>
+	<body class="<?php echo Minz_Request::param('output', 'normal'); ?>">
 <?php $this->partial ('header'); ?>
 
 <div id="global">

+ 6 - 3
app/layout/nav_menu.phtml

@@ -1,5 +1,10 @@
+<?php
+	$actual_view = Minz_Request::param('output', 'normal');
+?>
 <div class="nav_menu">
+	<?php if ($actual_view === 'normal') { ?>
 	<a class="btn toggle_aside" href="#aside_flux"><?php echo FreshRSS_Themes::icon('category'); ?></a>
+	<?php } ?>
 
 	<?php if ($this->loginOk) { ?>
 	<a id="actualize" class="btn" href="<?php echo _url ('feed', 'actualize'); ?>"><?php echo FreshRSS_Themes::icon('refresh'); ?></a>
@@ -107,9 +112,7 @@
 
 			<?php
 				$url_output = $url;
-				$actual_view = Minz_Request::param('output', 'normal');
-			?>
-			<?php if($actual_view !== 'normal') { ?>
+				if ($actual_view !== 'normal') { ?>
 			<li class="item">
 				<?php $url_output['params']['output'] = 'normal'; ?>
 				<a class="view_normal" href="<?php echo Minz_Url::display ($url_output); ?>">

+ 2 - 0
app/views/index/index.phtml

@@ -12,6 +12,8 @@ if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
 	} elseif ($output === 'global') {
 		$this->renderHelper ('view/global_view');
 	} else {
+		Minz_Request::_param ('output', 'normal');
+		$output = 'normal';
 		$this->renderHelper ('view/normal_view');
 	}
 } elseif ($output === 'rss') {