﻿ticket,summary,type,release,owner,status,created,modified,_description,_reporter
10703,[PATCH] support of fully anonymous polls,enhancement,,,new,2012-12-13T15:14:24+01:00,2020-05-06T01:58:10+02:00,"This patch adds the ability to make fully anonymous polls, simply by the use of pattern {{{ (*) }}} at the end of the poll question:

{{{
#!diff
Index: pollmacro/trunk/tracpoll/tracpoll.py
===================================================================
--- pollmacro/trunk/tracpoll/tracpoll.py	(revision 11672)
+++ pollmacro/trunk/tracpoll/tracpoll.py	(working copy)
@@ -1,3 +1,4 @@
+import hashlib
 import os
 import re
 import pickle
@@ -49,7 +50,7 @@
         finally:
             fd.close()
 
-    def populate(self, req):
+    def populate(self, req, isAnonymousPoll):
         """""" Update poll based on HTTP request. """"""
         if req.args.get('poll', '') == self.key:
             vote = req.args.get('vote', '')
@@ -58,13 +59,15 @@
             if vote not in self.votes:
                 raise TracError('No such vote %s' % vote)
             username = req.authname or 'anonymous'
+            if isAnonymousPoll:
+                username = hashlib.sha1(username).hexdigest()
             for v, voters in self.votes.items():
                 if username in voters:
                     self.votes[v].remove(username)
             self.votes[vote] = self.votes[vote] + [username]
             self.save()
 
-    def render(self, env, req):
+    def render(self, env, req, isAnonymousPoll):
         out = StringIO()
         can_vote = req.perm.has_permission('POLL_VOTE')
         if can_vote:
@@ -76,6 +79,8 @@
                   ' <ul>\n'
                   % escape(self.title))
         username = req.authname or 'anonymous'
+        if isAnonymousPoll:
+            username = hashlib.sha1(username).hexdigest()
         for id, style, vote in self.vote_defs:
             hid = escape(str(id))
             out.write('<li%s>\n' % (style and ' class=""%s""' % style or ''))
@@ -90,12 +95,15 @@
             else:
                 out.write(vote)
             if self.votes[id]:
-                out.write(' <span class=""voters"">(<span class=""voter"">' +
-                          '</span>, <span class=""voter"">'.join(self.votes[id]) +
-                          '</span>)</span>')
+                if isAnonymousPoll:
+                    out.write(' <span class=""voters"">(%s)</span>' % len(self.votes[id]))
+                else:
+                    out.write(' <span class=""voters"">(<span class=""voter"">' +
+                              '</span>, <span class=""voter"">'.join(self.votes[id]) +
+                              '</span>)</span>')
             out.write('</li>\n')
         if can_vote:
             out.write('<input type=""submit"" value=""Vote""/>')
         else:
             out.write(""<br/><i>You don't have permission to vote. You may need to login.</i>"")
         out.write(' </ul>\n</fieldset>\n')
@@ -128,6 +136,7 @@
                       'Path where poll pickle dumps should be stored.')
 
     def expand_macro(self, formatter, name, content):
+        isAnonymousPoll = False
         req = formatter.req
         if not content:
             return system_message(""A title must be provided as the first argument to the poll macro"")
@@ -136,9 +145,11 @@
         if len(content) < 2:
             return system_message(""One or more options must be provided to vote on."")
         title = content.pop(0)
-        return self.render_poll(req, title, content)
+        if title.endswith('(*)'):
+            isAnonymousPoll = True
+        return self.render_poll(req, title, content, isAnonymousPoll)
 
-    def render_poll(self, req, title, votes):
+    def render_poll(self, req, title, votes, isAnonymousPoll):
         add_stylesheet(req, 'poll/css/poll.css')
         if not req.perm.has_permission('POLL_VIEW'):
             return ''
@@ -184,8 +195,8 @@
 
         poll = Poll(self.base_dir, title, all_votes)
         if req.perm.has_permission('POLL_VOTE'):
-            poll.populate(req)
-        return poll.render(self.env, req)
+            poll.populate(req, isAnonymousPoll)
+        return poll.render(self.env, req, isAnonymousPoll)
 
     # IPermissionRequestor methods
     def get_permission_actions(self):
}}}
",falkb
5582,Option to close poll (disable voting),enhancement,0.11,,new,2009-07-29T12:47:57+02:00,2020-05-06T01:58:10+02:00,"Voting is great but I missed possibility to close polls.

My idea is to add additional parameter ""DISABLE"" (or anyhow):

`[[Poll(Some question?; Yes; No; DISABLE)]]`

which causes the ""Vote"" button is not active (or even disappears). So when comes deadline of voting I will edit existing pool macro, add this parameter so pool will be presented with inactive voting button from now.

Could you extend your stuff with this feature?",anonymous
3495,Use unique database file names for poll result storage,enhancement,0.11,,new,2008-07-31T17:47:57+02:00,2020-05-06T01:58:10+02:00,"Currently the PollMacro stores the poll results simply in a file named after the poll question text string. This leads to clashes if the same poll question is used in different tickets or wiki pages. Therefore, changing the file name convention by using unique identifiers (e.g., `ticketnumber-question.poll`, `wikipagename-qestion.poll`) would be a nice improvement.",HeX
2777,Disable Reply when tracpoll is set on a ticket,defect,0.10,,new,2008-03-21T19:31:44+01:00,2020-05-06T01:58:10+02:00,"I'd like to see the Trac 'Reply' function be disabled once a tracpoll is setup for a ticket.  Currently, if a user hits the reply button, the same poll is repeated in the reply.
Maybe there is another way around this that I haven't discovered yet.  I have users that will submit enhancement suggestions.  At a certain point in time, lets say monthly, select enhancement requests are then 'turned off' from getting replies (changes) to the request and are then put up for a poll of all users on the need for such an enhancement. Is there a way to control this by disabling reply?
",projects4joe
2267,Graphical representation of the result,enhancement,0.10,,new,2007-12-04T18:35:41+01:00,2020-05-06T01:58:10+02:00,"Show not only the names, but also a graphical bar, just like in the roadmap view",anonymous
1895,Support multiple selections via checkboxes,enhancement,0.10,,new,2007-08-06T03:50:57+02:00,2020-05-18T06:28:11+02:00,"currently PollMacro can do single checks for each user with ""radio"". it would be nice if we can make another macro that allow user check multiple items with ""checkbox"".",phpxcache
923,Vote from anonymous not counted more than once,defect,0.10,,new,2006-11-19T10:47:02+01:00,2020-05-06T01:58:10+02:00,"After installing tracpoll 0.1 a vote from 'anonymous' is not counted more often than once.

That's how I call the plugin:
{{{
[[Poll(Do you like the project?; Yes; No; Don't know)]]
}}}
After the first anonymous vote the result looks like this: [[BR]]
 * Yes '''(gerry, anonymous)'''
 * No
 * Don't know
After voting again as anonymous it changes to this: [[BR]]
 * Yes '''(gerry)'''
 * No '''(anonymous)'''
 * Don't know
From what I remember it used to be like this after the second vote: [[BR]]
 * Yes '''(gerry, anonymous)'''
 * No '''(anonymous)'''
 * Don't know

Is this intentionally done like that?
I understand, that double votes can change the result. But if anonymous users are allowed to vote, I'd prefer if every vote is counted.",gerryg
807,[Patch] Option to list arguments horizontally as well as vertically,enhancement,0.11,,new,2006-10-13T20:54:24+02:00,2020-05-06T01:58:10+02:00,"It would be nice if one had the option to list the arguments horizontally as well if needed in place of the default vertical configuration. This can be useful for longer surveys, etc. where some space saving is useful.",roop@…
