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...

Comments

samuelsov’s picture

StatusFileSize
new4.13 KB

Patch for the weight problem...

anarcat’s picture

Status: Active » Needs work

Committed the weight patch. Agrees with the work needed on the form output. Keep them coming.

anarcat’s picture

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;
samuelsov’s picture

StatusFileSize
new2.42 KB

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...

anarcat’s picture

Is calling theme_decisions_view_own_result directly 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.

anarcat’s picture

Priority: Normal » Critical
anarcat’s picture

Title: Content visualisation after voting » Show the user what he voted even if he can't see other's results
Priority: Critical » Normal
Status: Needs work » Active

I committed the patch above, we still need to work on displaying what the user voted.