]> git.wh0rd.org Git - tt-rss.git/commitdiff
disable some buttons in headline navbar
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 Aug 2005 09:54:21 +0000 (10:54 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 22 Aug 2005 09:54:21 +0000 (10:54 +0100)
backend.php
tt-rss.css

index c9ca89053e2c68e59c52ef7a797d2fa075f1fbf0..f862d540d685a6b2ba85512da914e12977ee0ab6 100644 (file)
                                OR content LIKE '%$search%') AND";
                }
 
+               $result = pg_query("SELECT count(id) AS total_entries 
+                       FROM ttrss_entries WHERE feed_id = '$feed'");
+
+               $total_entries = pg_fetch_result($result, 0, "total_entries");
+
                $result = pg_query("SELECT 
                                id,title,updated,unread,feed_id,
                                EXTRACT(EPOCH FROM last_read) AS last_read_ts,
                $prev_skip = $skip - HEADLINES_PER_PAGE;
        
                print "Navigate: ";
-               print "<a class=\"button\" 
-                       href=\"javascript:viewfeed($feed, $prev_skip);\">Previous Page</a>";
+
+               if ($prev_skip >= 0) {
+                       print "<a class=\"button\" 
+                               href=\"javascript:viewfeed($feed, $prev_skip);\">Previous Page</a>";
+               } else {
+                       print "<a class=\"disabledButton\">Previous Page</a>";
+               }
                print "&nbsp;";
-               print "<a class=\"button\" 
-                       href=\"javascript:viewfeed($feed, $next_skip);\">Next Page</a>";
+
+               if ($next_skip < $total_entries) {              
+                       print "<a class=\"button\" 
+                               href=\"javascript:viewfeed($feed, $next_skip);\">Next Page</a>";
+               } else {
+                       print "<a class=\"disabledButton\">Next Page</a>";
+               }                       
                print "&nbsp;";
                print "<a class=\"button\" 
                        href=\"javascript:viewfeed($feed, $skip, '');\">Refresh Page</a>";
index 31fe9488c2e74ecbd4c1fed2e847fffe384c3f1f..0da8b12294e08bc0c20b6a044e07ff0e9181dd43 100644 (file)
@@ -231,6 +231,20 @@ table.prefFeedList tr.title td {
        background-color : #c0c0c0;
 }
 
+a.disabledButton {
+       border : 1px solid #d0d0d0;
+       background-color : white;
+       color : #909090;        
+       padding : 2px 10px 2px 10px;
+       font-size : small;
+}
+
+a.disabledButton:hover {
+       background : white;
+       text-decoration : none;
+       color : #909090;
+}
+
 a.button {
        border : 1px solid #d0d0d0;
        background-image : url("button.png");