diff --git a/media/commitfest/js/commitfest.js b/media/commitfest/js/commitfest.js index 27a54f94..2d6b0b8f 100644 --- a/media/commitfest/js/commitfest.js +++ b/media/commitfest/js/commitfest.js @@ -257,7 +257,10 @@ function flagCommitted(committer) { } function sortpatches(sortby) { - if ($("#id_sortkey").val() === sortby) { + const sortkey = $("#id_sortkey").val(); + if (sortkey === sortby) { + $("#id_sortkey").val(-sortby); + } else if (-sortkey === sortby) { $("#id_sortkey").val(0); } else { $("#id_sortkey").val(sortby); diff --git a/pgcommitfest/commitfest/templates/commitfest.html b/pgcommitfest/commitfest/templates/commitfest.html index aee8af9f..ac5b17de 100644 --- a/pgcommitfest/commitfest/templates/commitfest.html +++ b/pgcommitfest/commitfest/templates/commitfest.html @@ -60,18 +60,18 @@

{{p.is_open|yesno:"Active patches,Closed patches"}}

- - + + - + - - - + + + {%if user.is_staff%} {%endif%} diff --git a/pgcommitfest/commitfest/views.py b/pgcommitfest/commitfest/views.py index 1f0df87d..152d39b5 100644 --- a/pgcommitfest/commitfest/views.py +++ b/pgcommitfest/commitfest/views.py @@ -241,18 +241,30 @@ def commitfest(request, cfid): if sortkey == 1: orderby_str = "modified, created" + elif sortkey == -1: + orderby_str = "modified DESC, created DESC" elif sortkey == 2: orderby_str = "lastmail, created" + elif sortkey == -2: + orderby_str = "lastmail DESC, created DESC" elif sortkey == 3: orderby_str = "num_cfs DESC, modified, created" + elif sortkey == -3: + orderby_str = "num_cfs ASC, modified DESC, created DESC" elif sortkey == 4: orderby_str = "p.id" + elif sortkey == -4: + orderby_str = "p.id DESC" elif sortkey == 5: orderby_str = "p.name, created" + elif sortkey == -5: + orderby_str = "p.name DESC, created DESC" elif sortkey == 6: orderby_str = ( "branch.all_additions + branch.all_deletions NULLS LAST, created" ) + elif sortkey == -6: + orderby_str = "branch.all_additions + branch.all_deletions DESC NULLS LAST, created DESC" else: orderby_str = "p.id" sortkey = 0
Patch{%if sortkey == 5%}
{%endif%}
ID{%if sortkey == 4%}
{%endif%}
Patch{%if sortkey == 5%}
{%elif sortkey == -5%}
{%endif%}
ID{%if sortkey == 4%}
{%elif sortkey == -4%}
{%endif%}
Status Ver CI statusStats{%if sortkey == 6%}
{%endif%}
Stats{%if sortkey == 6%}
{%elif sortkey == -6%}
{%endif%}
Author Reviewers CommitterNum cfs{%if sortkey == 3%}
{%endif%}
Latest activity{%if sortkey == 1%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%endif%}
Num cfs{%if sortkey == 3%}
{%elif sortkey == -3%}
{%endif%}
Latest activity{%if sortkey == 1%}
{%elif sortkey == -1%}
{%endif%}
Latest mail{%if sortkey == 2%}
{%elif sortkey == -2%}
{%endif%}
Select