-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TP2000-959 Add sorting to the MeasuresList filter results table (#1034)
* Add sorting to results table * Add sorting for end dates * Fix existing tests * Add tests for Sort by * Change query param arg to bool * Remove the string check for ordering in get queryset * Rename anchor to fragment * Rename sort_by to create-sortable_anchor * Fix broken tests
- Loading branch information
1 parent
1695287
commit 949f547
Showing
20 changed files
with
231 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
{% macro create_sortable_anchor(request, sort_by, title, base_url, query_params=False, fragment="") %} | ||
|
||
{% if query_params %} | ||
{% set query_string_prefix = "&"%} | ||
{% else %} | ||
{% set query_string_prefix = "?"%} | ||
{% endif %} | ||
|
||
{% if request.GET.sort_by == sort_by and request.GET.ordered == "desc" %} | ||
|
||
<a class="govuk-link govuk-link--no-visited-state sort-icon--down" href="{{ base_url }}{{query_string_prefix}}sort_by={{ sort_by }}&ordered=asc{{ fragment }}"> | ||
{{ title }} <img src="{{ static('common/images/sort_icon.svg') }}" alt=""> | ||
</a> | ||
{% else %} | ||
<a class="govuk-link govuk-link--no-visited-state sort-icon--up" href="{{ base_url }}{{query_string_prefix}}sort_by={{ sort_by }}&ordered=desc{{ fragment }}"> | ||
{{ title }} <img src="{{ static('common/images/sort_icon.svg') }}" alt=""> | ||
</a> | ||
{% endif %} | ||
|
||
{% endmacro %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.