Add the option to add users by role, so I can 'select' the role from a list, and all members of that role will be added to the electoral list

CommentFileSizeAuthor
#4 elist_by_role.patch3.43 KBChrisKennedy

Comments

Salman_Rahma’s picture

there should be an option to specify users:
* Anybody (including anonymous)
* Only Authenticated users
* By role (select from a list)

jdleonard’s picture

I would also love this feature!

MCI_Nano’s picture

I'd love this feature too.

ChrisKennedy’s picture

Status: Active » Needs review
StatusFileSize
new3.43 KB

Here is a quick stab at implementing the ability to add users to the electoral list based on their role. I did some really quick testing right now but will do some more tomorrow.

anders.fajerson’s picture

Cool! I will look into this later today. It would be a great help if people who want to see this feature get in could test this patch and come with feedback. The Drupal handbook has all information you need: http://drupal.org/patch/apply, http://drupal.org/patch/review, http://drupal.org/node/28245

Thanks!

ChrisKennedy’s picture

Okay I did a more thorough test of the various permission combinations and didn't find any functionality problems. Let me know if there are any suggestions on the implementation/style.

anders.fajerson’s picture

I gave the UI some thought... First I was thinking it might be better for the workflow if the electoral list admin options were on the edit page, maybe as a collapsible fieldset. But it might clutter it too much so I'm not sure about that. Then I thought about simplifying it (so it wouldn't ad so much clutter), maybe just checkboxes for all roles; "restrict voting to roles" or similar. Just thinking out loud...

If we stick with this implementation, which might be the best option, the wording on the buttons on the electoral tab could need some work, but that could be improved upon later.

ChrisKennedy’s picture

Fair points. I tend to prefer the electoral list stuff on its own tab since the edit page is already pretty complicated.

I considered a checkbox option, but I thought it might be too big/messy if a site has a lot of roles. Plus I don't think it will be a big deal if you have to select a few roles to add and submit the form a few times.

Agree that the button text could be tweaked. I'm leaning towards "Add to electoral list" and "Clear electoral list", with some extra space between the buttons too. Or do you think the phrase "electoral list" should be changed to something clearer?

anders.fajerson’s picture

I don't know how much work it would be, but if it's simple we might borrow some code from the content admin page (/admin/content/node). Especially the checkboxed in front of a user and the select all checkbox to remove a lot of users, or even remove them by role with a select element:
------------------------------
Remove selected users
------------------------------
Remove users by role:
- Voter A
- Voter B
------------------------------

The wording on the buttons you suggested is much better.

anders.fajerson’s picture

I don't know how much work it would be, but if it's simple we might borrow some code from the content admin page (/admin/content/node). Especially the checkboxed in front of a user and the select all checkbox to remove a lot of users, or even remove them by role with a select element:
------------------------------
Remove selected users
------------------------------
Remove users by role:
- Voter A
- Voter B
------------------------------

The wording on the buttons you suggested is much better.

ChrisKennedy’s picture

Status: Needs review » Fixed

Okay I committed it - I'll save the removing option for another issue.

http://drupal.org/cvs?commit=66948

Anonymous’s picture

Status: Fixed » Closed (fixed)