stuysu / epsilon

all in one service for stuyvesant high school.
10 stars 3 forks source link

Feat: Allow club members/admins to be reordered #218

Open TheEgghead27 opened 2 months ago

TheEgghead27 commented 2 months ago

As of right now, members are displayed in database row (i.e. join) order.

Rahuldeb5 commented 1 week ago

What is the benefit to expand this feature to members (it is understandable for admin)?

TheEgghead27 commented 1 week ago

I am of the opinion it is only necessary for club admins, but I suppose it could be done through a new column on the organizations page ordering_id.

By default, the ordering_id would be NULL preserving the existing order (chronological), but an ADMIN (or CREATOR) should be able to use up and down arrows (and/or a number entry, e.g. for the 5th entry there would be buttons/textfield that look like ^ [5] v) in the admin panel to manually move members along the list. The client would generate the ordering_ids necessary to maintain this order (it would be easiest to give all members at the time of editing an ordering_id corresponding to their displayed order, and to automatically leave new members with NULL values that go to the bottom).

This would be sorted in increasing order (i.e. lowest numbers such as 0 or -1 are at the very top, larger numbers go to the bottom, NULL values default to being at the bottom in INT_MAX). Memberships will usually not have the same ordering_id, and this case does not have to be handled.

Rahuldeb5 commented 1 week ago

Agreed, sounds good.