diff --git a/opentech/apply/activity/forms.py b/opentech/apply/activity/forms.py index 904fde0e68bc065009390ddc754b3188088eb967..7207068278ddd6893a3418d54dc87475f5318775 100644 --- a/opentech/apply/activity/forms.py +++ b/opentech/apply/activity/forms.py @@ -2,6 +2,8 @@ from django import forms from django.core.exceptions import ValidationError from django.utils.safestring import mark_safe +from pagedown.widgets import PagedownWidget + from .models import Activity, VISIBILILTY_HELP_TEXT, VISIBILITY @@ -15,6 +17,7 @@ class CommentForm(forms.ModelForm): } widgets = { 'visibility': forms.RadioSelect(), + 'message': PagedownWidget(), } def __init__(self, *args, user=None, **kwargs): diff --git a/opentech/apply/activity/templates/activity/include/listing_base.html b/opentech/apply/activity/templates/activity/include/listing_base.html index 15ff754d5f125cb2f217ed09ec2dca03601af066..e76d3ec0297c39e7bd63338ad06a7d5e1bea5d19 100644 --- a/opentech/apply/activity/templates/activity/include/listing_base.html +++ b/opentech/apply/activity/templates/activity/include/listing_base.html @@ -1,4 +1,4 @@ -{% load activity_tags %} +{% load activity_tags bleach_tags markdown_tags %} <div class="feed__item feed__item--{{ activity.type }}"> <div class="feed__pre-content"> <p class="feed__label feed__label--{{ activity.type }}">{{ activity.type|capfirst }}</p> @@ -19,13 +19,13 @@ updated <a href="{{ activity.submission.get_absolute_url }}">{{ activity.submission.title }}</a> {% endif %} - {{ activity.message|linebreaksbr }} + {{ activity.message|markdown|bleach }} {% if not submission_title and activity|user_can_see_related:request.user %} {% with url=activity.related_object.get_absolute_url %} {% if url %} <a href="{{ url }}" class="feed__related-item"> - <svg><use xlink:href="#arrow-head-pixels--solid"></use></svg> + {{ activity.related_object }} <svg><use xlink:href="#arrow-head-pixels--solid"></use></svg> </a> {% endif %} {% endwith %} diff --git a/opentech/apply/funds/templates/funds/applicationsubmission_admin_detail.html b/opentech/apply/funds/templates/funds/applicationsubmission_admin_detail.html index 5cc8cc9b0e583c3e7c5bbf49c32130517068c74f..e0a41610a6575d80050c321abbd4416b41a59bb6 100644 --- a/opentech/apply/funds/templates/funds/applicationsubmission_admin_detail.html +++ b/opentech/apply/funds/templates/funds/applicationsubmission_admin_detail.html @@ -38,6 +38,7 @@ {% block extra_js %} {{ reviewer_form.media.js }} + {{ comment_form.media.js }} <script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.4.1/jquery.fancybox.min.js"></script> <script src="{% static 'js/apply/fancybox-global.js' %}"></script> <script src="{% static 'js/apply/tabs.js' %}"></script> diff --git a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html index ab0d66ee88020181b763d932bef573136a516b00..43041ef7aa72a58aa0aa4a55cc8670795cea2821 100644 --- a/opentech/apply/funds/templates/funds/applicationsubmission_detail.html +++ b/opentech/apply/funds/templates/funds/applicationsubmission_detail.html @@ -130,6 +130,7 @@ {% endblock %} {% block extra_js %} + {{ comment_form.media.js }} <script src="{% static 'js/apply/tabs.js' %}"></script> <script src="{% static 'js/apply/submission-text-cleanup.js' %}"></script> {% endblock %} diff --git a/opentech/static_src/src/sass/apply/components/_editor.scss b/opentech/static_src/src/sass/apply/components/_editor.scss index 22affba7006e95ca67fc146a26b257e05d891d3a..7c1c0639dc159ac3e0ff0b21ac7289f115a70203 100644 --- a/opentech/static_src/src/sass/apply/components/_editor.scss +++ b/opentech/static_src/src/sass/apply/components/_editor.scss @@ -1,14 +1,26 @@ .wmd-panel { } -.wmd-button-bar { -} - .wmd-input { } .wmd-preview { background-color: $color--sky-blue; + padding: .1px 10px; + width: 100%; + + ul { + padding-left: 20px; + list-style: outside disc; + } + + ol { + list-style: inside decimal; + } + + @include media-query(tablet-portrait) { + max-width: 70%; + } } .wmd-button-row { diff --git a/opentech/static_src/src/sass/apply/components/_feed.scss b/opentech/static_src/src/sass/apply/components/_feed.scss index a3862c226e0306734e1a663e54e95f412e6e5e6e..2ab489a4bf4b1029ce4e6df43d4de6063046599f 100644 --- a/opentech/static_src/src/sass/apply/components/_feed.scss +++ b/opentech/static_src/src/sass/apply/components/_feed.scss @@ -15,6 +15,15 @@ max-height: 300px; overflow: hidden; } + + ul { + padding-left: 20px; + list-style: outside disc; + } + + ol { + list-style: inside decimal; + } } &__label {