diff options
| -rw-r--r-- | classes/Pref_Filters.php | 30 | ||||
| -rw-r--r-- | themes/compact.css | 1 | ||||
| -rw-r--r-- | themes/compact_night.css | 1 | ||||
| -rw-r--r-- | themes/light-high-contrast.css | 1 | ||||
| -rw-r--r-- | themes/light.css | 1 | ||||
| -rw-r--r-- | themes/light/dijit_basic.less | 1 | ||||
| -rw-r--r-- | themes/night.css | 1 | ||||
| -rw-r--r-- | themes/night_blue.css | 1 |
8 files changed, 29 insertions, 8 deletions
diff --git a/classes/Pref_Filters.php b/classes/Pref_Filters.php index 76d5d686e..9b11284b4 100644 --- a/classes/Pref_Filters.php +++ b/classes/Pref_Filters.php @@ -10,6 +10,8 @@ class Pref_Filters extends Handler_Protected { const PARAM_ACTIONS = [self::ACTION_TAG, self::ACTION_SCORE, self::ACTION_LABEL, self::ACTION_PLUGIN, self::ACTION_REMOVE_TAG]; + const MAX_ACTIONS_TO_DISPLAY = 3; + /** @var array<int,array<mixed>> $action_descriptions */ private $action_descriptions = []; @@ -746,23 +748,35 @@ class Pref_Filters extends Handler_Protected { ->order_by_asc('id') ->find_many(); - $actions_summary = ""; + /** @var array<string> $actions_summary */ + $actions_summary = []; $cumulative_score = 0; + // we're going to show a summary adjustment so we skip individual score action descriptions here foreach ($actions as $action) { - if ($action->action_id == self::ACTION_SCORE) + if ($action->action_id == self::ACTION_SCORE) { $cumulative_score += (int) $action->action_param; + continue; + } - if ($actions_summary == "") - $actions_summary = self::_get_action_name($action); + array_push($actions_summary, self::_get_action_name($action)); } - if ($cumulative_score) array_push($title_summary, T_sprintf("sets score: %d", $cumulative_score)); + // 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])); + } - if (count($actions) > 1) - $actions_summary .= " " . sprintf(_ngettext("(+%d action)", "(+%d actions)", count($actions) - 1), count($actions) - 1); + if (count($actions_summary) > self::MAX_ACTIONS_TO_DISPLAY) { + $actions_not_shown = count($actions_summary) - self::MAX_ACTIONS_TO_DISPLAY; + $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)); + } - return [implode(", ", $title_summary), $actions_summary]; + return [implode(", ", $title_summary), implode("<br/>", $actions_summary)]; } return []; diff --git a/themes/compact.css b/themes/compact.css index b0330b885..c62595962 100644 --- a/themes/compact.css +++ b/themes/compact.css @@ -1964,6 +1964,7 @@ body.ttrss_utility.share_popup .content { .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 12b94dc85..8c48a6c27 100644 --- a/themes/compact_night.css +++ b/themes/compact_night.css @@ -1866,6 +1866,7 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .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 217d10eac..19387f96e 100644 --- a/themes/light-high-contrast.css +++ b/themes/light-high-contrast.css @@ -1964,6 +1964,7 @@ body.ttrss_utility.share_popup .content { .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 e7aa0c11e..6934312ed 100644 --- a/themes/light.css +++ b/themes/light.css @@ -1964,6 +1964,7 @@ body.ttrss_utility.share_popup .content { .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 f29461530..fcdde88eb 100644 --- a/themes/light/dijit_basic.less +++ b/themes/light/dijit_basic.less @@ -151,6 +151,7 @@ .labelParam { float: right; margin-right: 16px; + text-align: right; } .dijitTreeRow.filterDisabled { diff --git a/themes/night.css b/themes/night.css index 33a239af0..39f850e48 100644 --- a/themes/night.css +++ b/themes/night.css @@ -1867,6 +1867,7 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .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 6676426ef..d430e2834 100644 --- a/themes/night_blue.css +++ b/themes/night_blue.css @@ -1867,6 +1867,7 @@ body.ttrss_prefs[hide-filter-rules="true"] ul.filterRules { .flat .dijitTree .labelParam { float: right; margin-right: 16px; + text-align: right; } .flat .dijitTree .dijitTreeRow.filterDisabled { opacity: 0.5; |