summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-08-22 10:54:21 +0100
committerAndrew Dolgov <[email protected]>2005-08-22 10:54:21 +0100
commite6d1c0a06a904a5fead7271cb6a1e152439fe22e (patch)
treeb317be4cd432f7508bb30f8bb926987a41bd775a
parent71500c400cb6a5a7478fe5b4e31c60bf3c80b90e (diff)
disable some buttons in headline navbar
-rw-r--r--backend.php23
-rw-r--r--tt-rss.css14
2 files changed, 33 insertions, 4 deletions
diff --git a/backend.php b/backend.php
index c9ca89053..f862d540d 100644
--- a/backend.php
+++ b/backend.php
@@ -162,6 +162,11 @@
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,
@@ -216,11 +221,21 @@
$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>";
diff --git a/tt-rss.css b/tt-rss.css
index 31fe9488c..0da8b1229 100644
--- a/tt-rss.css
+++ b/tt-rss.css
@@ -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");