Page MenuHomePhabricator

Add sortable column for WSContest contest page
Open, Needs TriagePublicFeature

Description

Feature summary (what you would like to be able to do and where):

In WSContest contest page, there are multiple columns (User, Points, Contributions, Validations), but there's only one default sort, that is by Points. The sortable column would work just like in-wiki's "sortable" style. Reader could then sort the columns by Username, Contributions, Validations, ascending, and descending.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

For example, go to: https://wscontest.toolforge.org/c/60

There's no easy way to tell the rank of the validators, and contributors.

Benefits (why should this be implemented?):

It could be beneficial to the contestant as well as admins to be able to tell, for example: who are the top validator, list of users by username, etc.

Event Timeline

Pls can you guide me how can i contribute to this.

@Sohamdas07 Thanks for your interest! To get started, you first need to download the code and get it running in your local development environment. How familiar are you with PHP development?

This project doesn't have any existing front-end build system in place, so you could either add one (e.g. Webpack), or just extend the existing set-up. The latter loads assets from the CDNjs tool, so you'd want to select a table-sorting library that's already on that (such as https://github.hubspot.com/sortable/ perhaps), and then integrate that into the relevant parts of the codebase. I'm not quite sure, but doing so may just be a matter of modifying the HTML templates in the templates/ directory.

Thanks for replying
yeah i have got it running in my local environment
I am somewhat familiar with php development.

Sounds good! Have a go at adding this feature, and send a pull request on GitHub, and we'll review it.

Will the styling for the tables be same or like your example (https://github.hubspot.com/sortable/) I may include the class but not use the theme now but keep it for later use.
Moreover should I add this sorting feature to all the tables or should i leave any specific table.

I think it'd be fine to not add any extra styling, if that's easier for now.

And if it's not much extra work, you might also look at adding sorting to the recent contests table as well. I don't think there's any need to add sorting to the user results table.

I submitted a PR please review it and let me know if any thing needs to be changed.

Hi Samwilson

Thanks for being so patient with me and I apologize for getting late for
completing this work.
Today I was wondering how I can host the page on my local system . What can
be the launch.json file? For example, if I want to edit this project in
Vscode, how can I host it in my local browser?

Thanks
Soham

@Sohamdas07 I've added some notes to the CONTRIBUTING.md file. I realise they're a bit terse (sorry!), but try following them and let me know what's confusing, and I'll update them.

I'm not sure what a launch.json file is for, sorry; one is not needed for wscontest. You can use VS Code or any IDE, the development environment can be the same.