diff --git a/opentech/apply/funds/templatetags/markdown_tags.py b/opentech/apply/funds/templatetags/markdown_tags.py new file mode 100644 index 0000000000000000000000000000000000000000..9ba5ff19dc0828092dcfab40fdcd9ab6876f7b58 --- /dev/null +++ b/opentech/apply/funds/templatetags/markdown_tags.py @@ -0,0 +1,11 @@ +import mistune + +from django import template + +register = template.Library() + + +@register.filter +def markdown(value): + markdown = mistune.Markdown() + return markdown(value) diff --git a/opentech/settings/base.py b/opentech/settings/base.py index dd2c51d8b7c60631ea719d1334fedf2d173cfbf4..ba0565c37b55af5775515ffa66fca01cd55d4311 100644 --- a/opentech/settings/base.py +++ b/opentech/settings/base.py @@ -118,6 +118,7 @@ INSTALLED_APPS = [ 'hijack', 'compat', + 'pagedown', 'django.contrib.admin', 'django.contrib.auth', diff --git a/opentech/static_src/src/images/editor-buttons.png b/opentech/static_src/src/images/editor-buttons.png new file mode 100644 index 0000000000000000000000000000000000000000..50b37090363e6757e7bd0ba75cd1e0dfaabd13d2 Binary files /dev/null and b/opentech/static_src/src/images/editor-buttons.png differ diff --git a/opentech/static_src/src/sass/apply/components/_editor.scss b/opentech/static_src/src/sass/apply/components/_editor.scss new file mode 100644 index 0000000000000000000000000000000000000000..22affba7006e95ca67fc146a26b257e05d891d3a --- /dev/null +++ b/opentech/static_src/src/sass/apply/components/_editor.scss @@ -0,0 +1,75 @@ +.wmd-panel { +} + +.wmd-button-bar { +} + +.wmd-input { +} + +.wmd-preview { + background-color: $color--sky-blue; +} + +.wmd-button-row { + position: relative; + margin-left: 5px; + margin-right: 5px; + margin-bottom: 5px; + margin-top: 10px; + padding: 0; + height: 20px; +} + +.wmd-spacer { + width: 1px; + height: 20px; + margin-left: 14px; + + position: absolute; + background-color: $color--mid-grey; + display: inline-block; + list-style: none; +} + +.wmd-button { + width: 20px; + height: 20px; + padding-left: 2px; + padding-right: 3px; + position: absolute; + display: inline-block; + list-style: none; + cursor: pointer; + + & > span { + background-image: url('./../../images/editor-buttons.png'); + background-repeat: no-repeat; + background-position: 0 0; + width: 20px; + height: 20px; + display: inline-block; + } +} + +.wmd-spacer1 { + left: 50px; +} + +.wmd-spacer2 { + left: 175px; +} + +.wmd-spacer3 { + left: 300px; +} + +.wmd-prompt-background { + background-color: $color--black; +} + +.wmd-prompt-dialog { + border: 4px solid $color--primary; + background-color: $color--light-grey; + padding: .5em; +} diff --git a/opentech/static_src/src/sass/apply/main.scss b/opentech/static_src/src/sass/apply/main.scss index 014c32220309acca56ec5a01cef8566e06d075ad..745f50807ad3b43d597b5a7f82021f9bec2de050 100644 --- a/opentech/static_src/src/sass/apply/main.scss +++ b/opentech/static_src/src/sass/apply/main.scss @@ -13,6 +13,7 @@ @import 'components/activity-feed'; @import 'components/comment'; @import 'components/button'; +@import 'components/editor'; @import 'components/feed'; @import 'components/filters'; @import 'components/grid'; diff --git a/requirements.txt b/requirements.txt index 470eff2f7ef90b5b758071ed42be1c94679f85da..662083dc29a3e7358dd740608165d11bb3fca26e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,3 +42,5 @@ django-storages==1.6.6 boto3==1.7.75 mailchimp3==3.0.4 scout-apm==1.3.4 +mistune==0.8.4 +django-pagedown==1.0.6