]> git.wh0rd.org Git - tt-rss.git/commitdiff
improve output when EXTENDED_FEEDLIST is set, font size tweaks
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 20 May 2008 06:37:33 +0000 (07:37 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 20 May 2008 06:37:33 +0000 (07:37 +0100)
functions.js
functions.php
tt-rss.css

index c66993c2a069ad47cce3ff5e26fc999dc870eae5..99d267f918261a26aa8a313af796bfa90c6393d9 100644 (file)
@@ -475,7 +475,8 @@ function parse_counters(reply, scheduled_call) {
                        var has_img = elems[l].getAttribute("hi");
                        var updated = elems[l].getAttribute("updated");
                        var title = elems[l].getAttribute("title");
-               
+                       var xmsg = elems[l].getAttribute("xmsg");
+       
                        if (id == "global-unread") {
                                global_unread = ctr;
                                updateTitle();
@@ -515,11 +516,21 @@ function parse_counters(reply, scheduled_call) {
                                }
                        }
 
-                       if (updated && feedupd) {
+                       if (feedupd) {
+                               if (!updated) updated = "";
+
                                if (error) {
-                                       feedupd.innerHTML = updated + " (Error)";
+                                       if (xmsg) {
+                                               feedupd.innerHTML = updated + " " + xmsg + " (Error)";
+                                       } else {
+                                               feedupd.innerHTML = updated + " (Error)";
+                                       }
                                } else {
-                                       feedupd.innerHTML = updated;
+                                       if (xmsg) {
+                                               feedupd.innerHTML = updated + " " + xmsg;
+                                       } else {
+                                               feedupd.innerHTML = updated;
+                                       }
                                }
                        }
 
index 48caab0613559c4747673b5c2059505c6771545e..5d49668655a7bf1e325f057a64953e345704a51e 100644 (file)
                         (<span id=\"FEEDU-$feed_id\">$unread</span>)</span>";
 
                if (get_pref($link, "EXTENDED_FEEDLIST")) {                      
+                       $total = getFeedArticles($link, $feed_id);
                        print "<div class=\"feedExtInfo\">
-                               <span id=\"FLUPD-$feed_id\">$last_updated $error_notify_msg</span></div>";
+                               <span id=\"FLUPD-$feed_id\">$last_updated ($total total) $error_notify_msg</span></div>";
                }
                         
                print "</li>";
        }
 
        function getFeedUnread($link, $feed, $is_cat = false) {
+               return getFeedArticles($link, $feed, $is_cat, true);
+       }
+
+       function getFeedArticles($link, $feed, $is_cat = false, $unread_only = false) {
                $n_feed = sprintf("%d", $feed);
 
+               if ($unread_only) {
+                       $unread_qpart = "unread = true";
+               } else {
+                       $unread_qpart = "true";
+               }
+
                $age_qpart = getMaxAgeSubquery();
 
                if ($is_cat) {
 
                                $result = db_query($link, "SELECT COUNT(int_id) AS unread 
                                        FROM ttrss_user_entries,ttrss_entries
-                                       WHERE   unread = true AND
+                                       WHERE   $unread_qpart AND
                                        ttrss_user_entries.ref_id = ttrss_entries.id AND
                                        $age_qpart AND
                                        ($match_part) AND
                                ttrss_user_entries.ref_id = ttrss_entries.id AND 
                                ttrss_feeds.hidden = false AND
                                $age_qpart AND
-                               unread = true AND ($match_part) AND ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
+                               $unread_qpart AND ($match_part) AND ttrss_user_entries.owner_uid = " . $_SESSION["uid"]);
                                
                } else {
                
                        $result = db_query($link, "SELECT COUNT(post_int_id) AS unread
                                FROM ttrss_tags,ttrss_user_entries,ttrss_entries 
                                WHERE tag_name = '$feed' AND post_int_id = int_id AND ref_id = ttrss_entries.id 
-                               AND unread = true AND $age_qpart AND
+                               AND $unread_qpart AND $age_qpart AND
                                        ttrss_tags.owner_uid = " . $_SESSION["uid"]);
                }
                
                $count = getFeedUnread($link, -1);
 
                if (!$ret_mode) {
-                       print "<counter type=\"label\" id=\"-1\" counter=\"$count\"/>";
+
+                       if (get_pref($link, 'EXTENDED_FEEDLIST')) {
+                               $xmsg_part = "xmsg=\"(" . getFeedArticles($link, $id) . " total)\"";
+                       } else {
+                               $xmsg_part = "";
+                       }
+
+                       print "<counter type=\"label\" id=\"-1\" counter=\"$count\" $xmsg_part/>";
                } else {
                        $ret_arr["-1"]["counter"] = $count;
                        $ret_arr["-1"]["description"] = __("Starred articles");
                $count = getFeedUnread($link, -2);
 
                if (!$ret_mode) {
-                       print "<counter type=\"label\" id=\"-2\" counter=\"$count\"/>";
+
+                       if (get_pref($link, 'EXTENDED_FEEDLIST')) {
+                               $xmsg_part = "xmsg=\"(" . getFeedArticles($link, $id) . " total)\"";
+                       } else {
+                               $xmsg_part = "";
+                       }
+
+                       print "<counter type=\"label\" id=\"-2\" counter=\"$count\" $xmsg_part/>";
                } else {
                        $ret_arr["-2"]["counter"] = $count;
                        $ret_arr["-2"]["description"] = __("Published articles");
                $count = getFeedUnread($link, -3);
 
                if (!$ret_mode) {
-                       print "<counter type=\"label\" id=\"-3\" counter=\"$count\"/>";
+
+                       if (get_pref($link, 'EXTENDED_FEEDLIST')) {
+                               $xmsg_part = "xmsg=\"(" . getFeedArticles($link, $id) . " total)\"";
+                       } else {
+                               $xmsg_part = "";
+                       }
+
+                       print "<counter type=\"label\" id=\"-3\" counter=\"$count\" $xmsg_part/>";
                } else {
                        $ret_arr["-3"]["counter"] = $count;
                        $ret_arr["-3"]["description"] = __("Fresh articles");
                                $old_counters[$id] = $count;
                                $lctrs_modified = true;
                                if (!$ret_mode) {
-                                       print "<counter type=\"label\" id=\"$id\" counter=\"$count\"/>";
+
+                                       if (get_pref($link, 'EXTENDED_FEEDLIST')) {
+                                               $xmsg_part = "xmsg=\"(" . getFeedArticles($link, $id) . " total)\"";
+                                       } else {
+                                               $xmsg_part = "";
+                                       }
+
+                                       print "<counter type=\"label\" id=\"$id\" counter=\"$count\" $xmsg_part/>";
                                } else {
                                        $ret_arr[$id]["counter"] = $count;
                                        $ret_arr[$id]["description"] = $label_name;
                                        $has_title_part = "";
                                }
 
-                               print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" $has_img_part $error_part updated=\"$last_updated\" $has_title_part/>";
+                               if (get_pref($link, 'EXTENDED_FEEDLIST')) {
+                                       $xmsg_part = "xmsg=\"(" . getFeedArticles($link, $id) . " total)\"";
+                               }
+
+                               print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" $has_img_part $error_part updated=\"$last_updated\" $xmsg_part $has_title_part/>";
                        }
                }
 
index 2582811c86ff86ba4ce33c41266b70a5fc2ba487..a37e6870a814d8cb90dc0a41f8c66610354363cf 100644 (file)
@@ -83,7 +83,7 @@ ul.feedList li.feedCat {
        margin : 0px;
        padding : 3px 0px 3px 0px;
        color : #707070;
-       font-size : 11px;
+       font-size : 12px;
 }
 
 ul.feedList li.feedCat a {
@@ -278,7 +278,7 @@ input.editbox {
 }
 
 #dispSwitch {
-       font-size : 11px;
+       font-size : 12px;
        font-family : "Lucida Grande", Tahoma, Arial, sans-serif;
        text-align : right;
        float : right;