]> git.wh0rd.org - tt-rss.git/commitdiff
tweak feed errors notification
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 1 Dec 2006 06:26:05 +0000 (07:26 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 1 Dec 2006 06:26:05 +0000 (07:26 +0100)
modules/popup-dialog.php
modules/pref-feeds.php
prefs.js
tt-rss.css

index 02282f46b087ed4c16a05a14a7beb63fb3682124..d3933ae77ae26f565db881eab1bb20cab2ff46a6 100644 (file)
 
                }
 
+               if ($id == "feedUpdateErrors") {
+
+                       print "<div id=\"infoBoxTitle\">Update Errors</div>";
+                       print "<div class=\"infoBoxContents\">";
+
+                       print "These feeds have not been updated because of errors:";
+
+                       $result = db_query($link, "SELECT id,title,feed_url,last_error
+                       FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
+
+                       print "<ul class='nomarks'>";
+
+                       while ($line = db_fetch_assoc($result)) {
+                               print "<li><b>" . $line["title"] . "</b> (" . $line["feed_url"] . "): " . 
+                                       "<em>" . $line["last_error"] . "</em>";
+                       }
+
+                       print "</ul>";
+                       print "</div>";
+
+                       print "<div align='center'>";
+
+                       print "<input class=\"button\"
+                               type=\"submit\" onclick=\"return closeInfoBox()\" 
+                               value=\"Close\">";
+
+                       print "</div>";
+
+               }
+
                print "</div>";
        }
 ?>
index af8fd09362028c9305f6f64b67295489ff89f99d..0572978dd6872cfc7cb7439838d349948decd5fe 100644 (file)
 
                if ($quiet) return;
 
-//             print "<h3>Edit Feeds</h3>";
-
-               $result = db_query($link, "SELECT id,title,feed_url,last_error
+               $result = db_query($link, "SELECT COUNT(id) AS num_errors
                        FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
 
-               if (db_num_rows($result) > 0) {
-               
-                       print "<div class=\"warning\">";
-                       
-//                     print"<img class=\"closeButton\" 
-//                             onclick=\"javascript:hideParentElement(this);\" src=\"images/close.png\">";
-       
-                       print "<a href=\"javascript:showBlockElement('feedUpdateErrors')\">
-                               <b>Some feeds have update errors (click for details)</b></a>";
-
-                       print "<ul id=\"feedUpdateErrors\" class=\"nomarks\">";
-                                               
-                       while ($line = db_fetch_assoc($result)) {
-                               print "<li>" . $line["title"] . " (" . $line["feed_url"] . "): " . 
-                                       $line["last_error"];
-                       }
+               $num_errors = db_fetch_result($result, 0, "num_errors");
 
-                       print "</ul>";
-                       print "</div>";
+               if ($num_errors > 0) {
 
+                       print "<a href=\"javascript:showFeedsWithErrors()\" 
+                               class=\"feedUpdErrLink\">Some feeds have update errors (click 
+                               for details)</a>";
                }
 
                $feed_search = db_escape_string($_GET["search"]);
index 85ae91afc92da8ffba0d1123d2c787a8b6a2bec8..6b772b1cddd7b0a035c95ee5a99d2dff536c4568 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1544,3 +1544,7 @@ function editFeedCats() {
        xmlhttp.onreadystatechange=infobox_callback;
        xmlhttp.send(null);
 }
+
+function showFeedsWithErrors() {
+       displayDlg('feedUpdateErrors');
+}
index 3459ac386dbe495b2d5e1e7f3903308c3cc2957c..fa99ebfe03f8bcd167788ea33a187ed14f8e2c5a 100644 (file)
@@ -1307,3 +1307,9 @@ div.return a:hover {
        bottom : 2px;
        right : 2px;
 }
+
+a.feedUpdErrLink {
+       color : #ff0000;
+       display : block;
+       margin-bottom : 0.5em;
+}