From 53bc0f6a4002573997a67c10166e474e241dbee2 Mon Sep 17 00:00:00 2001 From: April Bowler Date: Thu, 12 Dec 2019 11:00:52 -0800 Subject: [PATCH] Fix bug 1602374: Sort Priority and Unreviewed descendingly on first click (#1518) --- pontoon/base/static/css/style.css | 6 ++++-- pontoon/base/static/js/table.js | 4 ++-- .../templates/localizations/widgets/resource_list.html | 4 ++-- .../projects/templates/projects/widgets/project_list.html | 4 ++-- pontoon/tags/templates/tags/widgets/tag_list.html | 4 ++-- pontoon/teams/templates/teams/widgets/team_list.html | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pontoon/base/static/css/style.css b/pontoon/base/static/css/style.css index e58fc88e15..b5ff585c83 100755 --- a/pontoon/base/static/css/style.css +++ b/pontoon/base/static/css/style.css @@ -187,13 +187,15 @@ th { position: absolute; } -.table-sort th.asc i:after { +.table-sort th.asc i:after, +.table-sort th.desc.inverted i:after { content: ""; display: inline-block; margin-top: 5px; } -.table-sort th.desc i:after { +.table-sort th.desc i:after, +.table-sort th.asc.inverted i:after { content: ""; display: inline-block; margin-top: -5px; diff --git a/pontoon/base/static/js/table.js b/pontoon/base/static/js/table.js index bbeb996e8f..3f4c409c27 100644 --- a/pontoon/base/static/js/table.js +++ b/pontoon/base/static/js/table.js @@ -168,7 +168,7 @@ var Pontoon = (function (my) { // Sort by unreviewed state } else if (node.is('.unreviewed-status')) { - return (getUnreviewed(a) - getUnreviewed(b)) * dir; + return (getUnreviewed(b) - getUnreviewed(a)) * dir; // Sort by deadline } else if (node.is('.deadline')) { @@ -190,7 +190,7 @@ var Pontoon = (function (my) { // Sort by priority } else if (node.is('.priority')) { - return (getPriority(a) - getPriority(b)) * dir; + return (getPriority(b) - getPriority(a)) * dir; // Sort by enabled state } else if (node.is('.check')) { diff --git a/pontoon/localizations/templates/localizations/widgets/resource_list.html b/pontoon/localizations/templates/localizations/widgets/resource_list.html index be6f16a14d..3ad7b36f11 100644 --- a/pontoon/localizations/templates/localizations/widgets/resource_list.html +++ b/pontoon/localizations/templates/localizations/widgets/resource_list.html @@ -14,12 +14,12 @@ {% endif %} {% if priority %} - Priority + Priority {% endif %} Latest Activity Progress - + diff --git a/pontoon/projects/templates/projects/widgets/project_list.html b/pontoon/projects/templates/projects/widgets/project_list.html index 2c4da8af6b..333c48d305 100644 --- a/pontoon/projects/templates/projects/widgets/project_list.html +++ b/pontoon/projects/templates/projects/widgets/project_list.html @@ -9,10 +9,10 @@ Project Deadline - Priority + Priority Latest Activity Progress - + {% if request %} Number of Strings Request diff --git a/pontoon/tags/templates/tags/widgets/tag_list.html b/pontoon/tags/templates/tags/widgets/tag_list.html index 6a3c39bf2a..4d58773cd1 100644 --- a/pontoon/tags/templates/tags/widgets/tag_list.html +++ b/pontoon/tags/templates/tags/widgets/tag_list.html @@ -7,10 +7,10 @@ Tag - Priority + Priority Latest Activity Progress - + diff --git a/pontoon/teams/templates/teams/widgets/team_list.html b/pontoon/teams/templates/teams/widgets/team_list.html index b3373dbb1c..86ecff16b8 100644 --- a/pontoon/teams/templates/teams/widgets/team_list.html +++ b/pontoon/teams/templates/teams/widgets/team_list.html @@ -10,7 +10,7 @@ Speakers Latest Activity Progress - + {% if request %} Request {% endif %}