Don't show 'Sort By' if there are fewer than 2 unarchived courses #2218

For #2218
hey subhodip, this seems like a lot of logic to be inline. could you move this to the top of the page (right after 'data' is initialised) and save it as a variable that can be used here?