Skip to main content
added 4 characters in body
Source Link
Spevacus Mod
  • 29.4k
  • 9
  • 61
  • 148

Last time I heard news about those pages I was told they were going away / getgetting redesigned anyway. Maybe sorting /filtering gets some new love as well then.

Last time I heard news about those pages I was told they were going away / get redesigned anyway. Maybe sorting /filtering gets some new love as well then.

Last time I heard news about those pages I was told they were going away / getting redesigned anyway. Maybe sorting /filtering gets some new love as well then.

Source Link
rene Mod
  • 92.1k
  • 17
  • 245
  • 516

Adding another toggle to reverse the sorting would require an overhaul of that view without a clear benefit.

The easiest thing that could work and wouldn't require a ton of dev time, in sites.js find function initializeListView() and change the getSortData object to:

getSortData: {
    oldest: function (elem) { return parseInt($(elem).find('input[name="creation-date"]').val(), 10); },
    newest: function (elem) { return -parseInt($(elem).find('input[name="creation-date"]').val(), 10); },
    questions: function (elem) { return -parseInt($(elem).find('input[name="questions"]').val(), 10); },
    answers: function (elem) { return -parseInt($(elem).find('input[name="answers"]').val(), 10); },
    percentanswered: function (elem) { return -parseFloat($(elem).find('input[name="percent-answered"]').val()); },
    users: function (elem) { return -parseInt($(elem).find('input[name="users"]').val(), 10); },
    traffic: function (elem) { return -parseFloat($(elem).find('input[name="visits-per-day"]').val()); },
    questionsperday: function (elem) { return -parseFloat($(elem).find('input[name="questions-per-day"]').val()); },
    name: function (elem) { return $(elem).find('input[name="name"]').val(); },
    // sort almost all the things
    questionsasc: function (elem) { return parseInt($(elem).find('input[name="questions"]').val(), 10); },
    answersasc: function (elem) { return parseInt($(elem).find('input[name="answers"]').val(), 10); },
    percentansweredasc: function (elem) { return parseFloat($(elem).find('input[name="percent-answered"]').val()); },
    usersasc: function (elem) { return parseInt($(elem).find('input[name="users"]').val(), 10); },
    trafficasc: function (elem) { return parseFloat($(elem).find('input[name="visits-per-day"]').val()); },
    questionsperdayasc: function (elem) { return parseFloat($(elem).find('input[name="questions-per-day"]').val()); },
}

And then in the list view add more options to the site-sort dropdown:

<select class="site-sort">
        <option value="traffic" selected="selected">Traffic</option>
        <option value="trafficasc">Ghost towns</option>
        <option value="oldest">Oldest</option>
        <option value="newest">Newest</option>
        <option value="questions">Questions</option>
        <option value="questionsasc">Hardly any Questions</option>
        <option value="answers">Answers</option>
        <option value="answersasc">Lacking Answers</option>
        <option value="percentanswered">Percent Answered</option>
        <option value="percentansweredasc">Lowest Percent Answered</option>
        <option value="users">Users</option>
        <option value="usersasc">From no Users to all Users</option>
        <option value="questionsperday">Questions Per Day</option>
        <option value="questionsperdayasc">Reversed Questions Per Day</option>
        <option value="name">Name</option>
</select>

(Maybe needs better wording for the sort options)

I've done the work that is needed. If this is really useful then a dev needs to make those changes the code base, test, merge, get it reviewed and deployed. Allow for at least 6 to 8 weeks before this happens, if at all.

I'm not convinced the alternate sort orders are that useful or beneficial for regular visitors of that page.

Last time I heard news about those pages I was told they were going away / get redesigned anyway. Maybe sorting /filtering gets some new love as well then.