]> git.wh0rd.org - tt-rss.git/commitdiff
make disabled filter rules easier to discern
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 17 Aug 2015 09:33:07 +0000 (12:33 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 17 Aug 2015 09:33:07 +0000 (12:33 +0300)
show if filter set match_any_rule on the overview

classes/pref/filters.php
css/dijit.css
js/PrefFilterTree.js

index efa82afc2ee187ff8dea7c57b0a407cf80b46e0e..a371fcff49ecbff010d6115bf60d0edead940448 100644 (file)
@@ -1070,20 +1070,22 @@ class Pref_Filters extends Handler_Protected {
        private function getFilterName($id) {
 
                $result = $this->dbh->query(
-                       "SELECT title,COUNT(DISTINCT r.id) AS num_rules,COUNT(DISTINCT a.id) AS num_actions
+                       "SELECT title,match_any_rule,COUNT(DISTINCT r.id) AS num_rules,COUNT(DISTINCT a.id) AS num_actions
                                FROM ttrss_filters2 AS f LEFT JOIN ttrss_filters2_rules AS r
                                        ON (r.filter_id = f.id)
                                                LEFT JOIN ttrss_filters2_actions AS a
-                                                       ON (a.filter_id = f.id) WHERE f.id = '$id' GROUP BY f.title");
+                                                       ON (a.filter_id = f.id) WHERE f.id = '$id' GROUP BY f.title, f.match_any_rule");
 
                $title = $this->dbh->fetch_result($result, 0, "title");
                $num_rules = $this->dbh->fetch_result($result, 0, "num_rules");
                $num_actions = $this->dbh->fetch_result($result, 0, "num_actions");
+               $match_any_rule = sql_bool_to_bool($this->dbh->fetch_result($result, 0, "match_any_rule"));
 
                if (!$title) $title = __("[No caption]");
 
                $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", $num_rules), $title, $num_rules);
 
+
                $result = $this->dbh->query(
                        "SELECT * FROM ttrss_filters2_actions WHERE filter_id = '$id' ORDER BY id LIMIT 1");
 
@@ -1096,6 +1098,8 @@ class Pref_Filters extends Handler_Protected {
                        $num_actions -= 1;
                }
 
+               if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
+
                if ($num_actions > 0)
                        $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", $num_actions), $actions, $num_actions);
 
index 06c2bffd2525ee711c9b790ec1547598455c6ab5..d5dfb7489f199166b77f2d5d850658ebeb5da724 100644 (file)
        margin-right : 1em;
 }
 
-.claro .dijitTree .dijitTreeLabel.Disabled, 
-.claro .dijitTree .labelParam.Disabled {
+.claro .dijitTree .dijitTreeLabel.filterDisabled,
+.claro .dijitTree .labelParam.filterDisabled {
        color : #555;
+       text-decoration: line-through;
 }
 
 .claro .dijitTreeRow.Error {
index 7a561c55ba4e1b915f5eefef6e96eba13edf62fc..ba06bbef480a574dde17f3ea12ce1f9982923f4e 100644 (file)
@@ -28,7 +28,7 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, {
 
                if (param) {
                        param = dojo.doc.createElement('span');
-                       param.className = (enabled != false) ? 'labelParam' : 'labelParam Disabled';
+                       param.className = (enabled != false) ? 'labelParam' : 'labelParam filterDisabled';
                        param.innerHTML = args.item.param[0];
                        dojo.place(param, tnode.rowNode, 'first');
                }
@@ -74,7 +74,7 @@ dojo.declare("fox.PrefFilterTree", lib.CheckBoxTree, {
        },
        getLabelClass: function (item, opened) {
                var enabled = this.model.store.getValue(item, 'enabled');
-               return (enabled != false) ? "dijitTreeLabel labelFixedLength" : "dijitTreeLabel labelFixedLength Disabled";
+               return (enabled != false) ? "dijitTreeLabel labelFixedLength" : "dijitTreeLabel labelFixedLength filterDisabled";
        },
        getRowClass: function (item, opened) {
                return (!item.error || item.error == '') ? "dijitTreeRow" :