mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Pie chart option for poll results (#8352)
This commit is contained in:
committed by
GitHub
parent
720101b3ee
commit
b92a8131c0
@@ -1,5 +1,5 @@
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { observes } from "ember-addons/ember-computed-decorators";
|
||||
import { observes } from "discourse-common/utils/decorators";
|
||||
import { getRegister } from "discourse-common/lib/get-owner";
|
||||
import WidgetGlue from "discourse/widgets/glue";
|
||||
|
||||
@@ -88,12 +88,19 @@ function initializePolls(api) {
|
||||
}
|
||||
|
||||
if (poll) {
|
||||
const glue = new WidgetGlue("discourse-poll", register, {
|
||||
const attrs = {
|
||||
id: `${pollName}-${post.id}`,
|
||||
post,
|
||||
poll,
|
||||
vote
|
||||
});
|
||||
vote,
|
||||
groupableUserFields: (
|
||||
api.container.lookup("site-settings:main")
|
||||
.poll_groupable_user_fields || ""
|
||||
)
|
||||
.split("|")
|
||||
.filter(Boolean)
|
||||
};
|
||||
const glue = new WidgetGlue("discourse-poll", register, attrs);
|
||||
glue.appendTo(pollElem);
|
||||
_glued.push(glue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user