numeric ordering
Description
Ordering was lexigraphical only due to a plugin called tablesort from src/static/js/ours/utils.js
Brief history and mental map:
- src/static/riot/competitions/detail/leaderboards.tag - hosts "#leaderboardTable#
- /src/templates/base.html imports https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.1/semantic.min.css
- https://semantic-ui.com/collections/table.html#sortable has a tabl type called "sortable"
- They have a note:
- The this_javascript link takes you to a tablesort.js file. As it turns out we copy and pasted this in src/static/js/ours/utils.js. There you can see the link the aforementioned kylefox plugin.
- The compare function never determines what it's sorting and that could be strings or numbers. By forcing a decision to use numbers if indeed there are numbers we can correctly sort by floats or strings.
Issues this PR resolves
- PR failed circleci but it was a dependency but in requirements.txt
A checklist for hand testing
-
Use below bundle with sample submissions to create a leaderboard that prioritizes the Score column as sorting column. When clicking any column, you should see the correct order:
Any relevant files for testing
Checklist
-
Code review by me -
Hand tested by me -
I'm proud of my work -
Code review by reviewer -
Hand tested by reviewer -
CircleCi tests are passing -
Ready to merge