[[PageOutline(2-5,Contents,pullout)]] = Add polls and voting functionality to wiki pages and tickets == Description This is a fully featured database driven poll macro with permission controls for voting and polls creation. [https://developers.google.com/chart/?hl=en Google charts] is used to graphically show poll results. The purpose of this macro is to provide an easy way to integrate polls with Trac wiki and ticket pages. Key features: 1. '''Response type''': Poll creator can decide the response type for polls, ie whether you want single response poll (radio button poll) or multiple response poll (checkbox button poll). 1. '''Google charts''': Poll creator can decide which type of chart they want to use for showing poll results. 1. '''Poll options''': Poll option can be any valid english string or any Ticket number from Trac, !EasyPoll will fetch summary for given ticket and use it as option text. 1. '''Change vote''': Poll creator can manage whether user can change their vote or not after casting it for the first time. Permissions: this macro introduces the following permissions: 1. `EASYPOLL_CREATE`: this permission allows a user to create polls in wiki or ticket pages. 1. `EASYPOLL_VOTE`: this permission allows a user to vote on polls in wiki or ticket pages. Note that the `TRAC_ADMIN` permission provides for both of the above permissions. Every logged in user on Trac can see !EasyPoll, but can vote or create only if the user has sufficient permissions. Example: {{{ [[EasyPoll(name = my first poll, title = What's the best programming language to start with?, response_type = single, options = Python : C : PHP : Java : Lisp, user_can_change_vote = false, chart_type = pie)]] }}} Attributes: 1. name (required): name is used as a poll identifier, if you change the name value than it will be treated as new poll. Nowhere in the poll the name will be shown. Don't change the name of the poll after poll creation. 1. title (required): title will be used as a poll title. You can change it whenever you want. 1. options (required): options should be separated by colon (:) option can also have Ticket id as their option like options = #1 : #2 : #3 In this case the summary will be pulled out from the valid tickets and will be used as option text with ticket link. 1. response (optional): response can take two values (1) multiple and (2) single. Default is (2) single option. 1. multiple: multiple response type will generate poll with checkboxes, in this case user can choose multiple options. 1. single: single response type will generate poll with radio buttons, in this case user can choose only one option. 1. user_can_change_vote(optional): user_can_change_vote can take two values (1) false and (2) true. Default is (1) false. 1. false: once user cast their vote, they cannot change their vote, Poll will be disabled for them, however they can see poll results. 1. true: user can change their vote at any time and many times. Poll will always be enabled for them and they can see poll results. 1. chart_type(optional): chart_type can take two values (1) pie and (2) bar. Default is (1) pie. 1. pie: Pie chart will be used to show poll results. 1. bar: Bar chart will be used to show poll results. User can see poll results only after casting their vote. Sample Poll Example: [[Image(EasyPoll_Example_Image.2.png, border=2)]] Limitations: 1. !EasyPoll as of now only supports ASCII characters. 1. Don't use comma (,) while picking poll options, because it is used as an attribute separator. Instead, options should be separated by a colon (:). See also: PollMacro, which works up to Trac v1.2. == Bugs/Feature Requests Please provide your feedback/suggestions to hi.amigo@gmail.com. I would really appreciate it. Existing bugs and feature requests for EasyPollMacro are [report:9?COMPONENT=EasyPollMacro here]. If you have any issues, create a [/newticket?component=EasyPollMacro new ticket]. [[TicketQuery(component=EasyPollMacro&group=type,format=progress)]] == Download Download the zipped source from [export:easypollmacro here]. == Source You can check out EasyPollMacro from [/svn/easypollmacro here] using Subversion, or [source:easypollmacro browse the source] with Trac. == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. == Recent Changes [[ChangeLog(easypollmacro, 3)]] == Author/Contributors '''Author:''' [wiki:itspanky] [[BR]] '''Maintainer:''' [[Maintainer]] [[BR]] '''Contributors:'''