Commit Graph

27 Commits

Author SHA1 Message Date
Joffrey JAFFEUX 95d8a421be
fixes linting 2018-11-19 16:29:15 +01:00
Régis Hanol 4459665dee
REFACTOR: use tables instead of custom fields for polls (#6359)
Co-authored-by: Guo Xiang Tan <tgx_world@hotmail.com>
2018-11-19 14:50:00 +01:00
Joffrey JAFFEUX 60ff0e9b8c
missing prettified files 2018-06-15 18:42:20 +02:00
Régis Hanol 9ff2d540ba fix the build 2018-05-03 10:32:01 +02:00
Régis Hanol ba14c80b9c FEATURE: automatically close a poll on a given date and time 2018-05-03 02:12:19 +02:00
Joffrey JAFFEUX 63bab32816 FEATURE: introduces minimum trust level for polls (#5391)
* FEATURE: introduces minimum trust level for polls

This commit makes `poll_enabled` less misleading and introduces `poll_minimum_trust_level_to_create`. If poll are enabled they will always be cooked, and if you have the required trust level you can create polls. As a side effect, it also fixes a bug where rebaking a post created by staff member when `poll_enabled=false` would end up not cooking it.

It also adds more tests to ensure settings are respected.

* admins should be whitelisted

* checks for admin in post validation

* test for >= instead of == trust level
2017-12-04 14:47:11 +01:00
Eric Berry ab22c8cad4 FIX: Infinite loop when poll step is zero (#5380)
* Fix infinite loop when poll step is zero

* Add test for step minimum and for breaking test

* Remove trailing spaces (eslint)

* Remove extra space (eslint)

* Removed test call .twice
2017-11-30 17:04:41 +01:00
Sam 9b4f5710e6 api cleanup for before / after rules 2017-07-21 16:12:11 -04:00
Sam b7f58fe880 regression polls could not be closed properly 2017-07-18 14:52:58 -04:00
Sam 1661a8745b correct issues with poll specs
fixes regression where an error message is missing from a poll
with one option
2017-07-17 17:44:48 -04:00
Sam 8921058c67 FIX: medium URL with @ incorrectly handled as mention
Also:

- remove unused code
- rename bbcode_ruler to bbcode.ruler
- add md.core.textPostProcess.ruler to apply at end of chain (excluding links)
2017-07-17 17:44:48 -04:00
Sam 5d139e461c FIX: multi option poll not working (new engine) 2017-07-11 14:43:34 -04:00
Sam 6200d7d6ab correct bug where only a single poll per topic worked 2017-06-28 15:36:19 -04:00
Sam 234694b50f Feature: CommonMark support
This adds the markdown.it engine to Discourse.
https://github.com/markdown-it/markdown-it

As the migration is going to take a while the new engine is default
disabled. To enable it you must change the hidden site setting:
enable_experimental_markdown_it.

This commit is a squash of many other commits, it also includes some
improvements to autospec (ability to run plugins), and a dev dependency
on the og gem for html normalization.
2017-06-23 12:01:33 -04:00
Robin Ward f07443b488 Migrate Discourse Polls to use vdom instead of embedded ember 2016-12-09 10:42:56 -05:00
Régis Hanol 28b7ef7142 FIX: rendering multiple polls in the same post was broken 2016-11-30 22:59:58 +01:00
rizka10 4ce99c998b Improve summing poll percentages to 100
My first JavaScript! I have little experience with C++ and even less with Java, but that was enough to figure out a way to solve the task. The solution is rather good, but there may be better ways. I'm going to start a pull request. Even if it gets rejected, an expert can use the idea.

NOTE: The code needs some serious testing before potential merging. I did some testing and it worked, but don't trust in my skills.
2016-11-03 11:11:17 +02:00
Robin Ward f38347400c FIX: `currentUser` can be null 2016-07-19 12:48:52 -04:00
Guo Xiang Tan c3cab98998 FEATURE: Admins should be able to create polls even when plugin is disabled. 2016-07-13 18:05:19 +08:00
Robin Ward ff4e60808a FIX: Polls were broken server side 2016-07-11 12:57:05 -04:00
Robin Ward a546395397 REFACTOR: Migrate markdown functionality in ES6 2016-07-11 12:57:05 -04:00
Régis Hanol fc92166d5f FIX: when rouding numbers in poll resuls, *don't* select a never-been-voted-for option to round up from zero 2016-01-14 01:59:46 +01:00
Régis Hanol 08ae5f89bd FIX: rounding issue might appear when summing up all the decimals 2015-11-30 11:24:25 +01:00
Régis Hanol 68a44a1d59 FIX: use an algorithm that doesn't re-order percentages when rounding them up to 100% in single choice polls 2015-11-25 00:14:24 +01:00
Régis Hanol 32b6ccd622 FIX: properly round % so they add up to 100 in polls 2015-11-19 18:23:38 +01:00
Régis Hanol b25a16ee3e FEATURE: 2 new reports: time to first response, topics with no response
FIX: relativeAgeMediumSpan was off by 1
REFACTOR: extracted decimalAdjust & round functions from the poll plugin
2015-06-22 19:46:51 +02:00
Régis Hanol a737090442 - FEATURE: revamped poll plugin
- add User.staff scope
- inject MessageBus into Ember views (so it can be used by the poll plugin)
- REFACTOR: use more accurate is_first_post? method instead of post_number == 1
- FEATURE: add support for JSON-typed custom fields
- FEATURE: allow plugins to add validation
- FEATURE: add post_custom_fields to PostSerializer
- FEATURE: allow plugins to whitelist post_custom_fields
- FIX: don't bump when post did not save successfully
- FEATURE: polls are supported in any post
- FEATURE: allow for multiple polls in the same post
- FEATURE: multiple choice polls
- FEATURE: rating polls
- FEATURE: new dialect allowing users to preview polls in the composer
2015-04-23 19:33:29 +02:00