maybe voters should be allowed to view poll forms and electoral lists even before the poll opens, so they are given a chance to check their eligibility, and the candidate list. Errors can then be corrected before opening the poll. Thank you.

Comments

ChrisKennedy’s picture

Those both sound like good ideas - I'll see about implementing them.

anders.fajerson’s picture

StatusFileSize
new6.54 KB

First attempt. Now the poll is shown but the button is disabled and a message is displayed next to it. Added validating of eligible voter. First a screenshot.

anders.fajerson’s picture

Status: Active » Needs review
StatusFileSize
new4.49 KB

And the patch. I still have problems making these patches on this borrowed laptop. Hopefully it applies. Please test carefully.

anders.fajerson’s picture

StatusFileSize
new4.39 KB

rerolled

ChrisKennedy’s picture

Version: 5.x-1.0-beta1 » 5.x-1.x-dev

This looks pretty good. A few things:

1. "Eligible" is misspelled a few times in the comments.
2. I'd check if you can still submit the form by enabling the submit button via jQuery.
3. I wonder if it would be better usability to just show results and a message saying the user is ineligible and/or not logged in, rather than displaying form elements that are not meant to actually be used.
4. Minor: imo, it's cleaner to not create $eligible if we're only using checking advpoll_eligible() once, and instead could just put advpoll_eligible() in the IF statement.

anders.fajerson’s picture

StatusFileSize
new4.14 KB

1. Fixed.
2. You mean manipulating the submit button client-side so it can be clicked? Did it and // Check if user is eligible to vote catches it.
3. I thought the main motivation behind this patch was just that, to be able to view the form? It might be better to remove the button though. In Opera for example a disabled button looks the same as an enabled.
4. Fixed.

ChrisKennedy’s picture

2. Cool.

3. I think the desired functionality is to let someone view the choices even if they're ineligible. This could be implemented as showing the form or the results, but I think the results might be the better choice.

anders.fajerson’s picture

I think the form is better. If the user can't view the result (e.g. if is set to show after vote is closed) we end up with the empty form again. On my site I also see the form as a sort of advertisment: "hey, log in/become member so you can vote on this!"

ChrisKennedy’s picture

Status: Needs review » Fixed

Ah good point about results display. Committed.

http://drupal.org/node/143194

ChrisKennedy’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)