From d4636716fb6e1879098823c2f037db5d8d3f24a0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 23 Nov 2024 17:43:20 +0300 Subject: collapse actions summary list in filter tree if 'toggle rule display' is disabled, remove label-specific icon display, simplify markup --- classes/Pref_Filters.php | 22 ++++------------------ js/PrefFilterTree.js | 4 ++-- themes/compact.css | 21 ++++++++++++++++----- themes/compact_night.css | 21 ++++++++++++++++----- themes/light-high-contrast.css | 21 ++++++++++++++++----- themes/light.css | 21 ++++++++++++++++----- themes/light/dijit_basic.less | 6 ------ themes/light/prefs.less | 22 ++++++++++++++++++++++ themes/night.css | 21 ++++++++++++++++----- themes/night_blue.css | 21 ++++++++++++++++----- 10 files changed, 124 insertions(+), 56 deletions(-) diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php index 3a51a011b..89bc669b6 100644 --- a/classes/Pref_Filters.php +++ b/classes/Pref_Filters.php @@ -286,20 +286,6 @@ class Pref_Filters extends Handler_Protected { } } - if ($line['action_id'] == self::ACTION_LABEL) { - $label_sth = $this->pdo->prepare("SELECT fg_color, bg_color - FROM ttrss_labels2 WHERE caption = ? AND - owner_uid = ?"); - $label_sth->execute([$line['action_param'], $_SESSION['uid']]); - - if ($label_row = $label_sth->fetch()) { - //$fg_color = $label_row["fg_color"]; - $bg_color = $label_row["bg_color"]; - - $name[1] = "label" . $name[1]; - } - } - $filter = array(); $filter['id'] = 'FILTER:' . $line['id']; $filter['bare_id'] = $line['id']; @@ -759,13 +745,13 @@ class Pref_Filters extends Handler_Protected { continue; } - array_push($actions_summary, self::_get_action_name($action)); + array_push($actions_summary, "
  • " . self::_get_action_name($action) . "
  • "); } // inject a fake action description using cumulative filter score if ($cumulative_score != 0) { array_unshift($actions_summary, - self::_get_action_name(["action_id" => self::ACTION_SCORE, "action_param" => $cumulative_score])); + "
  • " . self::_get_action_name(["action_id" => self::ACTION_SCORE, "action_param" => $cumulative_score]) . "
  • "); } if (count($actions_summary) > self::MAX_ACTIONS_TO_DISPLAY) { @@ -773,10 +759,10 @@ class Pref_Filters extends Handler_Protected { $actions_summary = array_slice($actions_summary, 0, self::MAX_ACTIONS_TO_DISPLAY); array_push($actions_summary, - "" . sprintf(_ngettext("(+%d action)", "(+%d actions)", $actions_not_shown), $actions_not_shown)) . ""; + "
  • " . sprintf(_ngettext("(+%d action)", "(+%d actions)", $actions_not_shown), $actions_not_shown)) . "
  • "; } - return [implode(", ", $title_summary), implode("
    ", $actions_summary)]; + return [implode(", ", $title_summary), implode("", $actions_summary)]; } return []; diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index eded7e383..4ccddfa75 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -28,8 +28,8 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const rules = this.model.store.getValue(args.item, 'rules'); if (param) { - param = dojo.doc.createElement('span'); - param.className = (enabled != false) ? 'labelParam' : 'labelParam filterDisabled'; + param = dojo.doc.createElement('ul'); + param.className = (enabled != false) ? 'actions_summary' : 'actions_summary filterDisabled'; param.innerHTML = args.item.param[0]; domConstruct.place(param, tnode.rowNode, 'first'); } diff --git a/themes/compact.css b/themes/compact.css index 3ee5a4a90..3ac7090d6 100644 --- a/themes/compact.css +++ b/themes/compact.css @@ -1716,6 +1716,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1753,6 +1760,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} body.ttrss_utility.sanity_failed { background: #900; } @@ -1964,11 +1980,6 @@ body.ttrss_utility.share_popup .content { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } diff --git a/themes/compact_night.css b/themes/compact_night.css index c62554e29..4ad5e217a 100644 --- a/themes/compact_night.css +++ b/themes/compact_night.css @@ -1716,6 +1716,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1753,6 +1760,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} .flat { /*#feedTree { .dijitTreeContent .dijitInline { @@ -1866,11 +1882,6 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } diff --git a/themes/light-high-contrast.css b/themes/light-high-contrast.css index 830b57f72..5c7d1f58f 100644 --- a/themes/light-high-contrast.css +++ b/themes/light-high-contrast.css @@ -1716,6 +1716,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1753,6 +1760,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} body.ttrss_utility.sanity_failed { background: #900; } @@ -1964,11 +1980,6 @@ body.ttrss_utility.share_popup .content { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } diff --git a/themes/light.css b/themes/light.css index 33d137423..a65d521ec 100644 --- a/themes/light.css +++ b/themes/light.css @@ -1716,6 +1716,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1753,6 +1760,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} body.ttrss_utility.sanity_failed { background: #900; } @@ -1964,11 +1980,6 @@ body.ttrss_utility.share_popup .content { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } diff --git a/themes/light/dijit_basic.less b/themes/light/dijit_basic.less index fcdde88eb..caf1c5379 100644 --- a/themes/light/dijit_basic.less +++ b/themes/light/dijit_basic.less @@ -148,12 +148,6 @@ top : -2px; }*/ - .labelParam { - float: right; - margin-right: 16px; - text-align: right; - } - .dijitTreeRow.filterDisabled { opacity : 0.5; diff --git a/themes/light/prefs.less b/themes/light/prefs.less index 849855796..b26ff646c 100644 --- a/themes/light/prefs.less +++ b/themes/light/prefs.less @@ -268,6 +268,15 @@ body.ttrss_prefs { word-break : break-all; } } + + ul.actions_summary { + float : right; + margin-right : 16px; + margin-top : 0; + list-style-type : none; + text-align : right; + } + } body.ttrss_prefs, @@ -315,4 +324,17 @@ body.ttrss_prefs[hide-filter-rules="true"] { ul.filterRules { display : none; } + + ul.actions_summary li { + display : inline; + } + + ul.actions_summary li:after { + content: ", "; + } + + ul.actions_summary li:last-child:after { + content: " "; + } + } diff --git a/themes/night.css b/themes/night.css index 81a1b444b..14bde744a 100644 --- a/themes/night.css +++ b/themes/night.css @@ -1717,6 +1717,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1754,6 +1761,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} .flat { /*#feedTree { .dijitTreeContent .dijitInline { @@ -1867,11 +1883,6 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } diff --git a/themes/night_blue.css b/themes/night_blue.css index 16de963a3..23c0da5f9 100644 --- a/themes/night_blue.css +++ b/themes/night_blue.css @@ -1717,6 +1717,13 @@ body.ttrss_prefs .phpinfo td.v { font-family: monospace; word-break: break-all; } +body.ttrss_prefs ul.actions_summary { + float: right; + margin-right: 16px; + margin-top: 0; + list-style-type: none; + text-align: right; +} body.ttrss_prefs #filterNewRuleDlg .dijitValidationTextAreaError, body.ttrss_main #filterNewRuleDlg .dijitValidationTextAreaError { background: #ffc0c0; @@ -1754,6 +1761,15 @@ body.ttrss_utility fieldset > label.checkbox { body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { display: none; } +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li { + display: inline; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:after { + content: ", "; +} +body.ttrss_prefs[hide-filter-rules="true"] ul.actions_summary li:last-child:after { + content: " "; +} .flat { /*#feedTree { .dijitTreeContent .dijitInline { @@ -1867,11 +1883,6 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .flat .dijitTree .dijitTreeNode .dijitTreeRow.dijitTreeRowSelected { color: white; } -.flat .dijitTree .labelParam { - float: right; - margin-right: 16px; - text-align: right; -} .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; } -- cgit v1.2.3-54-g00ecf