Comments

anarcat’s picture

Status: Active » Closed (won't fix)

Yes: everything is possible. ;) However, I'm not sure what would be gained by that: the whole page has to reload anyways for the blocks to be updated and the results shown properly.

chandrabhan’s picture

Thanks for the response. I am not sure whether we need to refresh the whole page. User submits his/her vote within a block then the block gets refreshed to show the current result (something that cnn.com does) and possibly showing what user have voted for. If the poll is submitted in its own node page then I think it is ok to refresh the whole page.

anarcat’s picture

Status: Closed (won't fix) » Active

Okay, so there's two of you now (#705852: Asynchronous submission of selection votes), I give up. :) I would welcome a patch that does that, but I don't have time to work on it.

ezra-g’s picture

At the above referenced issue, anarcat said:

What I'm worried about is that blocks showing results or related decisions wouldn't be updated after the submission and would show an inconsistent picture.

I think we can ensure that even with AJAX submission, the displayed results take into the vote being cast. I'm working on a project that calls for this so hopefully I'll have a patch here in the next couple of weeks.

ezra-g’s picture

I see an AJAX submit form replacing the radios and submit button with one button per vote option. This would also be the degradable behavior and still allow single-click voting, rather than clicking the radio and then clicking submit.

Would you prefer to keep current form that includes radios as a configurable option, or shall I implement a button-based (degradable) vote submission as well?

Thanks!

anarcat’s picture

Hum. If we have a single possible choice, buttons do make more sense than radios, I guess, but that's a specific use case... We can technically have multiple choices valid, in which case we have checkboxes, and then we need a submit button. It may be confusing from a UI perspective to have single click sometimes and multi-click other times...We should strive for a consistent interface... However, in this case, it seems like a minor change, so I wouldn't object that that change. Keep in mind that it won't solve the general AJAX submission problem: if we have multiple choice, we should have AJAX too.

In general, I see the two things as orthogonal: we can have AJAX submissions with or without radio boxes. And in fact, we don't need radio boxes for non-AJAX voting...

ezra-g’s picture

Assigned: Unassigned » ezra-g

Anarcat and I discussed this in IRC and concluded that replacing the radios for buttons for single-choice voting is an acceptable solution. Assigning to me.

chandrabhan’s picture

I would love to see it as configurable rather than default. User has to now click undo button or something if he has accidentally pressed one of the option buttons. Coming back to original premise of the issue, I would appreciate if we can get ajax submission of the form irrespective of radio button or otherwise for the options.

anarcat’s picture

I agree that "single click voting" should be an option. I don't care if it's set by default, but we should allow people to enforce a two-click process, as this is a matter of policy of the site administrator ("tools not policy"). Some people may *want* to have people click (and therefore think) twice before voting.

Besides, this is orthogonal to the AJAX voting issue: let's keep those two separate please.

ezra-g’s picture

Status: Active » Needs work
StatusFileSize
new11.43 KB

Here's an initial patch that implements 1click voting as a configuration option, as well a aynchronous voting as a config option, so as to preserve existing functionality.

Some of what's left:
- Style the 1-click voting controls so that they are spaced evenly and are more visible
- Hopefully improve the jQuery here so that the fadeIn happens only once the fadeOut has completed.

ezra-g’s picture

StatusFileSize
new715 bytes

And here's the bit of jQuery that goes in /modes.

ezra-g’s picture

StatusFileSize
new793 bytes

Here's the improvement I mentioned to the jQuery fadeIn/Out. Stay tuned for better default styling on the links.

ezra-g’s picture

StatusFileSize
new12.06 KB

Here's a re-roll to keep up with HEAD ;). Aside from link style, this is reviewable.

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new140 bytes
new13.76 KB

Here's a re-roll that improves the styling of the 1-click voting controls and a new css file. It works with the js in #12. If it would be helpful, I can post a movie to demonstrate the functionality here.

ezra-g’s picture

Status: Needs review » Needs work

Marking NW as votes aren't stored properly and themeability could be improved. Stay tuned.

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new12.89 KB
new228 bytes
new1.29 KB

Here are a revised patch and new css, js files that is ready for review. The css and jss go in /modes.

ezra-g’s picture

StatusFileSize
new14.53 KB

Here's a revised patch. I apologize that I committed the css and js files accidentally, so this shows a minor diff against them. You can see them in their "current" state at http://drupalcode.org/viewvc/drupal/contributions/modules/decisions/mode... .

I plan to commit this later today.

anarcat’s picture

go: i don't have time to review this week and i trust you this will work with or without js. :)

Please keep whitespace changes to a minimum while committing feature or bug fixes.

ezra-g’s picture

Assigned: ezra-g » David Lesieur
Status: Needs review » Fixed
StatusFileSize
new14.43 KB

I committed this change, removing the whitespace changes.

ezra-g’s picture

Assigned: David Lesieur » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

wonder95’s picture

Status: Closed (fixed) » Active

I could really use this, but I don't see where to get this code, since there is no dev release. The current version is 6.15, but it looks like this patch was done against 6.1.3 (and it fails when I apply it to 6.15). Do I just need to grab the latest manually from here?

Thanks.

ezra-g’s picture

You can checkout the latest changes from CVS (HEAD) or grab the nightly snapshot here http://drupal.org/node/96062 -- Looks like we might need a d.o admin to edit some metadata about that release to get it on the project page. Thanks for asking -- I'll look into it.

ezra-g’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.