near the end of http://drupal.org/node/51561, dries brought up that he didn't like the way i was trying to display the current user's vote, so he removed that stuff from the code that was actually committed to the repository. however, that issue is getting too confusing, and i'm planning to just close it so the spin-off tasks can be tracked (and perhaps assigned/worked on) individually. so, if any of the more CSS-clueful are interested in working on this, please assign this issue to yourself and roll a patch. ;) otherwise, i'll work on it someday.

CommentFileSizeAuthor
#5 67931-5.patch3.5 KBlendude

Comments

gábor hojtsy’s picture

Title: UI fix: display current user's vote » UI improvement: display current user's vote
Version: x.y.z » 7.x-dev

This sounds like a UI improvement, definitely not a fix. Goes to Drupal 7.

jody lynn’s picture

Version: 7.x-dev » 8.x-dev
alexpott’s picture

Project: Drupal core » Poll
Version: 8.x-dev » 8.x-1.x-dev
Component: poll.module » Code

Poll is no longer part of core

adammalone’s picture

Issue summary: View changes

In 8.x, when we determine if the user is allowed to vote on a poll, we check if they have voted prior. The hasUserVoted method actually returns an array including the choice the user made. My thought is that it would be relatively simple to feed that choice into the template and add a class to the appropriate meter if the user voted for that choice. This could then either be left to the site theme to display or included by default in poll module.

lendude’s picture

Status: Active » Needs review
StatusFileSize
new3.5 KB

This adds classes to the selected and non-selected options, this doesn't add any default styling since that would break BC. But with the classes people have the option to style this.

Also adds some minimal test coverage for this and updates the Javascript test to not use phantomJs anymore because, pffff

  • Berdir committed f25ade6 on 8.x-1.x authored by Lendude
    Issue #67931 by Lendude: UI improvement: display current user's vote
    
berdir’s picture

Status: Needs review » Fixed

Huh, previous last comment from 2014, you've been digging deep here ;) And a 5-digit issue from 2006...

It does add another query because getUserVote() isn't statically cached, maybe it should be. But you get bonus points for converting the JS test, so I'll create a follow-up for that: #3094531: Statically cache PollVoteStorage::getUserVote(). And it's already a lazy builder, so not in the critical path.

Status: Fixed » Closed (fixed)

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