Show the user what he voted even if he can't see other's results
samuelsov - March 12, 2009 - 19:32
| Project: | Decisions |
| Version: | 6.x-0.1-beta3 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | samuelsov |
| Status: | active |
Description
When activating showing results After voting has closed, it's kind of strange to see only the cancel button. We should display the voter's choice. It can be an option to display or not the voters choice...
Also, what is strange is that description of content appears under the voting choices. Should be the contrary by default...

#1
Patch for the weight problem...
#2
Committed the weight patch. Agrees with the work needed on the form output. Keep them coming.
#3
Oh and be more careful in not mixing whitespace changes and fixes. The patch should have been only:
--- decisions_node.inc 5 Dec 2008 03:48:02 -0000 1.2
+++ decisions_node.inc 12 Mar 2009 21:09:17 -0000
@@ -184,6 +184,7 @@
}
}
$node->content['decisions']['status']['#value'] = $status_messages;
+ $node->content['decisions']['#weight'] = 1;
if (arg(2) != 'results' && _decisions_can_vote($node)) {
// User hasn't voted and we're not on the results tab
@@ -197,7 +198,6 @@
}
if (isset($node->voted) && $node->voted && user_access('cancel own vote') && $node->active) {
$node->content['decisions']['cancel']['#value'] = drupal_get_form('decisions_cancel_form', $node->nid);
- $node->content['decisions']['cancel']['#weight'] = 10;
}
return $node;
#4
Patch for adding a little message when the user can't see any results.
The next step will be to create a new hook like hook_decisions_view_own_result which display only the result for the current user but i'm not really sure how to do it for anonymous...
#5
Is calling
theme_decisions_view_own_resultdirectly the proper way? Seems to me that it bypasses the theme system completely.Also, the message is a bit confusing: it sounds as if we just recorded a vote whereas it may have been months ago. Something like "You have already voted on this issue" would be better.
As for displaying the results, rely on the VotingAPI, nothing more. See hook_decisions_view_results() for the way /all/ votes are displayed. We'll need to probably create a new hook that displays only /some/ or "your" votes.
#6
#7
I committed the patch above, we still need to work on displaying what the user voted.