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

samuelsov - March 12, 2009 - 20:46

Patch for the weight problem...

AttachmentSize
decisions-HEAD-400020-1.patch 4.13 KB

#2

anarcat - March 12, 2009 - 21:10
Status:active» needs work

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

#3

anarcat - March 12, 2009 - 21:10

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

samuelsov - March 12, 2009 - 21:25

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

AttachmentSize
decisions-HEAD-400020-4.patch 2.42 KB

#5

anarcat - March 12, 2009 - 21:55

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.

#6

anarcat - July 27, 2009 - 22:03
Priority:normal» critical

#7

anarcat - July 27, 2009 - 23:38
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.

 
 

Drupal is a registered trademark of Dries Buytaert.