We could reorder the roles by their weight on admin/user/roles instead of alphabetically (with the default roles at the top) - and perhaps provide an option/switch to toggle this.

Alternatively, we could at least display the weight in the form.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

Ordering by weight and displaying weight would both be good. Possibly we could allow reweighting on that page (provide a select for each).

pfaocle’s picture

Version: master » 5.x-1.x-dev
Status: Active » Needs work
FileSize
2.08 KB

Started to look at this, but haven't made much headway. Its relatively simple to order the admin roles form (or more correctly, the table it inserts before the main form) and display the weight in a column: the rough-and-ready patch attached does that.

What I'm not sure how to deal with is being able to include and alter select boxes for each role's weight, which I guess is the ideal UI. The form the table is rendered in is meant for creating a new role, so we'd have to somehow split the form up into the weight editing form (the existing table of roles) and the submit new role form.

Unless we can have two submit buttons, each with different actions, within one form? So there'd be a button to update weights, and another to submit a new role? I'll try and find some examples of this and play around.

Also, would we want this to be optional, ie an admin could still see a list of roles ordered alphabetically? Sorting on those table headers would be nice...

pfaocle’s picture

Slightly better way, I think. The role weight selects are added in as form elements, and then rendered into the table in the theme function.

Still not sure about two separate submits for this form tho.

pfaocle’s picture

Status: Needs work » Closed (duplicate)

I think we should merge the two "ordering by role weight" issues into one patch. If we start ordering one admin table, we should do all of them. Any thoughts on whether this should be an option appreciated.

So, marking this as a duplicate of #210457: Order relevant user/role/access forms by Role Weight, I'll try to merge the two patches into something sensible soon.

Also, I've created a new issue: #257478: Set weights on admin_user_roles form with JS Drag & Drop for allowing the role weight to be set directly on the admin_user_roles form and improving this part of the UI in general.