]> git.wh0rd.org - tt-rss.git/commitdiff
feed categories
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 23 Nov 2005 07:07:04 +0000 (08:07 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 23 Nov 2005 07:07:04 +0000 (08:07 +0100)
NEWS
backend.php
functions.js
prefs.js
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
tt-rss.css

diff --git a/NEWS b/NEWS
index b06ef3a59f18d61503e46f5d7000b8843869d577..2922fb8a173c1aea033657a2247e14431c117842 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ v1.1          (Dec xy, 2005)
        * Interactive user preferences editor
        * Per-feed content filters
        * Support for user stylesheets
+       * Feed categories
        
 v1.0.7 (Nov 14, 2005)
 
index 1dcfd4deb485b38053390e595db966a57d631c9b..f0ad0149950146e964f9682aa803757462fb4ac9 100644 (file)
 
                        /* virtual feeds */
 
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               print "<li class=\"feedCat\">Special</li>";
+                               print "<ul class=\"feedCatList\">";
+                       }
+
                        $result = db_query($link, "SELECT count(id) as num_starred 
                                FROM ttrss_entries,ttrss_user_entries 
                                WHERE marked = true AND 
                        printFeedEntry(-1, $class, "Starred articles", $num_starred, 
                                "images/mark_set.png", $link);
 
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               print "</ul>";
+                       }
+
                        if (get_pref($link, 'ENABLE_LABELS')) {
        
                                $result = db_query($link, "SELECT id,sql_exp,description FROM
                                        ttrss_labels WHERE owner_uid = '$owner_uid' ORDER by description");
                
                                if (db_num_rows($result) > 0) {
-                                       print "<li><hr></li>";
+                                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                                               print "<li class=\"feedCat\">Labels</li>";
+                                               print "<ul class=\"feedCatList\">";
+                                       } else {
+                                               print "<li><hr></li>";
+                                       }
                                }
                
                                while ($line = db_fetch_assoc($result)) {
                                                $class, $line["description"], $count, "images/label.png", $link);
                
                                }
+
+                               if (db_num_rows($result) > 0) {
+                                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                                               print "</ul>";
+                                       }
+                               }
+
+                       }
+
+//                     if (!get_pref($link, 'ENABLE_FEED_CATS')) {
+                               print "<li><hr></li>";
+//                     }
+
+                       if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                               $order_by_qpart = "category,title";
+                       } else {
+                               $order_by_qpart = "title";
                        }
-       
-                       print "<li><hr></li>";
 
                        $result = db_query($link, "SELECT *,
                                (SELECT count(id) FROM ttrss_entries,ttrss_user_entries
                                (SELECT count(id) FROM ttrss_entries,ttrss_user_entries
                                        WHERE feed_id = ttrss_feeds.id AND unread = true
                                                AND ttrss_user_entries.ref_id = ttrss_entries.id
-                                               AND owner_uid = '$owner_uid') as unread
-                               FROM ttrss_feeds WHERE owner_uid = '$owner_uid' ORDER BY title");                       
+                                               AND owner_uid = '$owner_uid') as unread,
+                               (SELECT title FROM ttrss_feed_categories 
+                                       WHERE id = cat_id) AS category
+                               FROM ttrss_feeds WHERE owner_uid = '$owner_uid' ORDER BY $order_by_qpart");                     
        
                        $actid = $_GET["actid"];
        
                        $lnum = 0;
        
                        $total_unread = 0;
+
+                       $category = "";
        
                        while ($line = db_fetch_assoc($result)) {
                        
                                
                                $total = $line["total"];
                                $unread = $line["unread"];
+
+                               $tmp_category = $line["category"];
+
+                               if (!$tmp_category) {
+                                       $tmp_category = "Uncategorized";
+                               }
                                
        //                      $class = ($lnum % 2) ? "even" : "odd";
        
                                }
        
                                $total_unread += $unread;
+
+                               if ($category != $tmp_category && get_pref($link, 'ENABLE_FEED_CATS')) {
+                               
+                                       if ($category) {
+                                               print "</li></ul></li>";
+                                       }
+                               
+                                       $category = $tmp_category;
+                                       
+                                       print "<li class=\"feedCat\">$category</li>";
+                                       print "<li><ul class=\"feedCatList\">";
+                               }
        
-                               printFeedEntry($feed_id, $class, $feed, $unread, "icons/$feed_id.ico", $link);
+                               printFeedEntry($feed_id, $class, $feed, $unread, 
+                                       "icons/$feed_id.ico", $link);
        
                                ++$lnum;
                        }
+
                } else {
 
                        // tags
                        $feed_link = db_escape_string($_GET["l"]);
                        $upd_intl = db_escape_string($_GET["ui"]);
                        $purge_intl = db_escape_string($_GET["pi"]);
-                       $feed_id = $_GET["id"];
+                       $feed_id = db_escape_string($_GET["id"]);
+                       $cat_id = db_escape_string($_GET["catid"]);
 
                        if (strtoupper($upd_intl) == "DEFAULT")
                                $upd_intl = 0;
                        if (strtoupper($purge_intl) == "DISABLED")
                                $purge_intl = -1;
 
+                       if ($cat_id != 0) {
+                               $category_qpart = "cat_id = '$cat_id'";
+                       } else {
+                               $category_qpart = 'cat_id = NULL';
+                       }
+
                        $result = db_query($link, "UPDATE ttrss_feeds SET 
+                               $category_qpart,
                                title = '$feed_title', feed_url = '$feed_link',
                                update_interval = '$upd_intl',
-                               purge_interval = '$purge_intl' 
+                               purge_interval = '$purge_intl'
                                WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);                    
 
                }
                        }
                }
 
+               if ($subop == "addCat") {
+
+                       if (!WEB_DEMO_MODE) {
+
+                               $feed_cat = db_escape_string(trim($_GET["cat"]));
+
+                               $result = db_query($link,
+                                       "SELECT id FROM ttrss_feed_categories
+                                       WHERE title = '$feed_cat' AND owner_uid = ".$_SESSION["uid"]);
+
+                               if (db_num_rows($result) == 0) {
+                                       
+                                       $result = db_query($link,
+                                               "INSERT INTO ttrss_feed_categories (owner_uid,title) 
+                                               VALUES ('".$_SESSION["uid"]."', '$feed_cat')");
+
+                               } else {
+
+                                       print "<div class=\"warning\">
+                                               Category <b>$feed_cat</b> already exists in the database.
+                                       </div>";
+                               }
+
+
+                       }
+               }
+
+               if ($subop == "removeCats") {
+
+                       if (!WEB_DEMO_MODE) {
+
+                               $ids = split(",", $_GET["ids"]);
+
+                               foreach ($ids as $id) {
+
+                                       db_query($link, "BEGIN");
+
+                                       $result = db_query($link, 
+                                               "SELECT count(id) as num_feeds FROM ttrss_feeds 
+                                                       WHERE cat_id = '$id'");
+
+                                       $num_feeds = db_fetch_result($result, 0, "num_feeds");
+
+                                       if ($num_feeds == 0) {
+                                               db_query($link, "DELETE FROM ttrss_feed_categories
+                                                       WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+                                       } else {
+
+                                               print "<div class=\"warning\">
+                                                       Unable to delete non empty feed categories.</div>";
+                                                       
+                                       }
+
+                                       db_query($link, "COMMIT");
+                               }
+                       }
+               }
+
                $result = db_query($link, "SELECT id,title,feed_url,last_error 
                        FROM ttrss_feeds WHERE last_error != '' AND owner_uid = ".$_SESSION["uid"]);
 
 
                }
 
+               if (get_pref($link, 'ENABLE_FEED_CATS')) {
+
+       //              print "<h3>Categories</h3>";
+
+                       print "<div class=\"prefGenericAddBox\">
+                               <input id=\"fadd_cat\" size=\"40\">&nbsp;<input 
+                                       type=\"submit\" class=\"button\" 
+                                       onclick=\"javascript:addFeedCat()\" value=\"Add category\"></div>";
+       
+                       $result = db_query($link, "SELECT title,id FROM ttrss_feed_categories
+                               WHERE owner_uid = ".$_SESSION["uid"]."
+                               ORDER BY title");
+       
+                       print "<p><table width=\"100%\" class=\"prefFeedCatList\" id=\"prefFeedCatList\">";
+                       print "<tr class=\"title\">
+                                               <td width=\"10%\">Select</td><td width=\"80%\">Title</td>
+                                       </tr>";
+                                       
+                       $lnum = 0;
+                       
+                       while ($line = db_fetch_assoc($result)) {
+       
+                               $class = ($lnum % 2) ? "even" : "odd";
+       
+                               $cat_id = $line["id"];
+       
+                               $edit_cat_id = $_GET["id"];
+       
+                               if ($subop == "editCat" && $cat_id != $edit_cat_id) {
+                                       $class .= "Grayed";
+                               }
+       
+                               print "<tr class=\"$class\" id=\"FCATR-$cat_id\">";
+       
+                               $edit_title = htmlspecialchars(db_unescape_string($line["title"]));
+       
+                               if (!$edit_cat_id || $subop != "editCat") {
+       
+                                       print "<td><input onclick='toggleSelectRow(this);' 
+                                       type=\"checkbox\" id=\"FCCHK-".$line["id"]."\"></td>";
+       
+                                       print "<td><a href=\"javascript:editFeedCat($cat_id);\">" . 
+                                               $edit_title . "</a></td>";              
+       
+                               } else if ($cat_id != $edit_cat_id) {
+       
+                                       print "<td><input disabled=\"true\" type=\"checkbox\" 
+                                               id=\"FRCHK-".$line["id"]."\"></td>";
+       
+                                       print "<td>$edit_title</td>";           
+       
+                               } else {
+       
+                                       print "<td><input disabled=\"true\" type=\"checkbox\" checked></td>";
+       
+                                       print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
+                                       
+                               }
+                               
+                               print "</tr>";
+       
+                               ++$lnum;
+                       }
+       
+                       if ($lnum == 0) {
+                               print "<tr><td colspan=\"5\" align=\"center\">No categories defined.</td></tr>";
+                       }
+       
+                       print "</table>";
+       
+                       print "<p>";
+       
+                       if ($subop == "editCat") {
+                               print "Edit category:&nbsp;
+                                       <input type=\"submit\" class=\"button\" 
+                                               onclick=\"javascript:feedCatEditCancel()\" value=\"Cancel\">
+                                       <input type=\"submit\" class=\"button\" 
+                                               onclick=\"javascript:feedCatEditSave()\" value=\"Save\">";
+                               } else {
+       
+                               print "
+                                       Selection:&nbsp;
+                               <input type=\"submit\" class=\"button\" 
+                                       onclick=\"javascript:editSelectedFeedCat()\" value=\"Edit\">
+                               <input type=\"submit\" class=\"button\" 
+                                       onclick=\"javascript:removeSelectedFeedCats()\" value=\"Remove\">";
+                       }
+               }
+
+//             print "<h3>Feeds</h3>";
+
+               print "<hr><p>";
+
                print "<div class=\"prefGenericAddBox\">
                        <input id=\"fadd_link\" size=\"40\">&nbsp;<input 
                                type=\"submit\" class=\"button\" 
 
                $result = db_query($link, "SELECT 
                                id,title,feed_url,substring(last_updated,1,16) as last_updated,
-                               update_interval,purge_interval
+                               update_interval,purge_interval,
+                               (SELECT title FROM ttrss_feed_categories 
+                                       WHERE id = cat_id) AS category
                        FROM 
                                ttrss_feeds WHERE owner_uid = '".$_SESSION["uid"]."' ORDER by title");
 
 
                print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
                print "<tr class=\"title\">
-                                       <td>&nbsp;</td><td>Select</td><td width=\"30%\">Title</td>
-                                       <td width=\"30%\">Link</td>
-                                       <td width=\"10%\">Update Interval</td>
+                                       <td>&nbsp;</td><td>Select</td><td width=\"20%\">Title</td>
+                                       <td width=\"20%\">Link</td>";
+
+               if (get_pref($link, 'ENABLE_FEED_CATS')) {
+                       print "<td width=\"10%\">Category</td>";
+               }
+               
+               print "<td width=\"10%\">Update Interval</td>
                                        <td width=\"10%\">Purge Days</td>
                                        <td>Last updated</td></tr>";
                
 
                        $edit_title = htmlspecialchars(db_unescape_string($line["title"]));
                        $edit_link = htmlspecialchars(db_unescape_string($line["feed_url"]));
+                       $edit_cat = htmlspecialchars(db_unescape_string($line["category"]));
+
+                       if (!$edit_cat) $edit_cat = "Uncategorized";
 
                        if (!$edit_feed_id || $subop != "edit") {
 
 
                                print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
                                        $edit_title . "</a></td>";              
+                                       
                                print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
                                        $edit_link . "</a></td>";               
 
+                               print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
+                                       $edit_cat . "</a></td>";                
+
                                if ($line["update_interval"] == "0")
                                        $line["update_interval"] = "Default";
 
 
                                print "<td>$edit_title</td>";           
                                print "<td>$edit_link</td>";            
+                               print "<td>$edit_cat</td>";             
 
                                if ($line["update_interval"] == "0")
                                        $line["update_interval"] = "Default";
 
                                print "<td><input id=\"iedit_title\" value=\"$edit_title\"></td>";
                                print "<td><input id=\"iedit_link\" value=\"$edit_link\"></td>";
-                               print "<td><input id=\"iedit_updintl\" value=\"".$line["update_interval"]."\"></td>";
-                               print "<td><input id=\"iedit_purgintl\" value=\"".$line["purge_interval"]."\"></td>";
+
+                               print "<td>";
+                               
+                               print "<select id=\"iedit_fcat\">";
+
+                               print "<option id=\"0\">Uncategorized</option>";
+
+                               if (db_num_rows($result) > 0) {
+                                       print "<option disabled>--------</option>";
+                               }
+
+                               $tmp_result = db_query($link, "SELECT id,title FROM ttrss_feed_categories
+                                       WHERE owner_uid = ".$_SESSION["uid"]." ORDER BY title");
+
+                               while ($tmp_line = db_fetch_assoc($tmp_result)) {
+                                       if ($tmp_line["id"] == $line["cat_id"]) {
+                                               $is_selected = "selected";
+                                       } else {
+                                               $is_selected = "";
+                                       }
+                                       printf("<option $is_selected id='%d'>%s</option>", 
+                                               $tmp_line["id"], $tmp_line["title"]);
+                               }
+
+                               print "</select></td>";
+                       
+                               print "</td>";
+                               
+                               print "<td><input id=\"iedit_updintl\" 
+                                       value=\"".$line["update_interval"]."\"></td>";
+                               print "<td><input id=\"iedit_purgintl\" 
+                                       value=\"".$line["purge_interval"]."\"></td>";
                                        
                        }
 
index c4d79e51779deb8aea71a5b29bd13eec45cdf07c..c7f1b8a64860517a35a21523c97c613907a4df13 100644 (file)
@@ -415,3 +415,27 @@ function fatalError(code) {
        window.location = "error.php?c=" + param_escape(code);
 
 }
+
+function getSelectedTableRowIds(content_id, prefix) {
+
+       var content = document.getElementById(content_id);
+
+       if (!content) {
+               alert("[getSelectedTableRowIds] Element " + content_id + " not found.");
+               return;
+       }
+
+       var sel_rows = new Array();
+
+       for (i = 0; i < content.rows.length; i++) {
+               if (content.rows[i].className.match("Selected")) {
+                       var row_id = content.rows[i].id.replace(prefix + "-", "");
+                       sel_rows.push(row_id);  
+               }
+       }
+
+       return sel_rows;
+
+}
+
+
index aa1e6aeeeeb5313e1c7fa6e47cdd8ea3a846dd58..846f6825fdc774504100fd7dd1c013bf70fafe50 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -6,6 +6,7 @@
 var xmlhttp = false;
 
 var active_feed = false;
+var active_feed_cat = false;
 var active_filter = false;
 var active_label = false;
 var active_user = false;
@@ -295,6 +296,30 @@ function addFeed() {
 
 }
 
+function addFeedCat() {
+
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       var cat = document.getElementById("fadd_cat");
+
+       if (cat.value.length == 0) {
+               notify("Missing feed category.");
+       } else {
+               notify("Adding feed category...");
+
+               xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=addCat&cat=" +
+                       param_escape(cat.value), true);
+               xmlhttp.onreadystatechange=feedlist_callback;
+               xmlhttp.send(null);
+
+               link.value = "";
+
+       }
+
+}
 function addUser() {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -386,71 +411,43 @@ function editFeed(feed) {
 
 }
 
-function getSelectedLabels() {
-
-       var content = document.getElementById("prefLabelList");
-
-       var sel_rows = new Array();
+function editFeedCat(cat) {
 
-       for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].className.match("Selected")) {
-                       var row_id = content.rows[i].id.replace("LILRR-", "");
-                       sel_rows.push(row_id);  
-               }
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
        }
 
-       return sel_rows;
-}
-
-function getSelectedUsers() {
-
-       var content = document.getElementById("prefUserList");
+       active_feed_cat = cat;
 
-       var sel_rows = new Array();
-
-       for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].className.match("Selected")) {
-                       var row_id = content.rows[i].id.replace("UMRR-", "");
-                       sel_rows.push(row_id);  
-               }
-       }
+       xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editCat&id=" +
+               param_escape(cat), true);
+       xmlhttp.onreadystatechange=feedlist_callback;
+       xmlhttp.send(null);
 
-       return sel_rows;
 }
 
+function getSelectedLabels() {
+       return getSelectedTableRowIds("prefLabelList", "LILRR");
+}
 
-function getSelectedFilters() {
-
-       var content = document.getElementById("prefFilterList");
-
-       var sel_rows = new Array();
-
-       for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].className.match("Selected")) {
-                       var row_id = content.rows[i].id.replace("FILRR-", "");
-                       sel_rows.push(row_id);  
-               }
-       }
-
-       return sel_rows;
+function getSelectedUsers() {
+       return getSelectedTableRowIds("prefUserList", "UMRR");
 }
 
 function getSelectedFeeds() {
+       return getSelectedTableRowIds("prefFeedList", "FEEDR");
+}
 
-       var content = document.getElementById("prefFeedList");
-
-       var sel_rows = new Array();
-
-       for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].className.match("Selected")) {
-                       var row_id = content.rows[i].id.replace("FEEDR-", "");
-                       sel_rows.push(row_id);  
-               }
-       }
+function getSelectedFilters() {
+       return getSelectedTableRowIds("prefFilterList", "FILRR");
+}
 
-       return sel_rows;
+function getSelectedFeedCats() {
+       return getSelectedTableRowIds("prefFeedCatList", "FCATR");
 }
 
+
 function readSelectedFeeds() {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -597,6 +594,32 @@ function removeSelectedFeeds() {
 
 }
 
+function removeSelectedFeedCats() {
+
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       var sel_rows = getSelectedFeedCats();
+
+       if (sel_rows.length > 0) {
+
+               notify("Removing selected categories...");
+
+               xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=removeCats&ids="+
+                       param_escape(sel_rows.toString()), true);
+               xmlhttp.onreadystatechange=feedlist_callback;
+               xmlhttp.send(null);
+
+       } else {
+
+               notify("Please select some feeds first.");
+
+       }
+
+}
+
 function feedEditCancel() {
 
        if (!xmlhttp_ready(xmlhttp)) {
@@ -614,6 +637,23 @@ function feedEditCancel() {
 
 }
 
+function feedCatEditCancel() {
+
+       if (!xmlhttp_ready(xmlhttp)) {
+               printLockingError();
+               return
+       }
+
+       active_feed_cat = false;
+
+       notify("Operation cancelled.");
+
+       xmlhttp.open("GET", "backend.php?op=pref-feeds", true);
+       xmlhttp.onreadystatechange=feedlist_callback;
+       xmlhttp.send(null);
+
+}
+
 function feedEditSave() {
 
        var feed = active_feed;
@@ -627,6 +667,9 @@ function feedEditSave() {
        var title = document.getElementById("iedit_title").value;
        var upd_intl = document.getElementById("iedit_updintl").value;
        var purge_intl = document.getElementById("iedit_purgintl").value;
+       var fcat = document.getElementById("iedit_fcat");
+
+       var fcat_id = fcat[fcat.selectedIndex].id;
 
 //     notify("Saving feed.");
 
@@ -656,7 +699,8 @@ function feedEditSave() {
 
        xmlhttp.open("GET", "backend.php?op=pref-feeds&subop=editSave&id=" +
                feed + "&l=" + param_escape(link) + "&t=" + param_escape(title) +
-               "&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl), true);
+               "&ui=" + param_escape(upd_intl) + "&pi=" + param_escape(purge_intl) +
+               "&catid=" + param_escape(fcat_id), true);
        xmlhttp.onreadystatechange=feedlist_callback;
        xmlhttp.send(null);
 
@@ -982,6 +1026,25 @@ function editSelectedFeed() {
 
 }
 
+function editSelectedFeedCat() {
+       var rows = getSelectedFeedCats();
+
+       if (rows.length == 0) {
+               notify("No categories are selected.");
+               return;
+       }
+
+       if (rows.length > 1) {
+               notify("Please select one category.");
+               return;
+       }
+
+       notify("");
+
+       editFeedCat(rows[0]);
+
+}
+
 function localPiggieFunction(enable) {
        if (enable) {
                piggie.style.display = "block";
index 7209b0c627e9bcbf2b05a1c4838cee8772029884..88c1f7afa4ac11bde770dc4b75050acf7be93b9a 100644 (file)
@@ -202,7 +202,7 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('USER_STYLESHEET_URL', 2, '', 'User stylesheet URL',2,
        'Link to user stylesheet to override default style, disabled if empty.');
 
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',2);
 
 
 create table ttrss_user_prefs (
index 9bfdb171a3aea407ee7da3c9d28494ae8fa49af9..86dde5fca5ef55c9976e613feeb1b4505eb57856 100644 (file)
@@ -186,7 +186,7 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('USER_STYLESHEET_URL', 2, '', 'User stylesheet URL',2,
        'Link to user stylesheet to override default style, disabled if empty.');
 
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',2);
 
 create table ttrss_user_prefs (
        owner_uid integer not null references ttrss_users(id) on delete cascade,
index 56a63a5654aa88fca49bb25cff644241d6162ee8..43851439e63e95e4f3b42412757fb22d2e871327 100644 (file)
@@ -134,12 +134,32 @@ div.postReply div.postIcon {
 
 ul.feedList {
        list-style-type : none;
+       margin : 5px;
+       padding : 0px 0px 0px 10px;
+}
+
+ul.feedList li.feedCat {
        margin : 0px;
-       padding : 10px; 
+       padding : 3px 0px 3px 0px;
+/*     border-width : 0px 0px 1px 0px;
+       border-color : #f0f0f0;
+       border-style : solid; */
+       color : #707070;
+}
+
+ul.feedCatList {
+       list-style-type : none;
+       margin : 0px;
+       padding : 0px 0px 0px 10px;     
+}
+
+ul.feedCatList li {
+       margin : 0px;
+       padding : 0px 0px 0px 0px;
 }
 
 ul.feedList li {
-       margin : 2px;
+       margin : 0px;
 }
 
 li.oddSelected, li.evenSelected {
@@ -245,7 +265,8 @@ a:hover {
 }
 
 #iedit_title, #iedit_link, #iedit_regexp, #iedit_descr, #iedit_expr, #iedit_updintl,
-#iedit_purgintl, #iedit_ulogin, #iedit_ulevel, #iedit_match, #iedit_feed {
+#iedit_purgintl, #iedit_ulogin, #iedit_ulevel, #iedit_match, #iedit_feed,
+#iedit_fcat {
        width : 100%;
        padding-left : 2px;
 }
@@ -393,7 +414,8 @@ input {
 
 table.prefFeedList tr.title td, table.prefFilterList tr.title td,
        table.headlinesList tr.title td, table.prefLabelList tr.title td,
-       table.prefPrefsList tr.title td {
+       table.prefPrefsList tr.title td, 
+       table.prefFeedCatList tr.title td {
        font-weight : bold;
        border-width : 0px 0px 1px 0px;
        border-color : #f0f0f0;