discourse/discourse — pull request #1903 by vikhyat (2014-02-05 03:06:03+00:00)
Title: Add poll plugin.

Pending:

* [ ] Tests won't run correctly until #1901 and #1902 are merged.
* [ ] Currently we look for the first `

` in the post to get a list of options, it would be a good idea to change this to look for the first list inside a [poll]...[/poll] block instead, that way it would be possible to add stuff like the ability to create multi-select polls in the future.
* [ ] i18n -- for the error message when a poll post doesn't contain any options and the "votes" text in the poll result. I don't think there is a way to add i18n strings from plugins at the moment?
* [ ] If options are edited within the first 5 minutes saving doesn't actually reflect the new options since the JSON response isn't used to actually update the post model.
* [ ] `PollPlugin::Poll#set_vote!` needs to be made atomic.
* [ ] Show an error message if the user tries to change options after the first 5 minutes?