diff --git a/dispatch/modules/content/embeds.py b/dispatch/modules/content/embeds.py index 72ff401fc..6ab9c90a4 100644 --- a/dispatch/modules/content/embeds.py +++ b/dispatch/modules/content/embeds.py @@ -97,16 +97,6 @@ def render(self, data): return '' return widget.render(data=data['data']) - - # except ZoneNotFound: - # return '' - - # try: - # return zone.widget.render(add_context=kwargs) - # except (WidgetNotFound, AttributeError): - # pass - - # return '' class ImageEmbed(AbstractTemplateEmbed): TEMPLATE = 'embeds/image.html' diff --git a/dispatch/modules/content/render.py b/dispatch/modules/content/render.py index 4201ddeca..5e18ba7f7 100644 --- a/dispatch/modules/content/render.py +++ b/dispatch/modules/content/render.py @@ -12,6 +12,10 @@ def render_node(html, node): return html + '
%s
' % node['data'] else: try: + if node['type'] == 'poll': + node['type'] = 'widget' + node['data']['data'] = node['data'] + return html + embeds.render(node['type'], node['data']) except EmbedException: return html diff --git a/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js b/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js index af8385739..3ac9d00bd 100644 --- a/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js +++ b/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js @@ -9,7 +9,8 @@ import { PullQuoteEmbed, GalleryEmbed, CodeEmbed, - WidgetEmbed + WidgetEmbed, + PollEmbed } from '../../vendor/dispatch-editor' const embeds = [ @@ -18,7 +19,8 @@ const embeds = [ CodeEmbed, PullQuoteEmbed, GalleryEmbed, - WidgetEmbed + WidgetEmbed, + PollEmbed ] export default class ArticleContentEditor extends React.Component { diff --git a/dispatch/static/manager/src/js/components/fields/PollField.js b/dispatch/static/manager/src/js/components/fields/PollField.js index f7633740f..5b6e8914c 100644 --- a/dispatch/static/manager/src/js/components/fields/PollField.js +++ b/dispatch/static/manager/src/js/components/fields/PollField.js @@ -9,4 +9,4 @@ export default function PollField(props) { many={props.field.many} onChange={selected => props.onChange(selected)} /> ) -} \ No newline at end of file +} diff --git a/dispatch/static/manager/src/js/components/inputs/selects/PollSelectInput.js b/dispatch/static/manager/src/js/components/inputs/selects/PollSelectInput.js index cc2a2ffc7..30d8055f9 100644 --- a/dispatch/static/manager/src/js/components/inputs/selects/PollSelectInput.js +++ b/dispatch/static/manager/src/js/components/inputs/selects/PollSelectInput.js @@ -22,7 +22,7 @@ class PollSelectInputComponent extends React.Component { return (