Commit Graph

86 Commits

Author SHA1 Message Date
Penar Musaraj 03deda2147
Upgrade to FontAwesome 5 (take two) (#6673)
* Add missing icons to set

* Revert FA5 revert

 This reverts commit 42572ff

* use new SVG syntax in locales

* Noscript page changes (remove login button, center "powered by" footer text)

* Cast wider net for SVG icons in settings

- include any _icon setting for SVG registry (offers better support for plugin settings)

- let themes store multiple pipe-delimited icons in a setting

- also replaces broken onebox image icon with SVG reference in cooked post processor

* interpolate icons in locales

* Fix composer whisper icon alignment

* Add support for stacked icons

* SECURITY: enforce hostname to match discourse hostname

This ensures that the hostname rails uses for various helpers always matches
the Discourse hostname

* load SVG sprite with pre-initializers

* FIX: enable caching on SVG sprites

* PERF: use JSONP for SVG sprites so they are served from CDN

This avoids needing to deal with CORS for loading of the SVG

Note, added the svg- prefix to the filename so we can quickly tell in
dev tools what the file is

* Add missing SVG sprite JSONP script to CSP

* Upgrade to FA 5.5.0

* Add support for all FA4.7 icons

- adds complete frontend and backend for renamed FA4.7 icons

- improves performance of SvgSprite.bundle and SvgSprite.all_icons

* Fix group avatar flair preview

- adds an endpoint at /svg-sprites/search/:keyword

- adds frontend ajax call that pulls icon in avatar flair preview even when it is not in subset

* Remove FA 4.7 font files
2018-11-26 16:49:57 -05:00
Régis Hanol f402d0d74f FIX: couldn't delete users who voted on a poll 2018-11-23 11:45:53 +01:00
Régis Hanol 92100f82eb FIX: properly disable serializable attributes when poll plugin is disabled 2018-11-20 17:28:41 +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
Sam 42572ff138 Revert font awesome 5 changes
We are still pushing ahead on this 100% just need a bit longer to prepare
all plugins
2018-11-08 16:12:18 +11:00
Penar Musaraj 005e1ecb9b
FEATURE: Update Font Awesome to v5.4.1 and SVGs (#6557)
* First take on subsetting svg icons

* FontAwesome 5 svg subset WIP

* Include icons from plugins/badges into svg sprite subset

* add svg icon support to themes

* Add spec for SvgSprite

* Misc. SVG icon fixes

* Use FA5 svgs in local-dates plugin

* CSS adjustments, fix SVG icons in group flair

* Use SVG icons in poll plugin

* Add SVG icons to /wizard
2018-11-07 13:05:43 -05:00
Sam 29fdb50338 FIX: if poll has not options do not break serializer
Note: we have a proper rewrite of this plugin in progress
it will address this issue in a proper way
2018-10-24 10:04:17 +11:00
Penar Musaraj 753d39f30d Fix NoMethodError in polls#voters 2018-10-09 12:51:49 -04:00
Sam a71fe16647 workaround, we need another lazy operator here
Data can be pretty inconsistent here till our big refactor is done
2018-08-20 10:37:06 +10:00
Sam eacb2593ee workaround badly denormalized data in polls 2018-08-17 11:15:29 +10:00
Jeff Wong 19605e8b0b Feature: Hide plugins that ship with core from plugins panel 2018-05-15 15:50:17 -07:00
Guo Xiang Tan 8cf0f51eb2 UX: Display site settings shortcut for `poll` and `discourse-nginx-performance-report`.
https://meta.discourse.org/t/improving-admin-plugins/84585/29?u=tgxworld
2018-05-08 10:34:32 +08:00
Guo Xiang Tan 0d74c30fa7 Remove more uses of `rescue nil`. 2018-05-07 11:38:23 +08: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
Gerhard Schlager 7a2183e8ab FEATURE: rake task for merging users 2018-03-01 12:28:12 +01:00
Régis Hanol dee35b72f2 FIX: must be able to post in a topic in order to vote on a poll 2018-02-27 00:19:44 +01:00
Joffrey JAFFEUX 067d454937
FIX: makes sur we have polls before validating 2017-12-05 12:07:21 -05:00
Joffrey JAFFEUX 1e0bfa1d97
FIX: poll new_post_manager spec 2017-12-04 16:12:40 +01: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
Guo Xiang Tan 77d4c4d8dc Fix all the errors to get our tests green on Rails 5.1. 2017-09-25 13:48:58 +08:00
Sam 43c0111ca1 FIX: multichoice poll with more than 25 votes
In the past we would double up on avatars due to incorrect logic for
handling offset
2017-08-14 15:33:59 -04:00
Régis Hanol 80daa7006c use new reload-friendly API 2017-08-12 04:22:44 +02:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Sam 8317fb12e0 FIX: don't escape html of poll options 2017-07-25 13:38:19 -04:00
Sam 93e5112dfa correct poll specs 2017-07-18 14:31:22 -04:00
Guo Xiang Tan 112ca20c96 Merge pull request #4675 from tgxworld/fix_polls_forever_broken_if_approval_required
FIX: Polls permanently broken if post requires approval.
2017-03-01 12:56:03 +08:00
Guo Xiang Tan 8bd8f07ce0 FIX: Public polls should not make a request per option. 2017-01-31 17:27:43 +08:00
Guo Xiang Tan bed11dfa0e FIX: Polls permanently broken if post requires approval. 2017-01-26 13:29:43 +08:00
Guo Xiang Tan f9ef1e1997 Opps this broke polls. 2016-07-29 14:28:09 +08:00
Guo Xiang Tan 6538363c18 PERF: Reduce the number of queries when voting. 2016-07-29 14:02:48 +08: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 a546395397 REFACTOR: Migrate markdown functionality in ES6 2016-07-11 12:57:05 -04:00
Guo Xiang Tan 8d46727d67
FEATURE: Poll UI Builder. 2016-06-15 11:14:24 +08:00
Guo Xiang Tan a36203ff78
PERF: Paginate public polls. 2016-06-12 16:14:53 +08:00
Guo Xiang Tan 8ecde35df3
FEATURE: Add public type to polls. 2016-06-08 16:19:13 +08:00
Guo Xiang Tan a849fae5ee Add specs for polls (#4246)
* Extract validation logic into a service object.

* Extract logic for updating polls custom fields into a service object.

* Use `strip_heredoc` instead.

* FIX: Polls do not update when configuration has been changed.
2016-06-06 17:04:56 +02:00
Gerhard Schlager f1bc7de541
Adds support for anonymous votes to the poll plugin 2016-04-23 22:44:09 +02:00
Robin Ward e91379916b
FIX: Provide the ability to `reduce` cooked content
This allows us to strip polls from the group posts page.
2016-04-13 13:25:18 -04:00
Régis Hanol b575f97ece FIX: allows polls on closed topics 2016-03-21 12:12:25 +01:00
Sam Saffron 57944a0694 PERF: only subscribe to a topic once for polls
in the past as views were created and destroyed poll subscriptions would change

this caused a lot of load on messaging bus and uneeded traffic
2016-01-06 20:36:09 +11:00
Régis Hanol 72e7271687 FIX: '.intersect?' isn't available in older version of ruby 2015-12-02 17:25:01 +01:00
Régis Hanol f4184aea33 FIX: properly re-compute # of voters in multiple-choice polls 2015-12-02 12:33:34 +01:00
Régis Hanol 96cd36e86d FIX: properly compute the number of voters using only valid options 2015-11-30 11:23:38 +01:00
Régis Hanol 515fc49727 FIX: replace polls with a link in emails 2015-10-22 19:10:07 +02:00
Régis Hanol 8f2b002203 FIX: a poll option cannot be voted more than 100% of the time 2015-10-16 17:18:22 +02:00
Gerhard Schlager bb52042b46 FIX: Add missing pluralization keys to poll plugin locale 2015-09-27 21:36:57 +02:00
Régis Hanol 2e76c9165a FIX: polls are always editable until the first vote 2015-09-25 18:54:15 +02:00
Régis Hanol 60bbd81607 FIX: polls with votes were preventing users from updating the post 2015-09-14 19:27:54 +02:00
Kane York af042ffe5e FEATURE: Per-plugin settings buttons, "Enabled" column
Also, added enabled_site_setting to the Poll plugin so it shows up properly.
2015-07-02 10:59:06 -07:00