瀏覽代碼

bigMarkAsRead : utilisation sans JavaScript

et différent si l'utilisateur n'est pas connecté
Implémente https://github.com/marienfressinaud/FreshRSS/issues/249
Alexandre Alapetite 12 年之前
父節點
當前提交
9efb9388df

+ 4 - 2
app/layout/nav_menu.phtml

@@ -53,10 +53,12 @@
 					break;
 			}
 		}
+		$markReadUrl = _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet);
+		Session::_param ('markReadUrl', $markReadUrl);
 	?>
 
 	<div class="stick" id="nav_menu_read_all">
-		<a class="read_all btn" href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet); ?>"><?php echo Translate::t ('mark_read'); ?></a>
+		<a class="read_all btn" href="<?php echo $markReadUrl; ?>"><?php echo Translate::t ('mark_read'); ?></a>
 		<div class="dropdown">
 			<div id="dropdown-read" class="dropdown-target"></div>
 
@@ -64,7 +66,7 @@
 			<ul class="dropdown-menu">
 				<li class="dropdown-close"><a href="#close"> </a></li>
 
-				<li class="item"><a href="<?php echo _url ('entry', 'read', 'is_read', 1, 'get', $get, 'nextGet', $nextGet); ?>"><?php echo $string_mark; ?></a></li> 
+				<li class="item"><a href="<?php echo $markReadUrl; ?>"><?php echo $string_mark; ?></a></li> 
 				<li class="separator"></li>
 <?php
 	$date = getdate ();

+ 11 - 5
app/views/helpers/pagination.phtml

@@ -2,6 +2,8 @@
 	$c = Request::controllerName ();
 	$a = Request::actionName ();
 	$params = Request::params ();
+	$markReadUrl = Session::param ('markReadUrl');
+	Session::_param ('markReadUrl', false);
 ?>
 
 <ul class="pagination">
@@ -9,12 +11,16 @@
 	<?php if ($this->next != '') { ?>
 	<?php $params[$getteur] = $this->next; ?>
 	<a id="load_more" href="<?php echo Url::display (array ('c' => $c, 'a' => $a, 'params' => $params)); ?>"><?php echo Translate::t ('load_more'); ?></a>
+	<?php } elseif ($markReadUrl) { ?>
+	<a class="bigMarkAsRead" href="<?php echo $markReadUrl; ?>">
+		<?php echo Translate::t ('nothing_to_load'); ?><br />
+		<span class="bigTick">✔</span><br />
+		<?php echo Translate::t ('mark_all_read'); ?>
+	</a>
 	<?php } else { ?>
-	<div class="bigMarkAsRead">
-		<p><?php echo Translate::t ('nothing_to_load'); ?></p>
-		<p class="bigTick">✔</p>
-		<p><?php echo Translate::t ('mark_all_read'); ?></p>
-	</div>
+	<a class="bigMarkAsRead" href=".">
+		<?php echo Translate::t ('nothing_to_load'); ?><br />
+	</a>
 	<?php } ?>
 	</li>
 </ul>

+ 0 - 6
public/scripts/main.js

@@ -397,12 +397,6 @@ function init_stream_delegates(divStream) {
 		return false;
 	});
 
-	divStream.on('click', '.bigMarkAsRead', function () {
-		var url = $(".nav_menu .read_all").attr("href");
-		redirect(url, false);
-		return false;
-	});
-
 	if (auto_mark_site) {
 		divStream.on('click', '.flux .link a', function () {
 			mark_read($(this).parent().parent().parent(), true);

+ 8 - 5
public/themes/default/freshrss.css

@@ -575,18 +575,21 @@
 	font-size: 0;
 }
 
-.bigMarkAsRead {
-	cursor: pointer;
-	height: 300px;
+a.bigMarkAsRead {
+	display: block;
+	font-style: normal;
+	padding: 32px 0 64px 0;
+	text-align: center;
+	text-decoration: none;
 	text-shadow: 0 -1px 0 #aaa;
 }
-.bigMarkAsRead:hover {
+a.bigMarkAsRead:hover {
 	background: #333;
 	color: #fff;
 }
 .bigTick {
 	font-size: 72pt;
-	margin: 75px 0 10px 0;
+	line-height: 1.6em;
 }
 
 /*** NOTIFICATION ***/

+ 8 - 5
public/themes/flat-design/freshrss.css

@@ -562,19 +562,22 @@ body {
 	font-size: 0;
 }
 
-.bigMarkAsRead {
+a.bigMarkAsRead {
 	background: #ecf0f1;
-	cursor: pointer;
-	height: 300px;
+	display: block;
+	font-style: normal;
+	padding: 32px 0 64px 0;
+	text-align: center;
+	text-decoration: none;
 	text-shadow: 0 -1px 0 #aaa;
 }
-.bigMarkAsRead:hover {
+a.bigMarkAsRead:hover {
 	background: #34495e;
 	color: #fff;
 }
 .bigTick {
 	font-size: 72pt;
-	margin: 75px 0 10px 0;
+	line-height: 1.6em;
 }
 
 /*** NOTIFICATION ***/