From: Andrew Dolgov Date: Fri, 16 Dec 2005 17:35:04 +0000 (+0100) Subject: mark feeds with update errors in feedlist (closes #8) X-Git-Tag: schema_freeze_for_1.1.1~31 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=023fe0377d698287c25e59da0f282b108957540e;p=tt-rss.git mark feeds with update errors in feedlist (closes #8) --- diff --git a/backend.php b/backend.php index 8652a1c4..974eb0a7 100644 --- a/backend.php +++ b/backend.php @@ -55,6 +55,8 @@ $fetch = $_GET["fetch"]; + setcookie("ttrss_icons_url", ICONS_URL); + function getAllCounters($link) { getLabelCounters($link); getFeedCounters($link); @@ -264,6 +266,8 @@ $count = $line["count"]; $last_error = $line["last_error"]; + $has_img = is_file(ICONS_DIR . "/$id.ico"); + if (!$smart_mode || $old_counters[$id] != $count) { $old_counters[$id] = $count; $fctrs_modified = true; @@ -273,8 +277,14 @@ } else { $error_part = ""; } - - print ""; + + if ($has_img) { + $has_img_part = "hi=\"$has_img\""; + } else { + $has_img_part = ""; + } + + print ""; } } @@ -407,7 +417,7 @@ AND owner_uid = '$owner_uid') as unread, (SELECT title FROM ttrss_feed_categories WHERE id = cat_id) AS category, - cat_id, + cat_id,last_error, (SELECT collapsed FROM ttrss_feed_categories WHERE id = cat_id) AS collapsed FROM ttrss_feeds WHERE owner_uid = '$owner_uid' ORDER BY $order_by_qpart"); @@ -441,8 +451,12 @@ } // $class = ($lnum % 2) ? "even" : "odd"; - - $class = "feed"; + + if ($line["last_error"]) { + $class = "error"; + } else { + $class = "feed"; + } if ($unread > 0) $class .= "Unread"; diff --git a/functions.js b/functions.js index 53cee530..9193d9b7 100644 --- a/functions.js +++ b/functions.js @@ -361,6 +361,8 @@ function parse_counters(reply, f_document) { var id = reply.childNodes[l].getAttribute("id"); var t = reply.childNodes[l].getAttribute("type"); var ctr = reply.childNodes[l].getAttribute("counter"); + var error = reply.childNodes[l].getAttribute("error"); + var has_img = reply.childNodes[l].getAttribute("hi"); if (id == "global-unread") { parent.global_unread = ctr; @@ -379,10 +381,25 @@ function parse_counters(reply, f_document) { var feedctr = f_document.getElementById("FEEDCTR-" + id); var feedu = f_document.getElementById("FEEDU-" + id); var feedr = f_document.getElementById("FEEDR-" + id); - + var feed_img = f_document.getElementById("FIMG-" + id); + if (feedctr && feedu && feedr) { feedu.innerHTML = ctr; + + if (has_img && feed_img) { + if (error) { +// feed_img.src = "images/update_error.png"; + feedr.className = feedr.className.replace("feed", "error"); + } else if (id > 0) { + feedr.className = feedr.className.replace("error", "feed"); +// if (has_img) { +// feed_img.src = getCookie("ttrss_icons_url") + "/" + id + ".ico"; +// } else { +// feed_img.src = "images/blank_icon.gif"; +// } + } + } if (ctr > 0) { feedctr.className = "odd"; diff --git a/functions.php b/functions.php index 5a4683bf..78238a06 100644 --- a/functions.php +++ b/functions.php @@ -596,9 +596,9 @@ function printFeedEntry($feed_id, $class, $feed_title, $unread, $icon_file, $link) { if (file_exists($icon_file) && filesize($icon_file) > 0) { - $feed_icon = ""; + $feed_icon = ""; } else { - $feed_icon = ""; + $feed_icon = ""; } $feed = "$feed_title"; diff --git a/tt-rss.css b/tt-rss.css index 577acbe7..55795e81 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -217,12 +217,18 @@ ul.feedlist } */ ul.feedlist li.feedUnread, +ul.feedlist li.errorUnread, ul.feedlist li.labelUnread, ul.feedlist li.virtUnread, ul.feedlist li.tagUnread { font-weight : bold; } +ul.feedlist li.errorSelected a, +ul.feedlist li.errorUnread a, +ul.feedlist li.errorUnreadSelected a { + color : #f04040; +} ul.feedlist li.feedSelected a, ul.feedlist li.labelSelected a, @@ -238,7 +244,8 @@ ul.feedlist li.tagUnreadSelected a { color : #5050aa; } -ul.feedlist li.feedUnreadSelected , +ul.feedlist li.feedUnreadSelected, +ul.feedlist li.errorUnreadSelected, ul.feedlist li.labelUnreadSelected, ul.feedlist li.virtUnreadSelected, ul.feedlist li.tagUnreadSelected {