Problem/Motivation
There is no way to know what option picked the visitor when displaying thumbs up/down
Proposed resolution
Load the visitors vote and add the bundle in the "has_voted" instead of TRUE so we can set it active in the template preprocess.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | rate-2880351-13.patch | 9.59 KB | jhuhta |
| #13 | interdiff_11-13.txt | 2.27 KB | jhuhta |
| #11 | rate-2880351-11.patch | 6.8 KB | krzysztof domański |
| #11 | interdiff-10-11.txt | 6.41 KB | krzysztof domański |
| #10 | 2880351-10.patch | 3.61 KB | rpayanm |
Comments
Comment #2
maune commentedHere is a patch to solve this issue.
Comment #3
maune commentedHere is a patch to solve this issue.
Comment #4
maune commentedComment #5
maune commentedComment #7
jhuhta commentedIf I got it right, the patch #3 was supposed to add an 'active' class to the selected option (up or down). However, it didn't quite do it: it was comparing a local $vote_type ('up' or 'down') to a bundle name ('updown'), which was never true.
I rerolled the patch against current dev, enhanced it a bit to cover also yes/no vote and fixed the problem I mentioned. Now it works for me at least.
So now it saves to $has_voted the value of a vote (1/-1), not its bundle.
Comment #8
krzysztof domańskiComment #9
krzysztof domańskiComment #10
rpayanmComment #11
krzysztof domański1. Let's leave the property 'has_voted' unchanged. Let's add a new one 'user_voted'.
2. I changed the name of the 'active' class to 'rate-voted'.
3. I changed the css for the 'Thumbs Up / Down' widget.
Comment #12
krzysztof domańskiComment #13
jhuhta commented#11 works and looks good and I could've RTBC'd it, but instead added the missing comment lines to the twig templates.
Comment #14
jhuhta commentedSorry, the #13 patch file was left out.
Comment #15
krzysztof domańskiLGTM
Comment #17
krzysztof domańskiThanks!