diff --git a/dispatch/__init__.py b/dispatch/__init__.py index 1b6caa8e7..e9057461f 100644 --- a/dispatch/__init__.py +++ b/dispatch/__init__.py @@ -1,3 +1,3 @@ -__version__ = '1.0.3' +__version__ = '1.1.0' diff --git a/dispatch/modules/content/embeds.py b/dispatch/modules/content/embeds.py index 9878f0d67..ad3abd412 100644 --- a/dispatch/modules/content/embeds.py +++ b/dispatch/modules/content/embeds.py @@ -126,6 +126,15 @@ def prepare_data(self, data): class PageBreakEmbed(AbstractTemplateEmbed): TEMPLATE = 'embeds/pagebreak.html' + +class DropCapEmbed(AbstractTemplateEmbed): + TEMPLATE = 'embeds/dropcap.html' + + @classmethod + def prepare_data(self, data): + return { + 'paragraph': data.get('paragraph', None) + } class GalleryEmbed(AbstractTemplateEmbed): TEMPLATE = 'embeds/gallery.html' @@ -165,3 +174,4 @@ def prepare_data(self, data): embeds.register('image', ImageEmbed) embeds.register('gallery', GalleryEmbed) embeds.register('pagebreak', PageBreakEmbed) +embeds.register('dropcap', DropCapEmbed) diff --git a/dispatch/static/manager/package.json b/dispatch/static/manager/package.json index 95432f454..cb2ab5f94 100644 --- a/dispatch/static/manager/package.json +++ b/dispatch/static/manager/package.json @@ -1,6 +1,6 @@ { "name": "dispatch", - "version": "1.0.3", + "version": "1.1.0", "description": "The frontend framework for the Dispatch publishing platform.", "author": "Peter Siemens ", "homepage": "https://www.ubyssey.ca", diff --git a/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js b/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js index 29a776ba0..4b755b74f 100644 --- a/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js +++ b/dispatch/static/manager/src/js/components/ArticleEditor/ArticleContentEditor.js @@ -13,7 +13,8 @@ import { PollEmbed, PodcastEmbed, InteractiveMapEmbed, - PageBreakEmbed + PageBreakEmbed, + DropCapEmbed } from '../../vendor/dispatch-editor' const embeds = [ @@ -26,7 +27,8 @@ const embeds = [ PollEmbed, PodcastEmbed, InteractiveMapEmbed, - PageBreakEmbed + PageBreakEmbed, + DropCapEmbed ] export default class ArticleContentEditor extends React.Component { diff --git a/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/DropCapEmbed.js b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/DropCapEmbed.js new file mode 100644 index 000000000..b9ebb60a5 --- /dev/null +++ b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/DropCapEmbed.js @@ -0,0 +1,29 @@ +import React from 'react' +import { TextInput } from '../../../components/inputs' + +import * as Form from '../../../components/Form' + +function DropCapEmbedComponent(props) { + return ( +
+ + + props.updateField('paragraph', e.target.value)} /> + + +
+ ) +} + + +export default { + type: 'dropcap', + component: DropCapEmbedComponent, + defaultData: { + paragraph: '' + } +} + diff --git a/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/PageBreakEmbed.js b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/PageBreakEmbed.js index 392e46f87..88b5f5d76 100644 --- a/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/PageBreakEmbed.js +++ b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/PageBreakEmbed.js @@ -1,9 +1,7 @@ import React from 'react' -import { TextInput } from '../../../components/inputs' - import * as Form from '../../../components/Form' -function PageBreakEmbedComponent(props) { +function PageBreakEmbedComponent() { return (
diff --git a/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/index.js b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/index.js index 9a8ff9ad7..e8629b7a1 100644 --- a/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/index.js +++ b/dispatch/static/manager/src/js/vendor/dispatch-editor/embeds/index.js @@ -8,6 +8,7 @@ import PollEmbed from './PollEmbed' import PodcastEmbed from './PodcastEmbed' import InteractiveMapEmbed from './InteractiveMapEmbed' import PageBreakEmbed from './PageBreakEmbed' +import DropCapEmbed from './DropCapEmbed' export { ImageEmbed, @@ -19,5 +20,6 @@ export { PollEmbed, PodcastEmbed, InteractiveMapEmbed, - PageBreakEmbed + PageBreakEmbed, + DropCapEmbed } diff --git a/dispatch/static/manager/src/js/vendor/dispatch-editor/index.js b/dispatch/static/manager/src/js/vendor/dispatch-editor/index.js index d1262dcf2..3282bec48 100644 --- a/dispatch/static/manager/src/js/vendor/dispatch-editor/index.js +++ b/dispatch/static/manager/src/js/vendor/dispatch-editor/index.js @@ -10,7 +10,8 @@ import { PollEmbed, PodcastEmbed, InteractiveMapEmbed, - PageBreakEmbed + PageBreakEmbed, + DropCapEmbed } from './embeds' import { @@ -36,5 +37,6 @@ export { PollEmbed, PodcastEmbed, InteractiveMapEmbed, - PageBreakEmbed + PageBreakEmbed, + DropCapEmbed } diff --git a/setup.py b/setup.py index 6a9b4f2a4..28dd32801 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup(name='dispatch', - version='1.0.3', + version='1.1.0', description='A publishing platform for modern newspapers', url='https://github.com/ubyssey/dispatch', author='Peter Siemens',